推通知设备令牌? [英] Push Notification Device Token?

查看:102
本文介绍了推通知设备令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从我的iPhone设备获取设备令牌?

How to get Device Token from my iPhone Device?

推荐答案

此方法将打印deviceToken控制台在调试模式下,如果你想看到的设备令牌可以在UIAlert见。

this method will print the deviceToken in console in debug mode, if you want to see the device token you can see in UIAlert also.

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    NSLog(@"APN device token: %@", deviceToken);
    NSString *deviceTokenString = [NSString stringWithFormat:@"%@",deviceToken];
    UIAlertView *deviceTokenAlert = [[UIAlertView alloc] initWithTitle:@"Device Token"
                                                            message:deviceTokenString
                                                           delegate:self
                                                  cancelButtonTitle:@"OK"
                                                  otherButtonTitles:nil];

}

这篇关于推通知设备令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆