gpt4 book ai didi

ios - 'FIRInstanceID' 没有可见的@interface 声明选择器 'setAPNSToken:type:'

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:15:13 27 4
gpt4 key购买 nike

更新 Pod 库后 appdelegate.m 出现上述错误

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {

[[FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeSandbox];
NSString *newToken = [deviceToken description];
newToken = [newToken stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
newToken = [newToken stringByReplacingOccurrencesOfString:@" " withString:@""];
NSLog(@"My token is: %@", newToken);

}

最佳答案

这是已弃用的代码,您应该尝试使用 FIRMessaging

您可以将代码更新为如下所示

// With "FirebaseAppDelegateProxyEnabled": NO
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[FIRMessaging messaging].APNSToken = deviceToken;
}

引用here了解更多详情。

关于ios - 'FIRInstanceID' 没有可见的@interface 声明选择器 'setAPNSToken:type:',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53078653/

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