Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

WooCommerce & Apple TV


Published on

It all started with an idea when it got announced and shared by Kaspars Dambis. He wrote a blog post about it and I really started digging the idea even more. During this talk I will discuss new options Apple TV gives developers like us. Showing the power of the REST API and the XML template format of Apple to build a WooCommerce AppleTV app.

Published in: Technology
  • Be the first to comment

WooCommerce & Apple TV

  2. 2. A different focus
 then I wanted
  3. 3. WordCamp Norway 2012
  4. 4. Talked about integrating apps
  5. 5. WordPress supplying data to iOS apps
  6. 6. Integration done through JSON API
  7. 7. Now we got the REST API
  8. 8. 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.
  9. 9. 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
  10. 10. How to interact with it • rest_api_init to register your routes
  11. 11. How to interact with it
  12. 12. Apple TV
  13. 13. 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
  14. 14. 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
  15. 15. 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
  16. 16. TVML
  17. 17. 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
  18. 18. productTemplate
  19. 19. Above the fold
  20. 20. Under the fold
  21. 21. WooCommerce integration
  22. 22. WordPress Plugin
  23. 23. 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
  24. 24. 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
  25. 25. The TV APP
  26. 26. 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
  27. 27. Current issues
  28. 28. It’s not exactly HTML
  29. 29. Payment
  30. 30. DEMO
  31. 31. HOME SCREEN
  32. 32. CATALOG
  34. 34. DISCOUNTS
  37. 37. will this be the future
  38. 38. Marko Heijnen Founder of CodeKitchen Ex-lead developer of GlotPress Core contributor for WordPress Organizer for WordCamp Belgrade
  39. 39. Marko Heijnen @markoheijnen
  40. 40. Thank you for listening Questions?