Mobile SDK setup
How to set up your Mobile App with OneSignal.
Overview
The following guides will help you setup the OneSignal SDK in your mobile apps. For websites, see Web Setup.
For each platform your mobile app supports, will need to establish a connection with FCM (Android), APNS (iOS), HMS (Huawei), and/or AMD (Amazon). See the below options to configure your OneSignal App and Platform.
Configure your OneSignal app and platform
If your team already created an account with OneSignal, ask to be invited as an admin role so you can setup the app. Otherwise, sign up for a free account at onesignal.com to get started!
Details on configuring your OneSignal app (click to expand)
You can setup multiple platforms (iOS, Android, Web, Email, SMS) within the same OneSignal App under Settings > Platforms. If you want to create a new app select New App/Website. If this is your first OneSignal app, you will see the next page.
Name your app and organization something recognizable, then select the platform to setup. You can always set up more platforms in this OneSignal App later within Settings > Platforms.
Click Next: Configure Your Platform.
To configure your app, follow the prompts based on the platforms you support.
- Android: Set up your Android Firebase Credentials
- iOS: p8 Authentication Token or p12 Push Notification Certificate
- Amazon: Generate an Amazon API Key
- Huawei: Authorize OneSignal to send Huawei Push
After you setup your credentials, click Save & Continue.
Choose your Apps Target SDK, the click Save & Continue.
Finally, you will be directed to install the SDK and provided your OneSignal App ID. Make sure to save your App ID as you will need it later.
If you need a teammate or your developer to assist, you can click Invite them to the app and select Done when finished.
Continue through the documentation to finish adding OneSignal to your app.
Setup Guides
Native SDKs
Cross-platform SDKs
Integrations
FAQ
Are the SDKs required?
No, but they are highly recommended.
OneSignal provides the Create user, Create subscription, Update user, and Update subscription APIs for creating and updating user and subscription data along with the Create notification API sending push notifications, email, and SMS messages. The OneSignal SDK is required if you plan to use the In-App Messaging functionality.
Server API-only integrations are possible but not recommended because push notifications have several different requirements that our SDK handles for you, including:
- obtaining push tokens across Android, iOS, Huawei, and Web Browsers
- verifying subscription status, prompting, and opting-in users
- displaying the notification and handling the payload
For example, the APNS push payload has a standardized format but FCM does not. Setting up both would need additional dev work to handle notifications client side. OneSignal's Push Payload contains a "custom"
key with a nested "i"
value when sent through our system. Our SDK checks this value to handle the push notification. See OneSignal's Custom Push Payload here and our article on Build vs Buy for more details.
Updated 2 months ago