Unity SDK Setup

The Reteno Unity Plugin for Mobile Customer Engagement and Analytics solutions

Overview

Reteno is a lightweight Plugin for Unity platform that helps mobile teams integrate Reteno into their mobile apps. The server-side library makes it easy to call the Reteno API.

The SDK supports:
  • Unity 2021.3 or newer
  • iOS 12.0 or later
  • Android 8.0 or later (minSdk = 26)

Getting started with Reteno SDK / Setup guide

Install via Package Manager

Please follow the instructions:

  1. Open Edit/Project Settings/Package Manager.
Package Manager
  1. Add a new Scoped Registry (or edit the existing OpenUPM entry):
Package Manager
   Name: package.openupm.com
   URL: https://package.openupm.com
   Scope(s): com.reteno
  1. Click Save or Apply.
  2. Open Window/Package Manager and switch to My Registries via the Packages: dropdown menu. You will see all of the Reteno Unity SDK packages available on which you can then click Install for the platforms you would like to include. Dependencies will be added automatically.
My Registries

Now your Unity project is configured to use the specified package.

Step 2: Set up a Firebase Cloud Messaging client app with Unity

If you do not have Firebase project

If you do not have Firebase project yet, you will have to set it up.
We suggest following official setup guide .

If you already have Firebase project

If you already have Firebase project, you have to add Firebase configuration files to your Unity app:

  • For iOS — GoogleService-Info.plist.
  • For Android — google-services.json.
    They can be placed anywhere in Assets folder.

Also you have to download Firebase Unity SDK from Add Unity SDKs section in official setup guide page or by a direct link .

After this return to Unity and follow these steps:

  1. Click Assets → Import package → Custom package...
  2. Pick Firebase Unity SDK which you downloaded
  3. Choose FirebaseMessaging.unitypackage and import all assets from this package.

Initialization of RetenoSDK

We highly recommend to initialize RetenoSDK as soon as possible after the start of your application.
To initialize the SDK you need to retrieve an access key from Reteno admin panel.
In your C# script call RetenoSDK.Initialize(...) and pass the key as the parameter:

RetenoSDK.Initialize("your_access_key");

The Core RetenoSDK setup is done, now you can navigate to specific platform setup:

Requesting permission for receiving notifications

Since Android 13 you have to ask user for a permission if you want to send them push notifications. You can do it at the start of the application but it is considered a good tone to tell user why do we need a permission before actually asking for it.
You can ask a permission by calling a function from RetenoSDK or implement it yourself if you require some specific logic.

Using RetenoSDK function

RetenoSDK provides a function which will ask user a permission for receiving push notification and notify Reteno backend that user has granted a permission.

RetenoSDK.RequestPushPermission()

Using custom solution

If you want to ask a permission without using RetenoSDK function, you can do it. But after receiving a permission result, you have to notify RetenoSDK that status of permission might have changed. To do this, you have to call UpdatePushPermissionStatus function from RetenoSDK:

RetenoSDK.UpdatePushPermissionStatus();
Licence

Reteno Unity Plugin is released under the MIT license. See LICENSE for details.