Push with OneSignal

First of all, you need to Download and Import the OneSignal Unity SDK. Feel free to use it as an alternative to implementing push notifications with your own server.

 Adding the required code 

In the first scene that is loaded when your game is opened add the following code to an object that is enabled in the scene. (You can create a new Script file or add it to an existing Script like your own GameController or TitlescreenController that you may have already created.)

using System.Collections.Generic;  
void Start () {
    OneSignal.Init("b49e69ca-d0b8-11e3-97bf-c3d1433e8bc1", "703322744261", HandleNotification);
// Gets called when the player opens the notification.
private static void HandleNotification(string message, Dictionary<string, object> additionalData, bool isActive) {

Update OneSignal.Init(...) 1st parameter with your OneSignal App Id and the 2nd with your Google Project number(put null if your game isn't for Android).



  • Build from Unity and open the Xcode project.

  • Enable "Background Modes" and check "Remote notifications" under Capabilities on the "Unity-iphone" target.

Optional custom notification sounds

Place your notification sounds anywhere in your Unity project. Build from Unity and open the XCode project. Drag and drop the custom notification sounds you want into the root of the XCode project.

Unlike Android custom sounds while sending a notification with a custom sound through onesignal.com, make sure to include the file extension.


The official OneSignal documentation can be found here.

If you have no OneSignal applications added to your account on OneSignal, you should create one and Generating an iOS Push Certificate.