Giter VIP home page Giter VIP logo

Comments (21)

ajnozari avatar ajnozari commented on June 7, 2024 3

Adding the following to the didReceiveIncomingPushWithPayload always me to get the call notification when the app is in the background. Still cannot get it to work when the app has been killed.

    NSString *uuid = [[NSUUID UUID] UUIDString];
    [RNCallKeep reportNewIncomingCall:uuid handle:@"07...." handleType:@"number" hasVideo:NO localizedCallerName:@"CallersName" fromPushKit:YES];

As a quick question have you tried pushing to TestFlight and using the non-sandbox url? I’ve noticed that background ringing doesn’t work reliably with the app in debug scheme/dev mode, and release doesn’t prompt for production device tokens until pushed.

However I’ve never had an issue with the app in TestFlight or production and receiving calls while killed. I really think it’s a limitation of the sandbox.

from react-native-voip-push-notification.

ajnozari avatar ajnozari commented on June 7, 2024 2

Ok so I've been digging into it, and we need to "start" the call within

- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type { // Process the received push [RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type]; }

you dispatch an event here

- (void)handleRemoteNotificationReceived:(NSNotification *)notification { NSLog(@"[RNVoipPushNotificationManager] handleRemoteNotificationReceived notification.userInfo = %@", notification.userInfo); [_bridge.eventDispatcher sendDeviceEventWithName:@"voipRemoteNotificationReceived" body:notification.userInfo]; }

but that's native code and I can't imagine that we can call callkeep here.

So my idea is instead to run the call start from callkeep within the listener for notification within the RNVoipPushNotification's contstructor through adding a callback. Not sure if this is the right direction to go though but apple is restricting how we handle voip notifications in iOS 13.

If I can I'll attempt to implement this and submit a PR for it. If anyone has another solution I'd love to hear it.

from react-native-voip-push-notification.

r0b0t3d avatar r0b0t3d commented on June 7, 2024 1

@Linoa65

  • If you are using this library to display incoming call to user: react-native-callkeep support it already
  • If you are using this library for another purposes -> They will stop working, you have to use another solution for your app.

from react-native-voip-push-notification.

ajnozari avatar ajnozari commented on June 7, 2024 1

I made a fix to my app delegate that called the CallKeep native code function for displaying the call screen. I triggered this within my appdelegate. In fact CallKeep has since updated their documentation to provide this fix. Their solution is cleaner and I have switched my temp fix to their changes.

I closed this issue since it was not an issue for this package to fix, as it still works properly for iOS 13, it just requires a different implementation.

from react-native-voip-push-notification.

r0b0t3d avatar r0b0t3d commented on June 7, 2024

Hi @ajnozari
As document said

optional func pushRegistry(_ registry: PKPushRegistry, 
didReceiveIncomingPushWith payload: PKPushPayload, 
                       for type: PKPushType, 
                completion: @escaping () -> Void)

On iOS 13.0 and later, incoming Voice over IP calls must be reported when they are received and before this method finishes execution

So I think we have to call displayIncomingCall (from RNCallKeep) directly.

I made some update here
r0b0t3d/react-native-callkeep@3bed1be

And call it inside AppDelegate.m

// Handle incoming pushes
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
  // Process the received push
  NSLog(@"RNVoipPushNotificationManager pushRegistry received");
  // Add this line
  [[RNCallKeep sharedInstance] displayIncomingCall:@"110ec58a-a0f2-4ac4-8393-c866d813b8d1" handle:@"generic" handleType:@"" hasVideo:true localizedCallerName:@"Caller Name"];

  [RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
}

How do you think?

from react-native-voip-push-notification.

ajnozari avatar ajnozari commented on June 7, 2024

I don’t see any outright issues. I’ll give it a test later. Had to pause things as we’re migrating to a new host.

from react-native-voip-push-notification.

Linoa65 avatar Linoa65 commented on June 7, 2024

Hi everybody !

Some news about that ? What we need to change in our code to adapt it for iOS 13 ?
There will be an update of the module to support IOS 13 ?
What sort of changes implies IOS 13 about voip notification ?

Apple told us we had until April 2020 to make this changes to our app, but for react-native, I have actually no idea about what we need to do.

Thank you :)
Florient

from react-native-voip-push-notification.

OriAmir avatar OriAmir commented on June 7, 2024

@r0b0t3d @ianlin @Linoa65
This library is deprecated and will not get any update any more ( for example iOS 13 ) ?
Or maybe(i wish!) someone will take care and stay this library a live and updated ?
It's really good library!
There is another alternative ? the only thing i see is this : https://documentation.onesignal.com/docs/voip-notifications but it's have just regular react native library and not voip react native library .

tnx!

from react-native-voip-push-notification.

zxcpoiu avatar zxcpoiu commented on June 7, 2024

@manuquentin @sboily

Will you be interested in keep this library working closely with callkeep?

Or is there someone willing to do this?

from react-native-voip-push-notification.

Linoa65 avatar Linoa65 commented on June 7, 2024

Hello there,

I have not enough skills in IOS development to correctly update this library, but if needed I can help and try to maintain it with other developers. This library is simple and effective, all we need I react-native, and it is not needed to work with call kit (what I need to have to display my calls like I want).

Thanks ! :)

from react-native-voip-push-notification.

OriAmir avatar OriAmir commented on June 7, 2024

anyone gone to take care on this library ? it's really god one , the modifications is big ?

from react-native-voip-push-notification.

sboily avatar sboily commented on June 7, 2024

Hello, sorry we don't talk about that with @manuquentin but we don't really use it. @zxcpoiu you need to find a new maintainer for this lib?

from react-native-voip-push-notification.

Linoa65 avatar Linoa65 commented on June 7, 2024

I don't understand what implied the new way to catch notification VOiP. Is at registering we need to modify things ? Because I heard that we need to immediately send notification to CallKit to handle the VOiP notification, but I need to use my own custom display for the call, is it possible ?

from react-native-voip-push-notification.

ajnozari avatar ajnozari commented on June 7, 2024

So with IOS 13 within the loop that listens for the incoming VOIP notification you have to complete the handling and tell the phone to display the call at that point. This happens in your appdelegate.m.

Call kit has extended themselves to handle this and can handle the voip.

from react-native-voip-push-notification.

OriAmir avatar OriAmir commented on June 7, 2024

@ajnozari how complicated is to change the library to support that ?

from react-native-voip-push-notification.

ajnozari avatar ajnozari commented on June 7, 2024

@ajnozari how complicated is to change the library to support that ?

So I made a temp fix before these packages were updated, and that took me maybe 15 minutes.

Now that these packages are properly updated, it’s probably a copy-paste from the readme with a moment spent to check and make sure your variable names in the payload matches the native code and you’re done.

This will require you to edit the AppDelegate.m (which you should have already done once if push notifications are implemented in your app). So you will have to probably make minor edits to native code (see above about variable names). However if you’ve gotten this far it’s not a complicated fix.

from react-native-voip-push-notification.

ajnozari avatar ajnozari commented on June 7, 2024

Closing as this has been fixed by recent updates.

from react-native-voip-push-notification.

OriAmir avatar OriAmir commented on June 7, 2024

@ajnozari Thanks, but I can't see your code or any pull request , did you update the library or something?

from react-native-voip-push-notification.

lonnylot avatar lonnylot commented on June 7, 2024

@ajnozari to be clear: was it fixed by an update to this package, an update to iOS, or #36 (comment)

from react-native-voip-push-notification.

danwhite-ipc avatar danwhite-ipc commented on June 7, 2024

Adding the following to the didReceiveIncomingPushWithPayload always me to get the call notification when the app is in the background. Still cannot get it to work when the app has been killed.

    NSString *uuid = [[NSUUID UUID] UUIDString];
    [RNCallKeep reportNewIncomingCall:uuid handle:@"07...." handleType:@"number" hasVideo:NO localizedCallerName:@"CallersName" fromPushKit:YES];

from react-native-voip-push-notification.

yannickmodahgouez avatar yannickmodahgouez commented on June 7, 2024

Closing as this has been fixed by recent updates.

Which updates fixed this issue ?

from react-native-voip-push-notification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.