Rao*_*oul 1 xcode device token
如何获取设备令牌?我想添加它,我似乎无法理解.我需要做什么?我要去哪?我需要什么才能得到这个?
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken
{
// Tell Parse about the device token.
[PFPush storeDeviceToken:newDeviceToken];
// Subscribe to the global broadcast channel.
[PFPush subscribeToChannelInBackground:@""];
}
Run Code Online (Sandbox Code Playgroud)
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)_deviceToken {
// Get a hex string from the device token with no spaces or < >
NSString *deviceToken = [[[[_deviceToken description]
stringByReplacingOccurrencesOfString: @"<" withString: @""]
stringByReplacingOccurrencesOfString: @">" withString: @""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4226 次 |
| 最近记录: |