gpt4 book ai didi

ios - Apple 通知设备 token 更改

转载 作者:行者123 更新时间:2023-11-29 00:38:39 25 4
gpt4 key购买 nike

我在更新应用后遇到问题。我得到了这种格式的设备 token C43461D5-E9CB-4C10-81F8-020327A07A62并且通知不起作用。

之前,我收到过这样格式的通知:2add70865401171c7ca1d3b3957b719eaf721fef8f8d7a52bc91ef8a872cc004

我确实允许应用程序通知,并且我没有在后端更改任何内容。谁能指导我为什么它不起作用?

didFinishLaunchingWithOptions中的代码:

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

获取设备 token :

NSString *deviceTokenID = [[NSUserDefaults standardUserDefaults] objectForKey:DEVICE_TOKEN_PUSH_NOTI];
if ([deviceTokenID isEqualToString:@""] || deviceTokenID == nil) {
NSString *tempApplicationUUID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
[dics setObject:tempApplicationUUID forKey:@"cust_device_id"];
} else {
[dics setObject:[[NSUserDefaults standardUserDefaults] objectForKey:DEVICE_TOKEN_PUSH_NOTI] forKey:@"cust_device_id"];
}

我收到以下错误:

Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}, no valid 'aps-environment' entitlement string found for application

最佳答案

enter image description here

请转到

点击 .xcodeproj -> Capabilities -> Enable Push Notification

希望一切顺利

关于ios - Apple 通知设备 token 更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40018586/

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