Closed kulkarniankita closed 5 years ago
Trying to get it work on Android too, any suggestions would be appreciated.
@hyunjin-oh, unfortunately, it did not work on android for me through react native but I manually added the following line in my MainApplication class to get a notification and subscribe to an interest.
PushNotifications.start(getApplicationContext(), "<id>");
PushNotifications.subscribe("<interest-name>");
@kulkarniankita, I think I should do that too. Thanks a lot for sharing your solution!
When we're calling subscribe in android, it looks like the callbacks don't get executed:
import RNPusherPushNotifications from "react-native-pusher-push-notifications";
// ...
console.log(`Subscribing to "${interest}"`);
RNPusherPushNotifications.subscribe(
interest,
(statusCode, response) => {
console.error(statusCode, response);
},
() => {
console.log(`Subscribed to ${interest}`);
}
);
I don't see either callback's console messages RN debugger, but I do see the "Subscribing to..." message.
+1
Please help...
Anyone got this working on android yet????
@mikebridge Please.. Have you being able to get this working??
Hello,
The android implementation of this modules it's out-of-date, it uses the old Pusher API, checkout this link for further details. So it doesn't work anyway, I used Android Studio logging to see what happens.
I/System.out: Creating Pusher with App Key: cfe9cfc6-f219-49cd-88c8-9f4b0d3ef810(HTTPLog)-Static: isSBSettingEnabled false
(HTTPLog)-Static: isSBSettingEnabled false
W/FlurryAgent: Analytics report sent.
V/AsyncHttpRH: Progress 189 from 189 (100%)
E/PUploadSuccess: [token upload] Received status 404 with: {"error":"Wrong app key provided","desc":"This app key looks like a Beams Instance Id. If you'd like to use Beams, you can find the SDKs here: https:\/\/docs.pusher.com\/push-notifications."}
D/PUSHER_WRAPPER: FCM Registration failed with code 404 {"error":"Wrong app key provided","desc":"This app key looks like a Beams Instance Id. If you'd like to use Beams, you can find the SDKs here: https:\/\/docs.pusher.com\/push-notifications."}
Now, what should be done, is it to rewrite the android part using this new package, which is a way lot easier to use, from what I saw. https://docs.pusher.com/beams/reference/server-sdk-java-kotlin.
UPDATE: Didn't saw the Pull Request from @mikebridge, he did implemented the Beams SDK Checkout this #33
Following are the steps I took to get push notifications to register but this module is not working at all for
android
. I know that this is still under development but any help will be appreciated in order to figure this out for android.yarn add react-native-pusher-push-notifications
react-native link
to link the module.MainApplication.java
:settings.gradle
:The above did not register the device and did not subscribe to any interests either. Any suggestions?