Created
April 21, 2013 14:01
-
-
Save Hokila/5429681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{ | |
NSString *token = [NSString stringWithFormat:@"%@", [deviceToken description]]; | |
token = [token stringByReplacingOccurrencesOfString:@"<" withString:@""];//去左箭號 | |
token = [token stringByReplacingOccurrencesOfString:@">" withString:@""];//去右鍵號 | |
token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];//去空白 | |
//把拿到的deviceToken去頭去尾後 拿去註冊push | |
[self registerPushServer:self.phone_id :token ]; | |
//把BadgeNumber設為0 | |
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; | |
} | |
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { | |
[Flurry logError:@"推播註冊失敗" message:@"APNS無回應" error:error]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment