Although being part of your tvOS app, the top shelf extension (or TV Services Extension) can not directly communicate with your main app. Instead you have to use a custom URL scheme to send messages to your main apps AppDelegate. A URL scheme can be used for inter-app communication through a protocol that you define.
- [Tutor] When we have a look at our project,…then there are two targets.…We do have our main application, that looks like this…and we also have our extension, which is a ServiceProvider,…that provides the Apple TV home screen…with these two nice, TopShelf items…and because we are not within one app,…we actually need to use techniques…of inter app communication…to communicate which item we actually pressed…and the way to do that is by using URL schemes…and we can create our own URL scheme in info plist,…so what happens now is that every time…we press on one of those items,…the TopShelf extension sends a URL…back to our main application,…our main application listens for this specific URL scheme…and decides if we have pressed this TopShelf item…or the right TopShelf item,…but in order for this to work,…we need to define this URL scheme…and we can do that in the info plist.…
So I right-click here again in the info plist…of the main application, not our TopShelf extension…and I'm adding a row, which is going to be URL types…
- The Siri remote
- The focus model
- Adding video assets and imagery
- UIKit components
- Location services
- Accessing a Web API
- Enabling the top shelf and layered images
- Setting up shortcuts
- Communicating with URL schemes
- Adding a layered app icon
Skill Level Beginner
1. Introducing tvOS Development
2. Your First tvOS App: Build the UI
3. Your First tvOS App: Add the Logic
4. Final Touches
Next steps1m 18s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.