Open rizwan92 opened 5 years ago
Since you are using v0.60.x of React Native, dependencies should now autolink. Have you tried removing the call to packages.add(new InCallManagerPackage());
from MainApplication.java
?
yeah I tried that too but didn't get a response when I call this code in App.js
componentDidMount() {
InCallManager.start({ media: 'audio' });
}
InCallManager.start()
does not return anything. If the native library was not linked, you would get the error: null is not an object (evaluating 'InCallManager.start')
I just tested in a new v0.60.5 app with the following method, which prints "denied" since I have not granted media permissions:
setTimeout(async () => {
const permission = await InCallManager.checkRecordPermission()
console.log(permission)
}, 1000)
The only change I had to make after running npm install --save react-native-incall-manager
was to add <uses-permission android:name="android.permission.WAKE_LOCK" />
in android/app/src/main/AndroidManifest.xml
permission is granted
componentDidMount() {
console.log('ahahahahah');
setTimeout(async () => {
const permission = await InCallManager.checkRecordPermission();
console.log(permission);
InCallManager.start({ media: 'audio' });
}, 1000);
}
how to link react-native-incall-manager in RN0.60 Please update or provide docs I have followed each and every instructions
If you get a response from that method, it is linked.
i am running this app in the android pie is there any sdk updation requires additional permission ? please may i know ? which android version you ran your RN0.60 ?
Can you push your latest test codes to the new repository so I can explore the codes and identify where I am doing wrong?
i want to check here at this line implementation "com.android.support:support-v4:28.0.3"
You can see in the code of this module that checkRecordPermission
calls the NativeModule, so if that returns then the module's native code is linked.
For my sample app, you can see the commit adding this library here, and the app's repository here. You don't call react-native link
for React Native v0.60+
branch name for this repository https://github.com/ruddell/jhipster-examples/tree/incall-manager to check demo and user id password ?
i tried registering and login dint work for me incall-manager branch
You can see the same changes made to an app generated by react-native init
in this branch, this commit. On startup, the app logs to the console what the native method returns.
For the other example, I did not deploy a backend for it so registration/login does not work. They are not necessary to test if the native module is linked. LaunchScreen.js
is the screen that shows up on launch. It does not require authentication. Change console.tron.log
to console.log
to see the log in the browser console (or use Reactotron for logging).
thanks man i am givin it a shot
i am facing this error
Native Module Incall Manager tried to override IncallManagerModule . check to get Package Method in main Application.java it might be that module has been created twice. if this was your intention, set cannotOverrideExixistingmodule=True
my package.json file
my Mainapplication.java file
my build.Gradle file
my graddle.settings
i am calling InCallManager in App.js inside componentDidMount
every thing seems fine to me what is wrong