Native App Setup

Instruction for configuring the native apps.

iOS App

XCode Target Capabilities - keychain sharing
<?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

<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>
// ...
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),

    // ...

  }

}
...
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 {
...
}

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'
...
//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')
...