I'm try to use Firebase with Xcode 12, but I'm facing this warning after install and run the project.
'generateIdentityVerificationSignatureWithCompletionHandler:' is deprecated: first deprecated in iOS 13.5 - API deprecated. Use fetchItemsForIdentityVerificationSignature: and the teamPlayerID value to verify a user identity.
any idea how I can fix this issue?
here the code:
+ (void)getCredentialWithCompletion:(FIRGameCenterCredentialCallback)completion {
/**
Linking GameKit.framework without using it on macOS results in App Store rejection.
Thus we don't link GameKit.framework to our SDK directly. `optionalLocalPlayer` is used for
checking whether the APP that consuming our SDK has linked GameKit.framework. If not, a
`GameKitNotLinkedError` will be raised.
**/
GKLocalPlayer *_Nullable optionalLocalPlayer = [[NSClassFromString(@"GKLocalPlayer") alloc] init];
if (!optionalLocalPlayer) {
if (completion) {
completion(nil, [FIRAuthErrorUtils gameKitNotLinkedError]);
}
return;
}
__weak GKLocalPlayer *localPlayer = [[optionalLocalPlayer class] localPlayer];
if (!localPlayer.isAuthenticated) {
if (completion) {
completion(nil, [FIRAuthErrorUtils localPlayerNotAuthenticatedError]);
}
return;
}
[localPlayer generateIdentityVerificationSignatureWithCompletionHandler:^(
NSURL *publicKeyURL, NSData *signature, NSData *salt, uint64_t timestamp,
NSError *error) {
if (error) {
if (completion) {
completion(nil, error);
}
} else {
if (completion) {
/**
@c `localPlayer.alias` is actually the displayname needed, instead of
`localPlayer.displayname`. For more information, check
https://developer.apple.com/documentation/gamekit/gkplayer
**/
NSString *displayName = localPlayer.alias;
// iOS 13 deprecation
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
FIRGameCenterAuthCredential *credential =
[[FIRGameCenterAuthCredential alloc] initWithPlayerID:localPlayer.playerID
publicKeyURL:publicKeyURL
signature:signature
salt:salt
timestamp:timestamp
displayName:displayName];
#pragma clang diagnostic pop
completion(credential, nil);
}
}
}];
}