open up the project and go to the settings -> project settings -> Cloud Messaging section and get a server key and Sender ID. and preserve it as it will be needed in future.
Now go the the OneSinal website and create an account if you don’t have one through the link given below.
After that add an app to the onesignal platform and integrate it to the android project.
Now place these Firebase Server Key and Firebase Sender ID into the relevant Fields and hit save button. Select Native android and you will get the App ID, now skip to the next step. Close the popup box. Save the App id to your notepad.
- Go to Admin Panel and open SiteSettings page.
- Change Default Notification to OneSignal.
- Put your Onesignal App ID and Onsignal Sender ID (FCM Sender ID).
- Open app > java > yourpackagename > constant > ConstantValues.java
- Change DEFAULT_NOTIFICATION to onesignal.
- Open build.gradle (Module).
- Put your Onesignal App ID in manifestPlaceholders.
- Clean and Rebuild your Project
Note:Make sure that the Default Notification you selected in the Settings section in Admin Panel is same as the value of DEFAULT_NOTIFICATION in ConstantValues.java in Android Studio