+ All Categories
Home > Technology > iOS 10 Notification App Extensions

iOS 10 Notification App Extensions

Date post: 18-Feb-2017
Category:
Upload: david-ventura-met
View: 137 times
Download: 3 times
Share this document with a friend
17
NOTIFICATION APP EXTENSIONS CocoaHeads Stockholm 16-09-07
Transcript
Page 1: iOS 10 Notification App Extensions

NOTIFICATION APP EXTENSIONSCocoaHeads Stockholm 16-09-07

Page 2: iOS 10 Notification App Extensions

ABOUT ME

• Previously developed music games in Japan • Joined Propellerhead 2013 • Worked on ReBirth, Thor, Figure, Take • Manager of Mobile Group at Allihoopa (PH spinoff) • Amateur photographer and musician • 💓 creative tools

Page 3: iOS 10 Notification App Extensions

NOTIFICATION APP EXTENSIONS

➤ Make your noIficaIons stand out ➤ adding assets that don’t fit in a push payload ➤ custom UI to make the noIficaIon stand out ➤ basic user interacIon

Page 4: iOS 10 Notification App Extensions

APP EXTENSIONS

➤ Added in iOS 8 ➤ Separate executable, separate process ➤ Limited lifecycle and resources ➤ Examples

➤ Keyboard ➤ Share extension ➤ Today extension (widget) ➤ Photo processing

Page 5: iOS 10 Notification App Extensions

NOTIFICATION EXTENSIONS

➤ Added in iOS 10 ➤ Service: extending the payload ➤ Content: custom UI

Page 6: iOS 10 Notification App Extensions

STEPS

1. Modify your payload

2. Register for user noIficaIons in the app

3. Create a service app extension

4. Process extended content

5. Create a content app extension

6. Processing acIons

7. Debugging

8. Gotchas and Ips

Page 7: iOS 10 Notification App Extensions

1. MODIFYING THE PAYLOAD

➤ Add “mutable-content” key and set to 1 ➤ Set a category idenIfier indicaIng which extension to use

Page 8: iOS 10 Notification App Extensions

2. REGISTER FOR USER NOTIFICATIONS

➤ Register UNNoIficaIonCategory to define custom noIficaIons

➤ Register an UNUserNoIficaIonCenter delegate for acIons

Page 9: iOS 10 Notification App Extensions

3. CREATE A SERVICE APP EXTENSION

➤ One per bundle ➤ Will process any noIficaIon with mutable-content

Page 10: iOS 10 Notification App Extensions

4. PROCESS EXTENDED CONTENT

➤ Download abachments one at a Ime to temp storage ➤ Create an UNNoIficaIonAbachment for each ➤ Memory and Ime are limited!

Page 11: iOS 10 Notification App Extensions

5. CREATE A CONTENT APP EXTENSION

➤ Triggered from 3D touch ➤ Can stream video or audio ➤ Add your noIficaIon category to the extension Info.plist

Page 12: iOS 10 Notification App Extensions

5. CREATE A CONTENT APP EXTENSION

➤ Open abachments and stream online media ➤ File accesses from the service ext. need security access

Page 13: iOS 10 Notification App Extensions

STREAMING MEDIA FROM AN APP EXTENSION

➤ AVPlayer makes this easy ➤ Layout can be tricky

Page 14: iOS 10 Notification App Extensions

6. PROCESSING ACTIONS

➤ Meanwhile, back in the app… ➤ UNNoIficaIonAcIonOpIonForeground to trigger app moving

to foreground

Page 15: iOS 10 Notification App Extensions

DEBUGGING

➤ Extensions are embedded in the parent .app ➤ Debugging requires running the target via another host app

Page 16: iOS 10 Notification App Extensions

GOTCHAS AND TIPS

➤ Make sure your app extension is actually named .appex ➤ App being in background means no (massive) view controllers ➤ Memory and Ime are really Ight in extensions ➤ Device log can be infinitely more useful than console ➤ Xcode 8 no longer moves provisioning profile enItlements into

embedded enItlements during packaging

Page 17: iOS 10 Notification App Extensions

THANK YOU FOR LISTENING

Contact me anyIme:

➤ @gamedeventura

➤ perfeciorwarding.tumblr.com

[email protected]

Allihoopa is hiring!


Recommended