|
/

生产环境下的devicetoken怎么获取

FFrancis
发布于 5 年前
483
消息推送 U-Push
SDK集成与升级

生产环境下的devicetoken怎么获取

4个回答
 
5 年前

试试看在

didRegisterForRemoteNotificationsWithDeviceToken 中添加如下语句 #include -(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { if(![deviceToken isKindOfClass:[NSDataclass]])return; constunsigned*tokenBytes =(constunsigned*)[deviceToken bytes]; NSString*hexToken =[NSString stringWithFormat:@"%08x%08x%08x%08x%08x%08x%08x%08x", ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]), ntohl(tokenBytes[3]), ntohl(tokenBytes[4]), ntohl(tokenBytes[5]), ntohl(tokenBytes[6]), ntohl(tokenBytes[7])]; NSLog(@"deviceToken:%@",hexToken); 传入的devicetoken是系统回调didRegisterForRemoteNotificationsWithDeviceToken
的入参

 
5 年前

Loading ...
登录社区,分享你的经验