WebsiteBeaver / CordovaCall

Cordova CallKit & ConnectionService plugin for iOS/Android that displays the native call UI for VOIP apps
MIT License
196 stars 91 forks source link

callNumber not working #80

Open jonybuzz opened 5 years ago

jonybuzz commented 5 years ago

I´m running a demo app in Android 23 (emulator and device) and when I call the function and grant phone permission, an exception is thrown. This is the log from logcat (I added exception message in error callback)

08-25 20:58:33.380 16353-16353/com.example.hola D/CordovaActivity: Paused the activity.
08-25 20:58:34.799 16353-16353/com.example.hola W/CordovaPlugin: Attempted to send a second callback for ID: CordovaCall692644862
    Result was: "Call Failed: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?"
08-25 20:58:34.799 16353-16353/com.example.hola D/CordovaActivity: Resumed the activity.

If I set that flag before this.cordova.getActivity().getApplicationContext().startActivity(intent); it works, but the calling UI is set in foreground. Is this normal behaviour?

My cordova code inside a button callback:

cordova.plugins.CordovaCall.callNumber('1133335555',
                    function(a){console.log('EXITO ' + a)},
                    function(a){console.log('ERROR ' + a)}
                );