Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Can send message to Watch App?

Can send message to Watch App?

Can send message to Watch App?
Inter-Process Notifications on iOS

Kishikawa Katsumi

May 27, 2015
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Technology

Transcript

  1. Apple Watch meetup

  2. https://github.com/kishikawakatsumi/ kishikawa katsumi at Realm Inc http://kishikawakatsumi.hatenablog.com/

  3. Anime Today

  4. Can send message to Watch App?

  5. Watch App => Container App

  6. Watch App => Container App + (BOOL)openParentApplication:(NSDictionary *)userInfo
 reply:(void (^)(NSDictionary

    *replyInfo, NSError *error))reply
  7. Container App => Watch App

  8. mutualmobile/MMWormhole

  9. MMWormhole [self.wormhole passMessageObject:@{@"buttonNumber": @(1)} identifier:@"button"]; [self.wormhole listenForMessageWithIdentifier:@"button" listener:^(id messageObject) {

    self.numberLabel.text = [messageObject[@"buttonNumber"] stringValue]; }];
  10. Darwin Notify Center

  11. Darwin Notify Center - Based on the libnotify. - Cannot

    be passed "objects" - Cannot be passed "userInfo" - Always "deliver immediately"
  12. Darwin Notify Center CFNotificationCenterRef const center = CFNotificationCenterGetDarwinNotifyCenter(); CFStringRef str

    = (__bridge CFStringRef)@"com.kishikawakatsumi.notification.test"; CFNotificationCenterAddObserver(center, (__bridge const void *)(self), notificationCallback, str, NULL, CFNotificationSuspensionBehaviorDeliverImmediately); void notificationCallback(CFNotificationCenterRef center, void * observer, CFStringRef name, void const * object, CFDictionaryRef userInfo) { ... }
  13. App => Today Extension App => Keyboard Extension

  14. App => Other Apps

  15. notify_keys.h /* * File System notifications * These advise clients

    of various filesystem events. */ #define kNotifyVFSMount "com.apple.system.kernel.mount" #define kNotifyVFSUnmount "com.apple.system.kernel.unmount" #define kNotifyVFSUpdate "com.apple.system.kernel.mountupdate" #define kNotifyVFSLowDiskSpace "com.apple.system.lowdiskspace" #define kNotifyVFSLowDiskSpaceRootFS "com.apple.system.lowdiskspace.system" #define kNotifyVFSLowDiskSpaceOtherFS "com.apple.system.lowdiskspace.user"
  16. com.apple.springboard.lockcomplete com.apple.springboard.ringerstate com.apple.springboard.deviceWillShutDown com.apple.springboard.lowPowerAlertPresented ...

  17. Inter-Process Notifications on iOS http://realm.io/news/thomas-goyne-fast-inter-process-communication/ References