Instruction for configuring the native apps.
/ios/[---project name---]/Info.plist
make the following changes:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
...
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
...
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
...
</dict>
...
</dict>
<plist>
/android/app/src/main/AndroidManifest.xml
update the beginning of the manifest with the following SDK versions and permissions, as well as singleTop
activity launch mode:<manifest ...>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<activity
...
android:launchMode="singleTop"
...
>
...
</activity>
</manifest>
/android/app/src/main/java/com/[---project name---]/MainApplication.java
add the following imports, modify the call to FBSDKPackage
inserted by react-native link
and modify OnCreate
:// ...
import com.evollu.react.fcm.FIRMessagingPackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.FacebookSdk;
// ...
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// ...
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
// Initialize the SDK before executing any other operations,
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
}
// ...
protected List<ReactPackage> getPackages() {
// ...
new FBSDKPackage(mCallbackManager),
// ...
}
}
/android/build.gradle
make the following changes:...
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
...
/android/app/build.gradle
make the following changes:...
android {
...
}
repositories {
mavenCentral()
}
dependencies {
...
// Should not be included compile project(':react-native-push-notification')
...
}
...
// ADD THIS AT THE BOTTOM according to https://firebase.google.com/docs/android/setup#add_the_sdk
apply plugin: 'com.google.gms.google-services'
/android/settings.gradle
comment our references to react push notifications:...
//Should not be included
//include ':react-native-push-notification'
//project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
...