设备令牌推送通知

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)

Sau*_*abh 5

- (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)