$ npm install react-native-caller-id --save
$ react-native link react-native-caller-id
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-caller-id
and add RNCallerId.xcodeproj
libRNCallerId.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainActivity.java
import com.reactlibrary.RNCallerIdPackage;
to the imports at the top of the filenew RNCallerIdPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-caller-id'
project(':react-native-caller-id').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-caller-id/android')
android/app/build.gradle
:
compile project(':react-native-caller-id')
import CallerId from 'react-native-caller-id';
// Check extension enabled status on iOS
const enabled = await CallerId.getExtensionEnabledStatus();
// Set caller ids list
const callers = [
{
name: "A Caller Name",
number: "8494141414"
}
];
await CallerId.setCallerList(callers);