macOS app setup
Instructions for adding OneSignal to your macOS app
Requirements
- Configured 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
Option 1: Mac Catalyst
If you built your app with Mac Catalyst, you can setup OneSignal's XCFramework SDK.
More details in this guide on our blog.
Option 2: API
OneSignal does not currently have a dedicated macOS SDK. However, OneSignal can be used to send notifications to macOS apps. Please refer to Apple's documentation to learn how to obtain a push token.
To register a macOS device, call our Create user endpoint with a subscription type
of macOSPush
to represent the macOS platform, and pass in the push token for the token
parameter.
Updating user events
With the Create user or Update user APIs you can set your own custom alias or external_id
and update user data.
Send messages
You can send push notifications using the OneSignal dashboard or Create notification API. More details, see Sending Push Messages.
Updated 7 days ago