xcode 如何更新推送通知的配置文件 - IOS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15426422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to update provisioning profile for Push Notification - IOS
提问by Newbee
We are working on an IOS application, we want to implement PUSH NOTIFICATION, I have gone through apple documentation, and asked my Team agent to enable the Push Notification in iOS dev center, they did it seems, its enabled now. I have registered in my application for Push notification like below...
我们正在开发一个 IOS 应用程序,我们想要实现推送通知,我已经阅读了苹果文档,并要求我的团队代理在 iOS 开发中心启用推送通知,他们似乎做到了,现在已启用。我已经在我的应用程序中注册了推送通知,如下所示...
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
When I ran the application, didFailToRegisterForRemoteNotificationsWithError got called, I was not able to predict the problem, Is there anything else I can do with certification.
当我运行应用程序时,didFailToRegisterForRemoteNotificationsWithError 被调用,我无法预测问题,还有什么我可以做的认证。
thanks...
谢谢...
回答by Rajan Balana
For push Notification
对于推送通知
What you need to do is, First open the provisioning portal and then go to App IDs section.
您需要做的是,首先打开配置门户,然后转到 App IDs 部分。
Find your app and then there are two options for configuring the Push Notification, one for Development and another for production.
找到您的应用程序,然后有两种配置推送通知的选项,一种用于开发,另一种用于生产。
If your app is under testing and development, use development and configure that and in return you will get the certificate. which will be placed on the server who will send push notifications.
如果您的应用程序正在测试和开发中,请使用 development 并配置它,作为回报,您将获得证书。这将放置在将发送推送通知的服务器上。
Next, then you need to regenerate the provisioning profiles,
接下来,您需要重新生成配置文件,
Go to the provisioning profiles and modify them and then re-download. You will get Push Notification Enabled Provisioning profiles.
转到配置文件并修改它们,然后重新下载。您将获得启用推送通知的配置文件。
Don't forget to implement this method in the AppDelegate of your project (APP):
不要忘记在你的项目(APP)的 AppDelegate 中实现这个方法:
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
}
Build your project with the new profile and you are good to go.
使用新配置文件构建您的项目,一切顺利。
For more help check this tutorial.
如需更多帮助,请查看本教程。
Even after you've enabled your app id for push, it might take a couple of hours for it to work.
即使在您为推送启用了应用程序 ID 之后,它也可能需要几个小时才能工作。
回答by Stuart M
If you are getting this message:
如果您收到此消息:
no valid 'aps-environment' entitlement string found for application
no valid 'aps-environment' entitlement string found for application
in the NSError
that is passed to -[UIApplication application:didFailToRegisterForRemoteNotificationsWithError:]
, you may need to check that you're using the correct provisioning profile, and that it is the one that is Push Notification-enabled. See these posts for some pointers:
在NSError
传递给 的 中-[UIApplication application:didFailToRegisterForRemoteNotificationsWithError:]
,您可能需要检查您使用的是正确的配置文件,并且它是启用推送通知的配置文件。请参阅这些帖子以获取一些提示:
回答by MS.
Just go to your applications. Then configure it for "Push Notification".
只需转到您的应用程序。然后将其配置为“推送通知”。
Configure & Enable it for Development Push SSL Certificate.
为开发推送 SSL 证书配置并启用它。
Then download latest certificate for application.
然后下载最新的证书申请。
Thanks.
谢谢。