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
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.
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)