Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Latest commit

 

History

History
61 lines (41 loc) · 2.12 KB

ONE_SIGNAL.md

File metadata and controls

61 lines (41 loc) · 2.12 KB

One Signal Set Up

This will explain how to use One Signal to set up push notifications

iOS

First, you will need to create a certificate from Apple for iOS. Click on your app in the identifiers list in the Apple Developer Portal and then scroll down to configure a push certificate.

push certificate

You will need to generate a Certificate Signing Request for Apple, use the following command

openssl genrsa -out myprivate.key 2048
openssl req -new -key myprivate.key -out csr.certSigningRequest

Fill Prompts with this info:

Country Name (2 letter code) []: US
State or Province Name (full name) []: United States
Locality Name (eg, city) []:
Organization Name (eg, company) []: Apple Inc.
Organizational Unit Name (eg, section) []: Apple Worldwide Developer Relations
Common Name (eg, fully qualified host name) []: Apple Worldwide Developer Relations Certification Authority
Email Address []: your-email

You will then be asked for a challenge password, which you will need in the next step.

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:

Upload new CSR to download a .cer file from Apple, then convert to .p12, remember the password!

openssl x509 -inform DER -outform PEM -in <CERTIFICATE>.cer -out cert.pem
openssl pkcs12 -inkey myprivate.key -in cert.pem -export -out cert.p12

Now go to OneSignal and create a new app. Choose iOS as the platform first. Upload your new .p12 certificate, using the password I told you to remember.

onesignal onboarding

Use the App ID it gives you and add this key to your app .env file.

ONE_SIGNAL_KEY=<key>

Android

You need to create a new Firebase project here.

Then, on your OneSignal project, go to Settings > Platforms and select Google Android.

Check Settings > Cloud Messaging on your newly created Firebase project and copy the Server key and Sender ID over to OneSignal.