简体   繁体   English

使用parse.com作为通知服务器时出错

[英]Error while using parse.com as notification server

In my app I use parse.com to receive push notification from a remote service. 在我的应用程序中,我使用parse.com从远程服务接收推送通知。 I followed the tutorial direct on parse.com site and the apps receive correctly the notification, but when I start the app from Xcode I see that the app calls the method: - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error and Xcode shows me the following: 我直接在parse.com网站上遵循了该教程,并且应用程序正确接收了通知,但是当我从Xcode启动应用程序时,我看到该应用程序调用了以下方法- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error和Xcode向我显示以下内容:

Error Domain = NSCocoaErrorDomain Code = 3000 "no permission string 'aps-environment' found valid for the application" UserInfo = {0x1567fa20 NSLocalizedDescription = no permission string 'aps-environment' found valid for the application}

and I see that the method - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken is not called so I can't get the InstallationId I've to send to the server to listen to the channel of push notification. 而且我看到方法- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken没有被调用,所以我无法获取要发送到服务器的InstallationId来监听推送通道通知。

What's wrong in my app? 我的应用程式怎么了? I'm running it on a real device and it works fine when I try to send a notification through the website, can anyone help me to understand what's wrong? 我正在真实的设备上运行它,当我尝试通过网站发送通知时,它运行良好,有人可以帮助我了解问题所在吗? I followed the tutorial to create a certificate to make work with push notification. 我按照教程创建了可以与推送通知配合使用的证书。 On my Apple account I got a few of certificate to develop app without the push notification and I use a wildcard like this: it.name.* . 在我的Apple帐户上,我获得了一些无需推送通知即可开发应用程序的证书,并且我使用这样的通配符: it.name.* I created a certificate for push notification with this appID: it.name.app , I guess it's not this one the issue. 我使用以下appID创建了用于推送通知的证书: it.name.app ,我想这不是问题所在。 Thank you for helping 感谢您的帮助

I clicked on project settings and I just solved the issue with certificate by adding a developer team. 我单击项目设置,然后通过添加开发人员团队来解决证书问题。 Now my app call the method - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken and I get the InstallationId to send to my server. 现在我的应用程序调用方法- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken ,我得到InstallationId发送给我的服务器。 I hope someone will use my solution. 我希望有人会使用我的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM