waltflanagan / MSWatchKitNotifications

UILocalNotification scheduling within WatchKit Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MSWatchKitNotifications

Usage

In WatchKit:

   UILocalNotification* notification = [UILocalNotification new];
   notification.alertTitle = @"Notification From WatchKit";
   notification.alertBody = @"Notification";
   
   [WKInterfaceController presentLocalNotificationNow:notification completion:nil];

In your app delegate’s application:handleWatchKitExtensionRequest:reply:

  BOOL notificationHandled = [MSWatchKitNotificationHandler handleNotificationsFromWatchKit:userInfo replyBlock:reply];
   
   if (!notificationHandled) {
      NSLog(@"Client App should handle this request");
   }

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.2

Installation

MSWatchKitNotifications is available through CocoaPods. To install it, simply add the following to your Podfile:

#for your main app target
pod "MSWatchKitNotifications"

#for your extension
target 'MyApp WatchKit Extension', :exclusive => true do
   pod "MSWatchKitNotifications/Extension"
end

Both your app and WatchKit extension need to be integrated via your podfile.

Author

Mike Simons, @waltflanagan

License

MSWatchKitNotifications is available under the MIT license. See the LICENSE file for more info.

About

UILocalNotification scheduling within WatchKit Extensions

License:MIT License


Languages

Language:Objective-C 60.1%Language:Shell 26.0%Language:C 7.7%Language:Ruby 6.2%