Integrating React Native plugin
Download Sample
Module API Docs
- Install plugin
For iOS, additionally install dependencies:
-
Configure your project in Firebase Console.
-
Locate the
google-services.json
file to theandroid/app/
folder in your project directory. Make sure that the package name of your app is registered for your Firebase project and persists in thegoogle-services.json
file.
- In iOS Xcode project enable Push Notifications in the Capabilities section.
- Import plugin and register for push notifications
- Add GoogleServices gradle plugin to your project’s build.gradle:
- Apply GoogleServicesPlugin in your app’s build.gradle:
Push notifications in foreground
When receiving a push in the background, no events are triggered until a push notification is clicked. After it is opened, Pushwoosh plugin fires pushReceived
and pushOpened
events.
When a push is received in the foreground, the plugin fires pushReceived
automatically and creates a notification in the Notification Center. When this notification is opened, it fires pushOpened
.
You can listen to pushReceived
event to immediately react on a push in case it is received in foreground, e.g., update content on a current page in your app. pushOpened
, on the other side, is used to react on a notification click event, which requires user interaction, e.g., to navigate within your app, trigger a new process in your app, etc.
Foreground notification creation can be controlled with the following flags added to AndroidManifest.xml and info.plist:
Share your feedback with us
Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.