Step 1 :
Use Firebase to generate Google server key, Go to (https://console.firebase.google.com/)
Step 2 :
Create a new project and enter the Project details
Step 3 :
Click the settings icon at the top left and select Project Settings, and select the Cloud Messaging tab.
Copy the Server key and Sender ID
Step 5 :
Goto OneSignal site(https://onesignal.com/) and create an account if you haven’t already.
Step 6 :
After login to One Signal account, click on add new app option.
Next, type your app name.
Step 8 :
Select the Google Android (GCM) and click next
Now paste the copied the Server key and Sender ID from firebase
(Step 4) and click Save
Next, select the target SDK for your app then click next
Next step copy the OneSignal App ID and click done.
Step 12 :
Next Goto to the android Project and find the build. Gradle and change One Signal App ID in onesignal_app_id location.
Step 13 :
Next Goto to one Signal Dashboard and select your app.
Step 14 :
Then Select the Messaging Tab in the top.
Step 15 :
Then Select the New Push Option.
Then checked, Send to Subscribed Users
Step 17 :
Next Type the Message, In Title Box enter the Notification Title, In Message, Box enter the message what you need to send a message to User.
You can send both normal Text Notification or Text with Image Notification to all users
Text with Image Notification