Closed TrushalRank closed 3 years ago
I've added the missing piece in this forked repo: https://github.com/vborisov/react-native-pusher-push-notifications
In my main activity I added the following lines:
import com.b8ne.RNPusherPushNotifications.NotificationsMessagingService;
public class MainActivity extends ReactActivity {
...
// Override onStart, onNewIntent:
@Override
protected void onStart() {
super.onStart();
ReactInstanceManager reactInstanceManager = getReactNativeHost().getReactInstanceManager();
NotificationsMessagingService.read(reactInstanceManager, this);
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
ReactInstanceManager reactInstanceManager = getReactNativeHost().getReactInstanceManager();
NotificationsMessagingService.read(reactInstanceManager, this);
}
...
I hope this helps until the devs here accept the pull request.
Regards
Thank you @vborisov , I will try that.
@vborisov , I am getting NotificationsMessagingService error in that code.
Did you make cd android & gradlew clean after you added the code?
На сб, 25.07.2020 г., 8:24 ч. TrushalRank notifications@github.com написа:
@vborisov https://github.com/vborisov , I am getting NotificationsMessagingService error in that code.
[image: Screenshot 2020-07-25 at 10 53 59 AM] https://user-images.githubusercontent.com/49527805/88449518-2ec67c00-ce65-11ea-8831-ecb2031dc77d.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/b8ne/react-native-pusher-push-notifications/issues/57#issuecomment-663812246, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZSCDJXLW6D6OCL5TRQWNLR5JUBNANCNFSM4OS6XBXA .
No, i didn't.
Well, you should in order the java files to be (re)built again and the MainActivity.java to find them (and this new notification service script).
На вт, 28.07.2020 г. в 13:15 TrushalRank notifications@github.com написа:
No, i didn't.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/b8ne/react-native-pusher-push-notifications/issues/57#issuecomment-664956607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZSCDNDXRYGYZD4NJU4G5DR52QNDANCNFSM4OS6XBXA .
-- Valentin Borisov
@vborisov No, it's not gone above error.
Any one can help me for solve this issue?
@vborisov I am getting the same errors as @TrushalRank was having. Can you please elaborate on what missing piece did you add in the forked repo so we can also add it in our code?
Honestly I can't find any issues with my forked repo.
in my package.json the repo was added as below:
"react-native-pusher-push-notifications": "git+http://git@github.com/vborisov/react-native-pusher-push-notifications",
I hope this one is the only one reason why it worked on my side but not on yours. In all cases here are the differences between the forked and the official branches - https://github.com/b8ne/react-native-pusher-push-notifications/compare/master...vborisov:master
P.S. I'm not a JAVA developer and I can't give you more explanations here.
@vborisov thank you, it fixed one problem. But still, it doesn't call the callback function if the app is killed and opened via push notification.
@Ahmdrza , I can't observe such issue. Like I said, I'm not JAVA developer, so can't help you a lot here.
@vborisov would you mind opening a PR for this? I'll happily review this for you and bundle it into a release
Sure, I already did this. You can review it when you have a chance.
Thanks!
@vborisov awesome - PR link #55
When application is in background mode and get the push notification, but when user tap on notification there are not getting notification listener method call. So, i can't handle push notification data when application is in background. This error is facing only in android platform.
Note: On foreground mode listener method works.