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

Fix not to work callNumber function #115

Open dki1110 opened 2 years ago

dki1110 commented 2 years ago

Description

A below error is occurred when running callNumber function on Android 10.

Exception android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

Cause

The error is caused by the issue below.

https://developer.android.com/about/versions/pie/android-9.0-changes-all#fant-required

Solution

A below code was added.

          if (android.os.Build.VERSION.SDK_INT >= 28) {
              intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          }

Test

I confirmed that callNumber function is success on Android 10.
I could check only Android 10.

Related Issues

80 #88