oney / react-native-gcm-android

GCM for React Native Android
MIT License
172 stars 76 forks source link

RN 0.29 needs Activity instance? #65

Open spacesuitdiver opened 8 years ago

spacesuitdiver commented 8 years ago

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.

leoabacade commented 7 years ago

same here

got this error:

screen shot 2016-07-13 at 11 04 52 am

"dependencies": { "react-native": "^0.29.0", "react-native-gcm-android": "^0.2.0", "react-native-system-notification": "^0.1.11", }

leoabacade commented 7 years ago

still get the error

node_modules/react-native-gcm-android/android/src/main/java/com/oney/gcm/BackgroundService.java:34: error: constructor NotificationPackage in class NotificationPackage cannot be applied to given types;
                .addPackage(new NotificationPackage(null))
                            ^
  required: no arguments
  found: <null>
  reason: actual and formal argument lists differ in length
1 error
:RNGcmAndroid:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

"dependencies": { "react-native": "^0.33.0", "react-native-gcm-android": "^0.2.0", "react-native-system-notification": "^0.2.1" }

leoabacade commented 7 years ago

ok, I switch to react-native-push-notification [https://github.com/zo0r/react-native-push-notification]

it supports "react-native": "^0.33.0",

you need to manually linking the react-native-system-notification, but it is pretty straightforward. [https://github.com/neson/react-native-system-notification]