gpt4 book ai didi

ios - Apple 推送通知不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:05:43 26 4
gpt4 key购买 nike

 NSLog(@"push notification in process");
[[UIApplication sharedApplication]registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert)];


didFinishLaunchingWithOptions: 方法的 appdelegate.m 文件中输入以上代码

我收到如下错误消息:

错误:


Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x20021380 
{
NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application
}

最佳答案

这可能是由于许多问题造成的。查看是否有以下任何解决方法:

  • 检查您的 AppID 是否已在配置门户中启用推送通知
  • 检查您的配置文件中的字符串:aps-environment
  • 检查您使用的是命名配置文件(不是通配符)
  • 检查您证书上的大小写是否与您的产品名称相匹配(区分大小写)

如果这些失败,则问题可能是由于 Xcode 中的配置文件引起的。如果您在为推送配置 AppID 之前创建了配置文件,请尝试重新生成并安装新的配置文件。

关于ios - Apple 推送通知不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14191412/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com