Commit 20c62623 authored by Douglas Nassif Roma Junior's avatar Douglas Nassif Roma Junior Committed by GitHub

Merge pull request #5 from douglasjunior/patch-3

Make 'com.google.android.gms:play-services-gcm' use optional.
parents 3372e8a0 a337a40a
...@@ -12,8 +12,6 @@ import android.provider.Settings.Secure; ...@@ -12,8 +12,6 @@ import android.provider.Settings.Secure;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import com.google.android.gms.iid.InstanceID;
import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReactMethod;
...@@ -114,7 +112,11 @@ public class RNDeviceModule extends ReactContextBaseJavaModule { ...@@ -114,7 +112,11 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
e.printStackTrace(); e.printStackTrace();
} }
constants.put("instanceId", InstanceID.getInstance(this.reactContext).getId()); try {
if (Class.forName("com.google.android.gms.iid.InstanceID") != null) {
constants.put("instanceId", com.google.android.gms.iid.InstanceID.getInstance(this.reactContext).getId());
}
} catch (ClassNotFoundException e) {}
constants.put("deviceName", deviceName); constants.put("deviceName", deviceName);
constants.put("systemName", "Android"); constants.put("systemName", "Android");
constants.put("systemVersion", Build.VERSION.RELEASE); constants.put("systemVersion", Build.VERSION.RELEASE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment