[英]“no valid 'aps-environment' entitlement string” when registering for Push Notifications
i used the code below to register for push notification inside applicationdidFinishLaunchingWithOptions
but nothing happens why ? 我使用下面的代码在applicationdidFinishLaunchingWithOptions
注册推送通知,但没有任何反应原因?
The code : 编码 :
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
and my Push Notification setting is on. 并且我的推送通知设置已开启。
You should also check wether your server is using the right target and the iOS the right certificate as well. 您还应该检查您的服务器是否正在使用正确的目标,以及iOS也是正确的证书。 There are two certificates: one is for development (sandbox certificate) and the other is the production certificate. 有两个证书:一个用于开发(沙盒证书),另一个是生产证书。
Development: gateway.sandbox.push.apple.com:2195
Production: gateway.push.apple.com:2195
If you use the development certificate to talk to the production server address then you won't receive any push. 如果您使用开发证书与生产服务器地址通信,那么您将不会收到任何推送。
Also remind that the simulator doesn't support push. 还要提醒一下,模拟器不支持推送。 As it has no push token. 因为它没有推送令牌。
您是否实现了application:didRegisterForRemoteNotificationsWithDeviceToken:
和application:didFailToRegisterForRemoteNotificationsWithError:
委托方法以查看注册的结束方式?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.