wumke / react-native-immediate-phone-call

Initiate immediate phone call (without further user interaction) for React Native on iOS and Android.
GNU General Public License v3.0
174 stars 51 forks source link

android SDK 23 and higher issue #3

Closed ezha86 closed 7 years ago

ezha86 commented 7 years ago

hi, thanks for the module. IOS works fine as well as android 5( < 23 sdk) but with if you try to do call at android sdk 23 and higher it causes error

screenshot at sep 18 23-48-54

its cus you must request for CALL_PHONE permission while the app is running. how can i handle this ? Thanks!

wumke commented 7 years ago

Is adding the following line to your manifest not enough? Tested fine for android 5 over here...

<uses-permission android:name="android.permission.CALL_PHONE" />

Does anyone know if rights can also be added automatically?

ezha86 commented 7 years ago

it works with android version 5 and lower starting from version 6 android called some of permissions "sensitive" and setting permission in AndroidManifest file stoped working. you must use react native PermissionsAndroid - http://facebook.github.io/react-native/releases/next/docs/permissionsandroid.html

dmexs commented 7 years ago

Ran in to this issue tonight, would this be worth adding to the README?

wumke commented 7 years ago

Yes, if I find some time I will test it and add a fix or workaround to the readme...

kurniawanj26 commented 6 years ago

I'm having this issue, any update ?

kailashvele commented 5 years ago

Not sure if its same as I faced. But in node_modules/react-native-immediate-phone-call/android/build.gradle we have the following configuration:

`android { compileSdkVersion 23 buildToolsVersion "23.0.1"

  defaultConfig  {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 2
    versionName "1.1"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
lintOptions {
   warning 'InvalidPackage'
}

}`

instead we can use latest configuration which lets user define the necessary sdk versions and build tools version on app level build.gradle and use the same for internal purpose provided by RN 0.57.8 ie. as following

` android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 2
    versionName "1.1"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
lintOptions {
   warning 'InvalidPackage'
}

} ` Image for better understanding.

screenshot 2019-01-05 at 7 05 18 pm

This did solve my problem while having error during build.

Attaching image of error for reference so that if anyone gets similar one they can fix it.

screenshot 2019-01-05 at 7 10 49 pm

@wumke Also I was thinking if we can give this setting of configuration by default?

wumke commented 5 years ago

@kailashvele This has nothing to do with the change of rights to sensitive rights which require special request popup in newer android versions. You have a good point in making this the standard setting for SDK versions (for other packages I use in my apps I also changed these values manually to my project settings, I've not checked if they are already switched to the config you suggest).

kailashvele commented 5 years ago

@wumke

This has nothing to do with the change of rights to sensitive rights which require special request popup in newer android versions.

Yes I just mentioned here because I didn't wanted to raise another issue and thought this might be close to it.

You have a good point in making this the standard setting for SDK versions (for other packages I use in my apps I also changed these values manually to my project settings, I've not checked if they are already switched to the config you suggest).

Other packages that I use, I didn't had to do any manual setting it works fine. Just had to do for this package. You can evaluate it if you want to standardise it as you know the package more so you can give the best suggestion. :)