Can't build app after updating to 3.0.2 - Use of undeclared identifier
Just updated to 3.0.2, updated AppDelegate.m according the the updated readme
but I got these errors after adding this function.
No known class method for selector 'didReceiveIncomingPushWithPayload:forType:' Use of undeclared identifier 'callerName' Use of undeclared identifier 'handle' Use of undeclared identifier 'uuid'
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {
// Process the received push
[RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
// Retrieve information like handle and callerName here
[RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
completion();
}
Hi @ahmadworks ! As the comment says, it's up to you to fetch these variables from your push payload:
NSString *uuid = [[[NSUUID UUID] UUIDString] lowercaseString];
NSString *callerName = @"caller name here";
NSString *handle = @"caller number here";
I'lll update the README so it'll be more comprehensive.
Thanks for making this clear, I still can't build the app. Got this error:
Collection element of type 'BOOL' (aka 'bool') is not an Objective-C object in RNCallKeep.m near line 345
Ok I see the issue, can you check with the 3.0.3 version please ?
It's working now, but can you please explain why should I add this function to AppDelegate.m [RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
and what behavior will change in CallKit if I don't add it?
Like the documentation says :
Since iOS 13, you'll have to report the incoming calls that wakes up your application, like in your AppDelegate.m
If you make VoIP push on ios to wake up your application when killed or in background since a long time (~5/15mn), you should call this method to inform Apple that you're making a VoIP push to make a call.
If you don't Apple will stop sending VoIP push to your application.
Ok, thanks. But is mandatory to include caller name while reporting incoming calls. since I can't figure out how to get the caller display name from the notification payload, I can get it in react native and class but can't get it in AppDelegate.m. Can I just use a fixed name like MyAppName to report call to apple?
If your server send the push when your user receive a call, it can send in the push payload who is calling.
But if you can't know server-side, I think you can make the caller number as the caller name and update it after with updateDisplay in your react-native code base.
Hi @ahmadworks, can I close this issue ?
Closing
I'm also getting this error with the versions 3.0.11 and 3.0.12. With version 3.0.10 the error goes away.
