Open emersonqueiroz opened 9 years ago
I solved this issue by adding this line:
Twilio.shutdown();
In the onDestroy function of the file TCPlugin.java after the super.onDestroy ();
OnDestroy function:
@Override
public void onDestroy() {
super.onDestroy();
Twilio.shutdown();
//lifecycle events
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(cordova
.getActivity());
lbm.unregisterReceiver(mBroadcastReceiver);
}
Maybe publish a fix?
Thanks
Hi,
Thanks! Glad you could find a fix. I'll fix it in the code and update the repo.
This fixes it for Android, but the same problem also exists for iOS.
Thanks! Definitely agree on that. I'll test out the fixes and update the plugin.
on iOS, do you have a fix, @gulfpearl ?
Sorry I don't. I imagine its the same solution, was going to try for a fix tomorrow based on @emersonqueiroz response.
Something I don't understand though, both for Android and iOS, the SDK can keep running in the background and is supposed to call the phonegap app using the callback provided to Twilio.Connection.showNotification.
Right now its not an issue because showNotification doesn't work for me, we are just using a confirm dialog when a call comes in and the phonegap part is running, but if showNotification can be fixed (unless my understanding is wrong and it works as its supposed to) then probably another fix to this problem would be ideal so the SDK can keep running in the background, and accept calls, specially for iOS
Hi everyone,
I have the same issue on Android (tested on Android 4.4.2).
After reopen the app Twilio can't handle the incoming call, but Twilio on device is ready and offline (logs from Twilio.Device.ready
function and Twilio.Device.offline
function, see example in first comment).
I've added the Twilio.shutdown();
to the onDestroy
method in TCPlugin.java - the same issue.
Any ideas?
Thanks, Alexander
Hi,
I solved this issue by adding the line:
Twilio.shutdown();
There is a need to remove and add again the platform for applying this feature.
Thanks, Alexander
Hello,
I'm having a strange problem when using the library, everything works correctly the first time you run the application, after that, only back to receive calls if I clear the application data on the settings menu.
On the second run, the app receive the Twilio.ready() but dont receive the incoming, i tested on an Android Phone 5.0 (lollipop) and an Android Tablet 4.2.2 (Jelly Bean)
Someone also had or are having this problem?
Here is a sample code: