Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnect from VoxImplant client after a while #85

Open
hadri3n opened this issue Jul 8, 2021 · 4 comments
Open

Disconnect from VoxImplant client after a while #85

hadri3n opened this issue Jul 8, 2021 · 4 comments

Comments

@hadri3n
Copy link

hadri3n commented Jul 8, 2021

Hi,

First of all, thanks for the great work in offering your demo apps.
I am working on an app based on the fully-featured 'VoximplantDemo'.

I am having trouble in maintaining the application available, or at least users "callable" after a while.

Essentially, once the application is in background, the Voximplant will eventually disconnect, and the user become unreachable, and not seem to receive notifications.

For info, I am using the newest version of react-native-firebase in order to support the newest version of Android.

If you have any hints for me, that would be great.

I'm listing the most relevant dependencies I have, below.

 "dependencies": {
    "@react-native-firebase/app": "^12.1.0",
    "@react-native-firebase/messaging": "^12.1.0",
    "@voximplant/react-native-foreground-service": "^2.0.0",
    "react": "17.0.2",
    "react-native": "0.64.2",
    "react-native-callkeep": "^4.2.0",
    "react-native-incall-manager": "^3.3.0",
    "react-native-push-notification": "^7.4.0",
    "react-native-voip-push-notification": "^3.3.0",
    "react-native-voximplant": "^1.24.0",
...
  },
@rafaellima94
Copy link

Hello, any updates on this?

@hadri3n
Copy link
Author

hadri3n commented Sep 9, 2021

None from my part. I have not managed to keep the connection with the client for a long time.

@ahammedmishal
Copy link

any updates

@rafaellima94
Copy link

rafaellima94 commented Mar 16, 2023

I remember I got it fixed a long time ago, but I don't remember exactly how.
On the Voximplant Discord I found my last contributions, you can try to see if it helps :)

on PushManager.ios.js constructor() add at the end

VoipPushNotification.addEventListener('didLoadWithEvents', (events) => {
    if (!events || !Array.isArray(events) || events.length < 1) {
        return;
    }
    for (let voipPushEvent of events) {
        let { name, data } = voipPushEvent;
        if (name === VoipPushNotification.RNVoipPushRemoteNotificationsRegisteredEvent) {
            this.onVoipPushNotificationRegistered(data);
        } else if (name === VoipPushNotification.RNVoipPushRemoteNotificationReceivedEvent) {
            this.onVoipPushNotificationiReceived(data);
        }
    }
});

and register token after

VoipPushNotification.registerVoipToken();
one more thing
on AppDelegate.m
import pushkit before voip push notification

#import <PushKit/PushKit.h> <------
#import "RNVoipPushNotificationManager.h"


the calls from ios didn't have audio
then i found out that sometimes the generated uuid is not unique, it can be duplicated
it is necessary to use react-native-get-random-values to garantee the randomness of the uuid
just add to the project and import before uuid
hope this information helps somebody


And then I got stuck with an error about expired tokens that I solved looking at this docs

https://voximplant.com/docs/howtos/security/authorize-with-renewable-tokens

Hope I could help
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants