gpt4 book ai didi

ios - 未收到设备 token

转载 作者:行者123 更新时间:2023-11-29 02:53:32 25 4
gpt4 key购买 nike

我在使用此代码获取设备 token 时收到此警告消息。

"Error Domain=NSCocoaErrorDomainCode=3000"no valid aps-environment'entitlement string found for application" Userinfo=0x1665f5b0 {NSlocalizedDescription=no valid 'app-environment'entitlement string found for application}

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)var_deviceToken
{

NSString *tokenString = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
NSLog(@"Push Notification tokenstring is %@",tokenString);
self.deviceToken = tokenString;


}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{

NSString* s=[[NSString alloc] initWithFormat:@"%@",error];
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Device Token didn't recieve" message:s delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];

}

最佳答案

出现这个问题的原因是,

  1. 您没有在您的临时配置文件中启用推送通知。
  2. 如果启用,您可能会忘记使用该 bundle 标识符和移动设备。

关于ios - 未收到设备 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24207021/

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