How to setup OneSignal

Last Updated On October 07, 2020
You are here:

Before starting the guide on how to set your OneSignal, here’s a list of what you will need:
1) An OneSignal Account if you do not already have one
2) Your OneSignal App ID, available in Settings > Keys & IDs
3) iOS – An iOS device (iPhone, iPad, iPod Touch) to test on. The Xcode simulator doesn’t support push notifications so you must test on a real device.
4) iOS – You MUST have a Mac with a new version of Xcode
5) Android – A Firebase account

iOS:
Write those two commands into your terminal:
sudo gem install cocoapods
pod repo update


Get inside your OneSignal account.
Get inside your App that you’ll use.

Press on Setup Platform and select Apple.
Follow this guide to know how to get the .p12 certificates and upload it to the tab that just popped up into OneSignal. After you’ve uploaded the certificates, you can leave the tab.


Android:
Get inside your Firebase account and begin by configuring it (If you haven’t already).
Once you’ve done it, follow this guide to get your Server Key and your Sender ID.
Insert those two values into the OneSignal Android’s field.


At the end, two fields in Constants.ts file should be set inside the App code to be able to use OneSignal:

//OneSignal Constants
public static OneSignal_appID = 'dffaada2-....'; //Onesignal app id
public static OneSignal_googleProjectNumber = '521....'; //Firebase project number (Only for Android)
Enter in your OneSignal account, then Settings->Keys 6 IDs
Enter your Firebase console, then click on the cog icon to access the Settings page

Leave a Reply

Your email address will not be published. Required fields are marked *