You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/03/06 23:27:49 UTC
[17/31] ios commit: CB-8084 - Allow for a way to disable push
notification delegate methods (through xcconfig). Style fixup using
uncrustify.
CB-8084 - Allow for a way to disable push notification delegate methods (through xcconfig). Style fixup using uncrustify.
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/8dcc9dd6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/8dcc9dd6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/8dcc9dd6
Branch: refs/heads/wkwebview
Commit: 8dcc9dd626c523e6e217dd7e8ce43d0af849fa3a
Parents: ed54ddf
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Feb 13 16:53:49 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 16:53:49 2015 -0800
----------------------------------------------------------------------
.../__PROJECT_NAME__/Classes/AppDelegate.m | 37 +++++++++++---------
1 file changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8dcc9dd6/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
index c52a838..3cb3198 100644
--- a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
@@ -113,24 +113,27 @@
[[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification];
}
-- (void) application:(UIApplication*)application
- didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
-{
- // re-post ( broadcast )
- NSString* token = [[[[deviceToken description]
- stringByReplacingOccurrencesOfString:@"<" withString:@""]
- stringByReplacingOccurrencesOfString:@">" withString:@""]
- stringByReplacingOccurrencesOfString:@" " withString:@""];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
-}
+#ifndef DISABLE_PUSH_NOTIFICATIONS
+
+ - (void) application:(UIApplication*)application
+ didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
+ {
+ // re-post ( broadcast )
+ NSString* token = [[[[deviceToken description]
+ stringByReplacingOccurrencesOfString:@"<" withString:@""]
+ stringByReplacingOccurrencesOfString:@">" withString:@""]
+ stringByReplacingOccurrencesOfString:@" " withString:@""];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
+ }
-- (void) application:(UIApplication*)application
- didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
-{
- // re-post ( broadcast )
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
-}
+ - (void) application:(UIApplication*)application
+ didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
+ {
+ // re-post ( broadcast )
+ [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
+ }
+#endif
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org