Skip to content

waltflanagan/MSWatchKitNotifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published