The deltaDNA platform lets you send push notification messages to users.

This topic explains how to enable push notifications for Android devices.

Prerequisites

  • Your game is set up to receive events on the deltaDNA platform
  • You have integrated the deltaDNA Unity SDK into your application
  • *If you are an existing firebase user and have any version of firebase integrated please refer to the below:
    • Google recommends having a separate project for different firebase integrations. More information can be found here
    • Although you may already have a firebase project please proceed with the steps below in creating a new one.
    • Use the new firebase project for DeltaDNA push notifications leaving your old firebase project for existing firebase integrations.

Enabling push notifications for Android

  1. Create a Firebase account https://firebase.google.com/.
    1. In the Firebase console https://console.firebase.google.com/, add a new project.
    2. In the Project Overview, select Project settings. In the Project settings, you can find:
      • the App ID (in the General tab)
      • the Sender ID and the Server key (in the Cloud Messaging tab)
      • the Project ID (in the General tab)
      • the Web API key (in the General tab)
      • the Server key (in the Cloud Messaging tab)
  2. In the Unity Editor menu, select deltaDNA > Configure to open the deltaDNA Configuration window.
    1. Go to the Android Notifications section.
    2. In the Application ID field, enter the App ID from Firebase.
    3. In the Sender ID field, enter the Sender ID from Firebase.
    4. In the Project ID field, enter the Project ID from Firebase.
    5. In the Firebase API key, enter the Web API key from Firebase.
    6. Click Apply.

  3. In the script file where you’ve implemented the ‘StartSDK’ method, enter this line of code after your ‘StartSDK’ method:
    DDNA.Instance.AndroidNotifications.RegisterForPushNotifications();
  4. In the DeltaDNA platform, go to Setup > Manage Identity.
    1. Click the Android tab.
    2. In the Google API Key field, enter the  Server Key from Firebase.
    3. Click Save.
  5. Build an Android target for your application.
    1. Deploy the build to your Android device.

The event browser now displays the notificationServices event.

Once the Google Registration ID has connected to the userID, check that push notifications are working successfully.

Testing push notifications

To check if push notifications are working correctly:

  1. Go to Setup > Message Test Tool.
  2. Set the Notification type to Android.
  3. In the Google Registration ID field, select the Lookup button.
    1. Enter the userID. This automatically brings up the Google Registration ID.
  4. In the Message Body field, enter a message to send to the device.
  5. Select Submit.

If notifications are correctly set up, you will receive a notification with the message you entered previously.

Continue below if you would like to setup an out of game campaign

Create an out of game campaign

  1. Create Actions here
  2. Campaigns creation reference can be found here