woocommerce & apple tv

40
5 CODEKITCHEN

Upload: marko-heijnen

Post on 12-Apr-2017

746 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: WooCommerce & Apple TV

5CODEKITCHEN

Page 2: WooCommerce & Apple TV

A different focusthen I wanted

Page 3: WooCommerce & Apple TV

WordCamp Norway 2012

Page 4: WooCommerce & Apple TV

Talked about integrating apps

Page 5: WooCommerce & Apple TV

WordPress supplying data to iOS apps

Page 6: WooCommerce & Apple TV

Integration done through JSON API

Page 7: WooCommerce & Apple TV

Now we got the REST API

Page 8: WooCommerce & Apple TV

What is it?• API is short for Application Program Interface

• Its for interaction with the wider world

• A REST API, in turn, is a particular architectural approach

• REST stands for Representational State Transfer

• Use HTTP methods explicitly: It takes place over the web with standard HTTP methods such as PUT, GET, POST and DELETE.

Page 9: WooCommerce & Apple TV

What’s currently in core• Currently the infrastructure has been added in 4.4

• The infrastructure handles the routing, argument handling, JSON serialisation/deserialisation, status codes, and all that other lovely REST stuff.

• No endpoints has been added yet

Page 10: WooCommerce & Apple TV

How to interact with it• rest_api_init to register your routes

Page 11: WooCommerce & Apple TV

How to interact with it

Page 12: WooCommerce & Apple TV

Apple TV

Page 13: WooCommerce & Apple TV

What is it?• A digital media player and micro console

• Can receive digital data from a number of sources

• Most used to stream videos from the iTunes

• Another great feature is the ability to use AirPlay

Page 14: WooCommerce & Apple TV

The latest version• Complete new OS called tvOS

• Latest generation finally got an app store

• Including a refreshed remote with Siri support

• All apps due need to have Siri support

Page 15: WooCommerce & Apple TV

How to build something for it• Going the native way in Swift

• Using the template engine, TVML

• It has great new APIs for developers to use and build great new applications

Page 16: WooCommerce & Apple TV

TVML

Page 17: WooCommerce & Apple TV

What is it?• Use Apple’s Television Markup Language (TVML)

to create individual pages inside of a client-server app

• Every page in a client-server app is built on a TVML template

• TVML templates define what elements can be used and in what order

• Each template is designed to display information in a specific way

Page 18: WooCommerce & Apple TV

productTemplate

Page 19: WooCommerce & Apple TV

Above the fold

Page 20: WooCommerce & Apple TV

Under the fold

Page 21: WooCommerce & Apple TV

WooCommerce integration

Page 22: WooCommerce & Apple TV

WordPress Plugin

Page 23: WooCommerce & Apple TV

Integration• Using the REST API to serve other data then JSON

• Using filter ‘rest_pre_serve_request’ to do so

• Serving Javascript for the application logic

• Serving XML template though a Javascript variable

• Soon API endpoint for HTML dialog for payments

Page 24: WooCommerce & Apple TV

Templates• Build the templates of Apple as classes

• Add helper methods to pass in the information

• Can be extended/changed by the filter wc_appletv_templates

Page 25: WooCommerce & Apple TV

The TV APP

Page 26: WooCommerce & Apple TV

The TV APP• Almost default demo app for now

• Add header to WordPress that gets the javascript application URL

• App checks if the REST API and Application URL are given

• First interaction of Swift with Javascript

Page 27: WooCommerce & Apple TV

Current issues

Page 28: WooCommerce & Apple TV

It’s not exactly HTML

Page 29: WooCommerce & Apple TV

Payment

Page 30: WooCommerce & Apple TV

DEMO

Page 31: WooCommerce & Apple TV

HOME SCREEN

Page 32: WooCommerce & Apple TV

CATALOG

Page 33: WooCommerce & Apple TV

CATALOG WITHOUT MENU

Page 34: WooCommerce & Apple TV

DISCOUNTS

Page 35: WooCommerce & Apple TV

PRODUCT (ABOVE FOLD)

Page 36: WooCommerce & Apple TV

PRODUCT (BELOW FOLD)

Page 37: WooCommerce & Apple TV

will this be the future

Page 38: WooCommerce & Apple TV

Marko HeijnenFounder of CodeKitchen

Ex-lead developer of GlotPress

Core contributor for WordPress

Organizer for WordCamp Belgrade

Page 39: WooCommerce & Apple TV

Marko [email protected]

@markoheijnen

Page 40: WooCommerce & Apple TV

Thank you for listening

Questions?