didRegisterForRemoteNotificationsWithDeviceToken:不调用调用registerForRemoteNotificationTypes:?

编程入门 行业动态 更新时间:2024-10-22 23:47:50
本文介绍了didRegisterForRemoteNotificationsWithDeviceToken:不调用调用registerForRemoteNotificationTypes:?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在一个navBased应用程序推送通知的工作。在AppDelegate.m didRegisterForRemoteNotificationsWithDeviceToken:不调用上调用registerForRemoteNotificationTypes:code是这样的:

I am working with push notifications in a navBased app. in AppDelegate.m didRegisterForRemoteNotificationsWithDeviceToken: doesn't invoke on calling registerForRemoteNotificationTypes: code looks like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; return YES; } - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { // Get a hex string from the device token with no spaces or < > NSLog(@"applicationDidFinishLaunchingWithOptions dev token test"); NSString *deviceTokenStr = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""]; NSLog(@"Device Token: %@", deviceTokenStr); }

我敢肯定,调配配置文件是没有问题的。我发现错误:

I am quite sure that provisioning profile is not the problem. and i found error:

错误登记。错误:错误域= NSCocoaErrorDomain code = 3000没有有效的APS-环境的权利字符串中找到应用程序的UserInfo = 0x115490 {NSLocalizedDescription =没有有效的APS-环境的权利找到了应用字符串}

Error in registration. Error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x115490 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}

谁能告诉我什么是这个code回事和y它不工作?感谢名单

can anyone tell me whats going on in this code and y its not working? thanx

推荐答案

检查:链接并确保您有5223端口打开。

Check this: link And make sure that you have 5223 port opened.

更多推荐

didRegisterForRemoteNotificationsWithDeviceToken:不调用调用registerForRemoteNotificat

本文发布于:2023-10-28 19:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537554.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:didRegisterForRemoteNotificationsWithDeviceToken   registerForRemoteNotificationTy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!