You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/12/06 23:23:46 UTC

[3/18] ios commit: add appdelegate method didReceiveLocalNotification and repost to defaultCenter

add appdelegate method didReceiveLocalNotification and repost to defaultCenter


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/db395af1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/db395af1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/db395af1

Branch: refs/heads/master
Commit: db395af19273e9559c9b570732d9f0342296eedd
Parents: 1ba170e
Author: purplecabbage <pu...@gmail.com>
Authored: Thu Dec 6 12:05:08 2012 -0800
Committer: purplecabbage <pu...@gmail.com>
Committed: Thu Dec 6 12:05:08 2012 -0800

----------------------------------------------------------------------
 .../project/__TESTING__/Classes/AppDelegate.m      |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/db395af1/bin/templates/project/__TESTING__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/Classes/AppDelegate.m b/bin/templates/project/__TESTING__/Classes/AppDelegate.m
index 5bd0e1b..4806f9a 100644
--- a/bin/templates/project/__TESTING__/Classes/AppDelegate.m
+++ b/bin/templates/project/__TESTING__/Classes/AppDelegate.m
@@ -91,6 +91,14 @@
     return YES;
 }
 
+// repost the localnotification using the default NSNotificationCenter so multiple plugins may respond
+- (void)application:(UIApplication *)application
+didReceiveLocalNotification:(UILocalNotification *)notification
+{
+    // re-post ( broadcast )
+    [[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification];
+}
+
 - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
 {
     // iPhone doesn't support upside down by default, while the iPad does.  Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected).