One Signal Notification
Android
1. Open https://onesignal.com/ website. Log in to your one signal account.
2. Add App Name. Now select Google android and click on Next:Configure Your Platform.
3. Enter the firebase server key and firebase sender id to configure One signal notification.
4. Select target SDK as Native Android and click on the Save and Continue.
5. Copy your app Id for setup purposes. Click on check subscribed user. You will not find any device as there is no device registered in one signal at present. to register app in onesignal copy app id and follow below steps
6. Open the CiyaShop project in android studio.
7. Now open the application-level build.gradle file.
Paste Onesignal app id in one_signal_app_id.
8. Now go to utils folder under the package > MyApplication
Paste Onesignal app id in one_signal_app_id and sync Project.
9. After the build is complete, run the CiyaShop project on the device.
10. Now check the subscribed user again. As you run the code of one signal, you will get the registered device. Now click on the done button.
11. To test push notification, click on the Messages tab.
Now click on the new push button to send the notification.
12. Enter the title and message for notification and other details and set up other options for your message.
13. Click on the Review and Send button at the bottom of the page to send a notification.
14. Then click on send message button.
15. Now, check the notification on the device. Here, you can see that the notification sent from One signal is displayed on the device.
On clicking on the notification, you will simply get redirected to the application.
NOTE:- If your app keeps crashing, then you should add the below code in the sendNotification method inside ../fcm/MyFirebaseMessagingService.java file.
notificationBuilder.setSmallIcon(R.drawable.profile);