Git Product home page Git Product logo

react-native-gcm-android's Introduction

react-native-gcm-android

GCM for React Native Android

Demo

https://github.com/oney/TestGcm

Installation

  • Run npm install react-native-gcm-android --save

  • In android/build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.1'
    classpath 'com.google.gms:google-services:1.5.0-beta3' // <- Add this line
  • In android/settings.gradle, add
include ':RNGcmAndroid', ':app'
project(':RNGcmAndroid').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gcm-android/android')

include ':react-native-system-notification'
project(':react-native-system-notification').projectDir = new File(settingsDir, '../node_modules/react-native-system-notification/android')
  • In android/app/build.gradle
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'           // <- Add this line
...
dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.16.+"
    compile 'com.google.android.gms:play-services-gcm:8.3.0' // <- Add this line
    compile project(':RNGcmAndroid')                         // <- Add this line
    compile project(':react-native-system-notification')     // <- Add this line
}
  • In android/app/src/main/AndroidManifest.xml, add these lines, be sure to change com.xxx.yyy to your package
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.SEND" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_TASKS" /> 
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<permission
  android:name="com.xxx.yyy.permission.C2D_MESSAGE"
  android:protectionLevel="signature" />
<uses-permission android:name="com.xxx.yyy.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>

...

<application
  android:theme="@style/AppTheme">

  ...
  <meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

  <receiver
    android:name="com.google.android.gms.gcm.GcmReceiver"
    android:exported="true"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
      <action android:name="com.google.android.c2dm.intent.RECEIVE" />
      <category android:name="com.xxx.yyy" />
    </intent-filter>
  </receiver>
  <service android:name="com.oney.gcm.GcmRegistrationService"/>
  <service android:name="com.oney.gcm.BackgroundService"></service>

  <service
    android:name="com.oney.gcm.RNGcmListenerService"
    android:exported="false" >
    <intent-filter>
      <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    </intent-filter>
  </service>
  <receiver
    android:exported="false"
    android:name="com.oney.gcm.GcmBroadcastReceiver">
    <intent-filter>
      <action android:name="com.oney.gcm.GCMReceiveNotification" />
      </intent-filter>
  </receiver>

  <receiver android:name="io.neson.react.notification.NotificationEventReceiver" />
  <receiver android:name="io.neson.react.notification.NotificationPublisher" />
  <receiver android:name="io.neson.react.notification.SystemBootEventReceiver">
    <intent-filter>
      <action android:name="android.intent.action.BOOT_COMPLETED"></action>
    </intent-filter>
  </receiver>
  ...
  • In android/app/src/main/java/com/testoe/MainActivity.java
import com.oney.gcm.GcmPackage;                             // <- Add this line
import io.neson.react.notification.NotificationPackage;     // <- Add this line
    ...
        .addPackage(new MainReactPackage())
        .addPackage(new GcmPackage())                       // <- Add this line
        .addPackage(new NotificationPackage(this))          // <- Add this line

GCM API KEY

By following Cloud messaging, you can get google-services.json file and place it in android/app directory

Usage

'use strict';

var React = require('react-native');
var {
  AppRegistry,
  View,
  DeviceEventEmitter,
} = React;

var GcmAndroid = require('react-native-gcm-android');
import Notification from 'react-native-system-notification';

if (GcmAndroid.launchNotification) {
  var notification = GcmAndroid.launchNotification;
  var info = JSON.parse(notification.info);
  Notification.create({
    subject: info.subject,
    message: info.message,
  });
  GcmAndroid.stopService();
} else {

  var {Router, Route, Schema, Animations, TabBar} = require('react-native-router-flux');
  var YourApp = React.createClass({
    componentDidMount: function() {
      GcmAndroid.addEventListener('register', function(token){
        console.log('send gcm token to server', token);
      });
      GcmAndroid.addEventListener('registerError', function(error){
        console.log('registerError', error.message);
      });
      GcmAndroid.addEventListener('notification', function(notification){
        console.log('receive gcm notification', notification);
        var info = JSON.parse(notification.data.info);
        if (!GcmAndroid.isInForeground) {
          Notification.create({
            subject: info.subject,
            message: info.message,
          });
        }
      });

      DeviceEventEmitter.addListener('sysNotificationClick', function(e) {
        console.log('sysNotificationClick', e);
      });

      GcmAndroid.requestPermissions();
    },
    render: function() {
      return (
        ...
      );
    }
  });

  AppRegistry.registerComponent('YourApp', () => YourApp);
}
  • There are two situations.
The app is running on the foreground or background.

GcmAndroid.launchNotification is null, you can get notification in GcmAndroid.addEventListener('notification' listenter.

The app is killed/closed

GcmAndroid.launchNotification is your GCM data. You can create notification with resolving the data by using react-native-system-notification module.

  • You can get info when clicking notification in DeviceEventEmitter.addListener('sysNotificationClick'. See react-native-system-notification to get more informations about how to create notification

Troubleshoot

  • Do not add multiDexEnabled true in android/app/build.gradle even encounter com.android.dex.DexException: Multiple dex files... failure.
  • Make sure to install Google Play service in Genymotion simulator before testing.

react-native-gcm-android's People

Contributors

babalustu avatar jjingrong avatar lukefanning avatar oney avatar vikassy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-gcm-android's Issues

issue after upgrading to version 0.1.0

FATAL EXCEPTION: IntentService[GcmRegistrationService]
E/AndroidRuntime( 7763): Process: com.voxiosapp, PID: 7763
E/AndroidRuntime( 7763): android.content.res.Resources$NotFoundException: String resource ID #0x0
E/AndroidRuntime( 7763): at android.content.res.Resources.getText(Resources.java:306)
E/AndroidRuntime( 7763): at android.content.res.Resources.getString(Resources.java:392)
E/AndroidRuntime( 7763): at android.content.Context.getString(Context.java:383)
E/AndroidRuntime( 7763): at com.oney.gcm.GcmRegistrationService.onHandleIntent(GcmRegistrationService.java:30)
E/AndroidRuntime( 7763): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/AndroidRuntime( 7763): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7763): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 7763): at android.os.HandlerThread.run(HandlerThread.java:61)

react native gcm android clicking on notification not opening the app

Hey I have this issue on our simple app that should let the app receive a GCM Notification when receiving a request from the server. I was able to let the notification show up, but then clicking on the notification won't open the app? Is there any functionality that I can do to make the react-native-gcm-android listen to notification clicks? Is this a known issue? Or is there any known fix to this?

Unable to Resolve R.drawable.ic_cast_dark

As the title mentioned, the ".setSmallIcon(R.drawable.ic_cast_dark)" method in RNGcmListenerService reports compilation error because ic_cast_dark was not able to be found.

I am using Android 4.2.2 in Genymotion, Mac El Capital, Android Studio 1.5.

Appreciate your help!

js error

I get the following js error plugging the module: Imagehas no propType for native prop RCTImageView.shouldNotifyLoadEvents

In the demo project this repeats as well.
gcm-issue

I actually do not see in your code any image usage, so the error looks quite strange.

GCM Dependency Update Suggested

The current google play dependencies include the whole package of gms while only the gcm part is needed. The gms whole package is big and could reach the method quantity limit of Android. That is, change the gms dependency to the one below

compile "com.google.android.gms:play-services-gcm:8.1.0" instead of

compile "com.google.android.gms:play-services:8.1.0"

Native module AsyncStorageModule tried to override AsyncStorageModule

Okay after I found out that #34 was my fault and related to another library I got that problem fixed. Now I really have a problem with this library together with react native 0.18.0

These are my gradle dependencies:

compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.18.+"
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
    compile project(':RNGcmAndroid')
    compile project(':react-native-system-notification')
    compile project(':react-native-image-picker')
    compile project(':react-native-contacts')

Build the application works but as soon as I run the application I get the typical react native red screen showing the following error message:

01-26 01:25:03.251  2720  2720 E unknown:React: java.lang.IllegalStateException: Native module AsyncStorageModule tried to override AsyncStorageModule for module name AsyncSQLiteDBStorage. If this was your intention, return true from AsyncStorageModule#canOverrideExistingModule()
01-26 01:25:03.251  2720  2720 E unknown:React:     at com.facebook.react.bridge.NativeModuleRegistry$Builder.add(NativeModuleRegistry.java:184)
01-26 01:25:03.251  2720  2720 E unknown:React:     at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:745)
01-26 01:25:03.251  2720  2720 E unknown:React:     at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:681)
01-26 01:25:03.251  2720  2720 E unknown:React:     at com.facebook.react.ReactInstanceManagerImpl.access$600(ReactInstanceManagerImpl.java:80)
01-26 01:25:03.251  2720  2720 E unknown:React:     at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:173)
01-26 01:25:03.251  2720  2720 E unknown:React:     at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:158)
01-26 01:25:03.251  2720  2720 E unknown:React:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
01-26 01:25:03.251  2720  2720 E unknown:React:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-26 01:25:03.251  2720  2720 E unknown:React:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
01-26 01:25:03.251  2720  2720 E unknown:React:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
01-26 01:25:03.251  2720  2720 E unknown:React:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
01-26 01:25:03.251  2720  2720 E unknown:React:     at java.lang.Thread.run(Thread.java:818)
01-26 01:25:03.347  2720  2738 W EGL_emulation: eglSurfaceAttrib not implemented
01-26 01:25:03.347  2720  2738 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad760b60, error=EGL_SUCCESS

When I remove this library as a dependency everything works fine.

App crashes on Android versions before 5.0

Compiling and running the app on versions 4.x just crashes the app with a pop-up with an error message of:

Unfortunately, [APPNAME] has stopped.

Has anyone managed to get around this? This does not occur in versions 5.0 & 6.0.

Cant get token

Hi , I have installed and followed all of the steps on the Readme but it seems that on first try to get the device token it doesnt give any . I tried console.log(GcmAndroid) and it only showed { [Function: GcmAndroid] isInForeground: true } @oney thanks

Compatibility / instructions for ReactNative 0.19

Hello Howard, congratulations on this great work that is very much needed :)

I am using ReactNative 0.19 and can't seem to find how to import the gcm packages properly in android/app/src/main/java/com/testoe/MainActivity.java.

Since 0.18, RN's MainActivity.java file has been simplified a lot and we can't just do this anymore :

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mReactRootView = new ReactRootView(this);

        mReactInstanceManager = ReactInstanceManager.builder()
                ....
                .addPackage(new MainReactPackage())
                .addPackage(new GcmPackage())                       // <- Add this line
                .addPackage(new NotificationPackage(this))          // <- Add this line

The code that seem to now be responsible for adding packages is now :

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage()
      );
    }

I tried doing this :

@Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new GcmPackage(),
        new NotificationPackage(this)
      );
    }

but I got errors when doing (clean) builds wit gradle, saying packages were not found on Android. (this might because of #41 but I am not sure)

What's the clean way to fix this?

Thanks

App crash with ToastAndroid

when I Import the ToastAndroid component of react-native, anywhere in my app, and send a notification when the app is closed, the app crash.
In ToastAndroid.android.js the line: var RCTToastAndroid = require('NativeModules').ToastAndroid;
returns a null value.
I'm not sure if this is an issue to you or react-native main git but thought you should know.

Notification does not disappear on status bar after it's clicked

The notification stays at the tool bar and sometimes freezes it. I am placing the addEventListener and requestPermissions() methods at index.android.js file and under componentWillMount() method. I am using RN0.15 and Android 4.2.2 on Genymotion. Is it because I use it wrong or similar cases are encountered by others as well? Thanks a lot!

Error: 'GcmAndroid.launchNotification internal', undefined

I understand the there's a previous post #30 about this error and the code worked later. However, in my case, even after I restart the app, it still shows error of 'GcmAndroid.launchNotification internal', undefined. My env specs:

RN 0.24
Android 4.4.2 on Genymotion
Latest version of this module and the notifications module

Many thanks!

error Unforturnately, appName has stopped.

Hi!
error push notifycation when app killed in Android

My change log:

02-18 11:13:49.965 21283-21283/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: vn.evanews.evanews, PID: 21283
java.lang.RuntimeException: Unable to start service com.oney.gcm.BackgroundService@42371058 with Intent { cmp=vn.evanews.evanews/com.oney.gcm.BackgroundService (has extras) }: java.lang.NullPointerException
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3127)
at android.app.ActivityThread.access$2200(ActivityThread.java:174)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5756)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.oney.gcm.BackgroundService.getBuildConfigDEBUG(BackgroundService.java:64)
at com.oney.gcm.BackgroundService.onStartCommand(BackgroundService.java:28)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3110)
at android.app.ActivityThread.access$2200(ActivityThread.java:174)ย 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)ย 
at android.os.Handler.dispatchMessage(Handler.java:102)ย 
at android.os.Looper.loop(Looper.java:146)ย 
at android.app.ActivityThread.main(ActivityThread.java:5756)ย 
at java.lang.reflect.Method.invokeNative(Native Method)ย 
at java.lang.reflect.Method.invoke(Method.java:515)ย 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)ย 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)ย 
at dalvik.system.NativeStart.main(Native Method)ย 
02-18 11:13:49.975 749-21308/? E/android.os.Debug: !@sDumpstate is still running

Please help me!

Undefined GcmAndroid.launchNotification when receiving notification when app is closed (not in foreground/background)

Hello!

Thanks for the plugin! Having trouble getting the launchNotification come through successfully. There are a number of red flags in the logs, but I'm not sure how to proceed. The notification seems to go through some trouble around "setLocalOnly" and "setColor" on my device on 4.4.4. It also seems to have some trouble referencing some classes (might be unrelated). Would love your guidance on the matter.

Note that notifications all work smoothly when the app is in the foreground and background.

Thanks in advance!

Logs:

I/ActivityManager( 1128): Start proc com.gogomonkey.business for broadcast com.gogomonkey.business/com.google.android.gms.gcm.GcmReceiver: pid=17947 uid=10203 gids={50203, 3003, 1028, 1015, 3002}
I/dalvikvm(17947): Could not find method android.app.Notification$Builder.setLocalOnly, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
W/dalvikvm(17947): VFY: unable to resolve virtual method 236: Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder;
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x00c8
I/dalvikvm(17947): Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzj
W/dalvikvm(17947): VFY: unable to resolve virtual method 544: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x000b
I/GMPM    (17947): App measurement is starting up
I/dalvikvm(17947): Could not find method android.app.Notification$Builder.setColor, referenced from method com.google.android.gms.gcm.zza.zzw
W/dalvikvm(17947): VFY: unable to resolve virtual method 222: Landroid/app/Notification$Builder;.setColor (I)Landroid/app/Notification$Builder;
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x0068
D/RNGcmListenerService(17947): sendNotification
D/BackgroundService(17947): onStartCommand
D/Sensors ( 1128): AccelerationSensor: Set Sensors state 0x1
D/Sensors ( 1128): AccelerationSensor: set delay 200
D/Sensors ( 1128): AccelerationSensor: set delay 66
D/dalvikvm(17947): Trying to load lib /data/app-lib/com.gogomonkey.business-2/libreactnativejni.so 0x41f85b10
D/dalvikvm(17947): Added shared lib /data/app-lib/com.gogomonkey.business-2/libreactnativejni.so 0x41f85b10
D/dalvikvm(17947): Trying to load lib /data/app-lib/com.gogomonkey.business-2/libreactnativejni.so 0x41f85b10
D/dalvikvm(17947): Shared lib '/data/app-lib/com.gogomonkey.business-2/libreactnativejni.so' already loaded in same CL 0x41f85b10
I/dalvikvm(17947): threadid=1: recursive native library load attempt (/data/app-lib/com.gogomonkey.business-2/libreactnativejni.so)
D/dalvikvm(17947): Trying to load lib /data/app-lib/com.gogomonkey.business-2/libfbjni.so 0x41f85b10
D/dalvikvm(17947): Added shared lib /data/app-lib/com.gogomonkey.business-2/libfbjni.so 0x41f85b10
I/dalvikvm(17947): Could not find method com.facebook.react.views.view.ReactViewGroup.drawableHotspotChanged, referenced from method com.facebook.react.views.view.ReactViewManager.receiveCommand
W/dalvikvm(17947): VFY: unable to resolve virtual method 24770: Lcom/facebook/react/views/view/ReactViewGroup;.drawableHotspotChanged (FF)V
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x002d
I/dalvikvm(17947): Could not find method com.facebook.react.views.view.ReactViewGroup.setElevation, referenced from method com.facebook.react.views.view.ReactViewManager.setElevation
W/dalvikvm(17947): VFY: unable to resolve virtual method 24806: Lcom/facebook/react/views/view/ReactViewGroup;.setElevation (F)V
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x000a
I/dalvikvm(17947): Could not find method android.webkit.CookieManager.setCookie, referenced from method com.facebook.react.modules.network.ForwardingCookieHandler.addCookieAsync
W/dalvikvm(17947): VFY: unable to resolve virtual method 16883: Landroid/webkit/CookieManager;.setCookie (Ljava/lang/String;Ljava/lang/String;Landroid/webkit/ValueCallback;)V
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x0005
I/dalvikvm(17947): Could not find method android.webkit.CookieManager.removeAllCookies, referenced from method com.facebook.react.modules.network.ForwardingCookieHandler.clearCookiesAsync
W/dalvikvm(17947): VFY: unable to resolve virtual method 16880: Landroid/webkit/CookieManager;.removeAllCookies (Landroid/webkit/ValueCallback;)V
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x0009
I/dalvikvm(17947): Could not find method android.webkit.CookieManager.flush, referenced from method com.facebook.react.modules.network.ForwardingCookieHandler$CookieSaver.flush
W/dalvikvm(17947): VFY: unable to resolve virtual method 16876: Landroid/webkit/CookieManager;.flush ()V
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x0006
D/ConnectivityService( 1128): handleInetConditionHoldEnd: net=1, condition=100, published condition=100
I/SBar.NetworkController( 1227): onReceive: ConnectivityManager.INET_CONDITION_ACTION Received
I/ModemStatsDSDetect( 1314): onReceive() -Intent { act=android.net.conn.INET_CONDITION_ACTION flg=0x4000010 (has extras) }
I/SBar.NetworkController( 1227): updateConnectivity: NetworkInfo: NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "WYXWJ", roaming: false, failover: false, isAvailable: true, isConnectedToProvisioningNetwork: false, inetCondition= 1
I/ModemStatsDSDetect( 1314): INET_CONDITION=100 ,activeNet=NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "WYXWJ", roaming: false, failover: false, isAvailable: true, isConnectedToProvisioningNetwork: false
I/ModemStatsDSDetect( 1314): onReceive() - done, currentInetCondition=100
W/dalvikvm(17947): VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
W/dalvikvm(17947): VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
I/dalvikvm(17947): Could not find method java.nio.file.Files.newOutputStream, referenced from method okio.Okio.sink
W/dalvikvm(17947): VFY: unable to resolve static method 46635: Ljava/nio/file/Files;.newOutputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream;
D/dalvikvm(17947): VFY: replacing opcode 0x71 at 0x000a
W/dalvikvm(17947): VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
W/dalvikvm(17947): VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
I/dalvikvm(17947): Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
W/dalvikvm(17947): VFY: unable to resolve static method 46634: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
D/dalvikvm(17947): VFY: replacing opcode 0x71 at 0x000a
I/ReactNativeJS(17947): index.android.js==============================
I/ReactNativeJS(17947): undefined

I/dalvikvm(17947): Could not find method android.widget.ImageView.<init>, referenced from method com.facebook.drawee.view.DraweeView.<init>
W/dalvikvm(17947): VFY: unable to resolve direct method 17156: Landroid/widget/ImageView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;II)V
D/dalvikvm(17947): VFY: replacing opcode 0x70 at 0x0000
I/dalvikvm(17947): Could not find method com.facebook.drawee.view.DraweeView.getImageTintList, referenced from method com.facebook.drawee.view.DraweeView.init
W/dalvikvm(17947): VFY: unable to resolve virtual method 19393: Lcom/facebook/drawee/view/DraweeView;.getImageTintList ()Landroid/content/res/ColorStateList;
D/dalvikvm(17947): VFY: replacing opcode 0x6e at 0x0015
V/AlarmManager( 1128): sending alarm Alarm{42088680 type 2 com.facebook.katana}
I/ActivityManager( 1128): Waited long enough for: ServiceRecord{42a494c8 u0 com.gogomonkey.business/com.oney.gcm.BackgroundService}

app/build.gradle dependencies:

dependencies {
    compile project(':react-native-code-push')
    compile project(':react-native-device-info')
    compile project(':react-native-vector-icons')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.17.+"
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
    compile project(':RNGcmAndroid')
    compile project(':react-native-system-notification')
}

versions:

    "react-native-gcm-android": "^0.1.8",
    "react-native-system-notification": "0.0.8",
    "react-native": "^0.17.0",

smallIcon support

I'm reading documentation for system-notification and they seem to have features for lights (led indicator) and smallIcon. Do you have these features passing through to system-notificication in launchNotification?

Android GCM permission request crashes app

Hi all ,

I've followed the setup guide and installed all that is needed but i've encountered a problem where when this line runs : GcmAndroid.requestPermissions();
the application crashes.

any ideas ?

iOS Support

This library worked on providing GCM support for iOS, but seems to be unmaintained right now: https://github.com/bh5-pods/react-native-gcm

Would you accept a PR to provide GCM support for iOS in this library too? I'm not sure if there would need to be any API changes but I think it would be nice to only have to deal with one system on both the RN and backend sides.

Activity started twice

Press Home button to minimise the app and send a push notification to the app. If you click the the notification, it will launch the app again. But you have to click back button twice to go back.

Handling AndroidManifest.xml with buildtypes and applicationIdSuffix

Just thought I'd share a hint with anyone who might run in to the same problem... If you are using gradle with different build types such as debug and release, and you are using an applicationIdSuffix, you might run into problems with your AndroidManifest.xml, but here's a nice way to fix it. Let's start with the problem. You need to add this kinds of lines lines in the manifest:

    <permission
      android:name="com.xxx.yyy.permission.C2D_MESSAGE"
      android:protectionLevel="signature" />

...and you have to use the actual app class, com.xxx.yyy, but what if you have com.xxx.yyy.debug in your debug build? To get it running, you can use manifest placeholders in your build.gradle and AndroidManifest.xml:

    buildTypes {
        release {
            manifestPlaceholders = [ buildTypeSuffix:"" ]
            ...
        }
        debug {
            manifestPlaceholders = [ buildTypeSuffix:".debug" ] <--- add this
            applicationIdSuffix ".debug" <--- if you have this
            ...
        }
    }

and then in your AndroidManifest.xml you use them like this

    <permission
      android:name="com.xxx.yyy${buildTypeSuffix}.permission.C2D_MESSAGE"
      android:protectionLevel="signature" />

and so on. Let me know your opinions on wether this is a sensible solution. I'm using it because it seems to work, but I have no idea if it's the best way to solve this sort of a problem. I'm not much of a Java coder so I'm going with what I can scrape from the internet... ๐Ÿ˜„

GitHub Tags

Would love to see the NPM versions reflected in GitHub tags in this repo.

Awesome work by the way!

App crashes when App is killed completely..

I've been working on this app for a while using your module, it seems fine for when the app is in the background but crashes when app is completely killed from the device. Is there any workaround for this issue?? Please let me know :(

App crashes when closed while receiving notification

For some reason, my app crashes if I receive a push notification when the app is closed. It works just fine when the app is in foreground/background, but if I actually close it, notifications will cause a crash. My logs contain the following:

D/com.oney.gcm.GcmModule(20991): mIntent is null: false
D/com.oney.gcm.GcmModule(20991): bundleString: {"info":"{\"subject\":\"Reminder\",\"message\":\"Test\"}","collapse_key":"do_not_collapse"}
I/ReactNativeJS(20991): 'GcmAndroid.launchNotification internal', undefined
E/ReactNativeJS(20991): undefined is not an object (evaluating 's.getCurrentAppState')
E/AndroidRuntime(20991): FATAL EXCEPTION: mqt_native_modules
E/AndroidRuntime(20991): Process: com.myapp, PID: 20991
E/AndroidRuntime(20991): com.facebook.react.modules.core.JavascriptException: undefined is not an object (evaluating 's.getCurrentAppState'), stack:
E/AndroidRuntime(20991): <unknown>@12:23852
E/AndroidRuntime(20991): r@1:747
E/AndroidRuntime(20991): n@1:413
E/AndroidRuntime(20991): AppState@13:49968
E/AndroidRuntime(20991): <unknown>@24:12816
E/AndroidRuntime(20991): r@1:747
E/AndroidRuntime(20991): r@1:476
E/AndroidRuntime(20991): n@1:413
E/AndroidRuntime(20991): <unknown>@24:28048
E/AndroidRuntime(20991):  at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:70)
E/AndroidRuntime(20991):  at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:58)
E/AndroidRuntime(20991):  at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(20991):  at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:249)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:158)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleRegistry.java:58)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.call(CatalystInstanceImpl.java:428)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.queue.NativeRunnableDeprecated.run(Native Method)
E/AndroidRuntime(20991):  at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(20991):  at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
E/AndroidRuntime(20991):  at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(20991):  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:184)
E/AndroidRuntime(20991):  at java.lang.Thread.run(Thread.java:818)

Crashing when app is closed, but with different error

My app is also crashing @ RN 0.22.0 when app is killed, but I'm getting a different error:
I/ReactNativeJS(12477): 'GcmAndroid.launchNotification internal', undefined E/AndroidRuntime(12477): FATAL EXCEPTION: main E/AndroidRuntime(12477): Process: com.wayfarer, PID: 12477 E/AndroidRuntime(12477): java.lang.NoSuchMethodError: No virtual method onPause()V in class Lcom/facebook/react/ReactInstanceManager; or its super classes (declaration of 'com.facebook.react.ReactInstanceManager' appears in /data/app/com.wayfarer-2/base.apk) E/AndroidRuntime(12477): at com.oney.gcm.BackgroundService.onDestroy(BackgroundService.java:47) E/AndroidRuntime(12477): at android.app.ActivityThread.handleStopService(ActivityThread.java:3292) E/AndroidRuntime(12477): at android.app.ActivityThread.access$2300(ActivityThread.java:172) E/AndroidRuntime(12477): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1524) E/AndroidRuntime(12477): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(12477): at android.os.Looper.loop(Looper.java:145) E/AndroidRuntime(12477): at android.app.ActivityThread.main(ActivityThread.java:5835) E/AndroidRuntime(12477): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(12477): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(12477): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) E/AndroidRuntime(12477): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

Any suggestions here? Thank you.

RN 0.29 needs Activity instance?

I can't use new NotificationPackage(this) with 0.29 as MainActivity.java stuff was moved to MainApplication.java so I'm not sure how to get an instance of Activity.

Missing modules in react-native packager

This is piece of react-native start output:

[1:57:09 PM] <START> request:/index.android.map?platform=android&dev=true
[1:57:09 PM] <START> find dependencies
Unable to resolve module Map from D:\Herby\Work\foo\bar\node_modules\react-native-gcm-android\index.android.js
Unable to resolve module invariant from D:\Herby\Work\foo\bar\node_modules\react-native-gcm-android\index.android.js
[1:57:09 PM] <END>   find dependencies (318ms)
[1:57:09 PM] <START> transform
transforming [========================================] 100% 417/418

after which the package is stuck.

I see you do require('Map') and require('invariant') in index.android.js, but there is no trace of them in package.json...

Crash on registration

I'm getting the following exception when trying to add an event lister for 'register' events. Any ideas?

FATAL EXCEPTION: IntentService[GcmRegistrationService] at com.oney.gcm.GcmRegistrationService.onHandleIntent(GcmRegistrationService.java:30)
Process: com.myapp, PID: 23592
android.content.res.Resources$NotFoundException: String resource ID #0x0
 at android.content.res.Resources.getText(Resources.java:321)
 at android.content.res.Resources.getString(Resources.java:407)
 at android.content.Context.getString(Context.java:377)
 at com.oney.gcm.GcmRegistrationService.onHandleIntent(GcmRegistrationService.java:31)
 at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:135)
 at android.os.HandlerThread.run(HandlerThread.java:61)
Force finishing activity 1 com.myapp/.MainActivity
Tried to remove non-existent frame callback

Getting DexException when using react native 0.18.0

I am trying to use this plugin with react native 0.18.0. These are my gradle dependencies:

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.18.+"
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
    compile project(':RNGcmAndroid')
    compile project(':react-native-system-notification')
    compile project(':react-native-image-picker')
    compile project(':react-native-contacts')
}

and this is the error message I receive

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/facebook/infer/annotation/Assertions;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)

Does somebody have a clue how to solve this?

What went wrong

A problem occurred configuring project ':RNGcmAndroid'.
> Could not resolve all dependencies for configuration ':RNGcmAndroid:_debugCompile'.
   > Could not find com.google.android.gms:play-services-measurement:8.1.0.
     Searched in the following locations:
         file:/home/isuvorov/.m2/repository/com/google/android/gms/play-services-measurement/8.1.0/play-services-measurement-8.1.0.pom
         file:/home/isuvorov/.m2/repository/com/google/android/gms/play-services-measurement/8.1.0/play-services-measurement-8.1.0.jar
         https://jcenter.bintray.com/com/google/android/gms/play-services-measurement/8.1.0/play-services-measurement-8.1.0.pom
         https://jcenter.bintray.com/com/google/android/gms/play-services-measurement/8.1.0/play-services-measurement-8.1.0.jar
         file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-measurement/8.1.0/play-services-measurement-8.1.0.pom
         file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-measurement/8.1.0/play-services-measurement-8.1.0.jar
     Required by:
         r2:RNGcmAndroid:unspecified
   > Could not find com.google.android.gms:play-services:8.1.0.
     Searched in the following locations:
         file:/home/isuvorov/.m2/repository/com/google/android/gms/play-services/8.1.0/play-services-8.1.0.pom
         file:/home/isuvorov/.m2/repository/com/google/android/gms/play-services/8.1.0/play-services-8.1.0.jar
         https://jcenter.bintray.com/com/google/android/gms/play-services/8.1.0/play-services-8.1.0.pom
         https://jcenter.bintray.com/com/google/android/gms/play-services/8.1.0/play-services-8.1.0.jar
         file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services/8.1.0/play-services-8.1.0.pom
         file:/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services/8.1.0/play-services-8.1.0.jar
     Required by:
         r2:RNGcmAndroid:unspecified

Execution failed for task ':app:transformClassesWithDexForDebug'.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

I tried to run the example and everything went OK.
When I tried to install this module onto my App, that error appears.

I don't have multiDexEnabled and I'm running on an Android device with RN 0.17.

issue with implementaion

i have followed all the steps but nothing is happening, also i am not able to receive registration id. I am new to this. Need help

MISSING_INSTANCEID_SERVICE

This is the adb logcat i get when I reach the spot in code where I call GcmAndroid.addEventListener('register'....

01-06 09:00:03.885  5066  5172 D GcmRegistrationService: Failed to complete token refresh
01-06 09:00:03.885  5066  5172 D GcmRegistrationService: java.io.IOException: MISSING_INSTANCEID_SERVICE
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.zzc.zza(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.zzc.zzb(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.zzc.zza(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.InstanceID.zzc(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.oney.gcm.GcmRegistrationService.onHandleIntent(GcmRegistrationService.java:38)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.os.Handler.dispatchMessage(Handler.java:102)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.os.Looper.loop(Looper.java:148)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.os.HandlerThread.run(HandlerThread.java:61)

what am I missing?

I have the google-services.json in my android/app/ directory
I edited all the appropriate files as listed in the readme

I am using Parse as my backend. But I don't think this should have anything to do with it as I haven't yet sent the token up to parse because I can't get it.

Notifications belong in individual module build.gradle files

I am installing this right now, and when I go to add the classpath to the build.gradle dependencies, there's a comment already that says:

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

I think I shouldn't be adding this library's dependency to this file. I'll continuing doing it for now, but it seems like it is not supposed to be done, according to the comment.

com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `int64', but had type `double'

Notification parsedParams: {"subject":"Hello GCM","message":"Hello from the server side!","smallIcon":"ic_launcher","id":11269.0,"action":"DEFAULT","payload":"{}","autoClear":true,"tickerText":{"depth":2,"length":38,"s1":{"depth":1,"length":11,"s1":"Hello GCM","s2":": "},"s2":"Hello from the server side!"},"priority":1.0,"sound":"default","vibrate":"default","lights":"default","delayed":false,"scheduled":false}
FATAL EXCEPTION: AsyncTask #4
Process: com.app, PID: 5322
com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type int64', but had typedouble'
at com.facebook.react.bridge.ReadableNativeMap.getInt(Native Method)
at io.neson.react.notification.NotificationAttributes.loadFromReadableMap(NotificationAttributes.java:122)
at io.neson.react.notification.NotificationAttributes.loadFromMap(NotificationAttributes.java:94)
at io.neson.react.notification.GCMNotificationListenerService.sendSysNotification(GCMNotificationListenerService.java:60)
at io.neson.react.notification.GCMNotificationListenerService.onMessageReceived(GCMNotificationListenerService.java:28)
at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

App crashes while in background

E/AndroidRuntime(32509): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime(32509): Process: com.app, PID: 32509
E/AndroidRuntime(32509): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime(32509): at android.os.AsyncTask$3.done(AsyncTask.java:300)
E/AndroidRuntime(32509): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
E/AndroidRuntime(32509): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
E/AndroidRuntime(32509): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
E/AndroidRuntime(32509): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E/AndroidRuntime(32509): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(32509): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(32509): at java.lang.Thread.run(Thread.java:818)
E/AndroidRuntime(32509): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/react/views/text/ReactTextInlineImageViewManager;
E/AndroidRuntime(32509): at com.oney.gcm.MainReactPackage.createViewManagers(MainReactPackage.java:64)
E/AndroidRuntime(32509): at com.facebook.react.ReactInstanceManagerImpl.createAllViewManagers(ReactInstanceManagerImpl.java:659)
E/AndroidRuntime(32509): at com.facebook.react.CoreModulesPackage.createNativeModules(CoreModulesPackage.java:63)
E/AndroidRuntime(32509): at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:893)
E/AndroidRuntime(32509): at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:810)
E/AndroidRuntime(32509): at com.facebook.react.ReactInstanceManagerImpl.access$700(ReactInstanceManagerImpl.java:103)
E/AndroidRuntime(32509): at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:199)
E/AndroidRuntime(32509): at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:182)
E/AndroidRuntime(32509): at android.os.AsyncTask$2.call(AsyncTask.java:288)
E/AndroidRuntime(32509): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/AndroidRuntime(32509): ... 4 more
E/AndroidRuntime(32509): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.react.views.text.ReactTextInlineImageViewManager" on path: DexPathList[[zip file "/data/app/com.app-2/base.apk"],nativeLibraryDirectories=[/data/app/com.app-2/lib/arm, /vendor/lib, /system/lib]]
E/AndroidRuntime(32509): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime(32509): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime(32509): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/AndroidRuntime(32509): ... 14 more
E/AndroidRuntime(32509): Suppressed: java.lang.ClassNotFoundException: com.facebook.react.views.text.ReactTextInlineImageViewManager
E/AndroidRuntime(32509): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime(32509): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/AndroidRuntime(32509): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/AndroidRuntime(32509): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime(32509): ... 15 more
E/AndroidRuntime(32509): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

App does not receive messages after reboot on Android 5.0

I use this package and react-native-system-notification packages to manage GCM notifications, everything works fine on Android 4.x but on 5.0 (ASUS_Z00AD) after reboot GCM messages not appear, log shows me

W/BroadcastQueue(  639): Reject to launch app com.Sgoomys.Main/10246 for broadcast: App Op 48
W/GCM-DMM ( 1824): broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000000 pkg=com.Sgoomys.Main (has extras) }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.