真机运行远程推送dome,然后得到下面的device
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ // 注册远程推送 [application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound ]; } //注册失败时的代理实现 - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{ NSLog(@"Error:%@",error); } //获得40位的令牌,在推送时需要使用 - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{ NSLog(@"DeviceToken :%@",deviceToken); }
原文地址:http://blog.csdn.net/hmt20130412/article/details/32725195