Skip to content

Local Notification (ios) and Alarm Manager (android) plugin for dispatching messages to the native notification bar.

Notifications You must be signed in to change notification settings

DesignByOnyx/PhoneGap-LocalNotification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#PhoneGap 3.x Local Notifications

Supported Platforms:

  • Android
  • iOS

##Setup - iOS

  1. In CordovaLib/Classes/CDVPlugin.m uncomment the following line in initWithWebView

     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveLocalNotification:) name:CDVLocalNotification object:nil];
    
  2. In CordovaLib/Classes/CDVPlugin.m uncomment the following block at the end of the file

     - (void)didReceiveLocalNotification:(NSNotification *)notification {}
    
  3. In CordovaLib/Classes/CDVPlugin.h uncomment the following line

      - (void)didReceiveLocalNotification:(NSNotification *)notification;
    
  4. In Classes/AppDelegate.m add the following to the didFinishLaunchingWithOptions: delegate

     UILocalNotification *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
     if (notification) {
     	[[self.viewController settings] setValue:notification forKey:@"LaunchOptionsLocalNotificationKey"];
     }
    
  5. In Classes/MainViewController.m add the following to the webViewDidFinishLoad: delegate

     UILocalNotification *notification = [[self settings] objectForKey:@"LaunchOptionsLocalNotificationKey"];
     if(notification) {
     	[[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification];
     }
    

About

Local Notification (ios) and Alarm Manager (android) plugin for dispatching messages to the native notification bar.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published