Reteno Unity Plugin Documentation
Introduction
The Reteno Unity Plugin is a powerful tool for mobile customer engagement and analytics, designed to streamline the integration of Reteno's API into Unity applications. With support for both Android and iOS, the plugin provides robust features such as automatic screen reporting, in-app messaging, and push notifications. This documentation will guide you through setup, configuration, and feature-specific instructions, ensuring a smooth experience for developers.
Contents
- Quick Setup
- Core Features and Modules
- Platform-Specific Configuration
- Usage Examples
- Troubleshooting & FAQ
- Example Project
- Licensing
Quick Setup
The SDK supports:
- Unity 2021.3 or newer
- iOS 12.0 or later
- Android 8.0 or later (minSdk = 26)
Installing Reteno SDK via Unity Package Manager
- Open Unity and navigate to
Edit > Project Settings > Package Manager
. - Add a new Scoped Registry for
Reteno
:- Name:
package.openupm.com
- URL:
https://package.openupm.com
- Scope:
com.reteno
- Name:
- Click Save and then open
Window > Package Manager
. - Switch to My Registries and install the Reteno Unity SDK for your desired platforms.
Firebase Cloud Messaging Setup (Optional)
For notifications, you need a Firebase project:
- If you don’t have a Firebase project, set it up.
- Add
GoogleService-Info.plist
(iOS) orgoogle-services.json
(Android) to your Unity project. - Import the Firebase Unity SDK and integrate the FirebaseMessaging.unitypackage.
Core Features and Modules
Initialization
Initialize the Reteno SDK as early as possible in your app’s lifecycle. Use the following code in a C# script:
RetenoSDK.Initialize("your_access_key");
Reteno Configuration Options
The RetenoConfiguration
class provides advanced setup options:
- Automatic Screen Reporting:
IsAutomaticScreenReportingEnabled
- App Lifecycle Reporting:
IsAutomaticAppLifecycleReportingEnabled
- Push Subscription Reporting:
IsAutomaticPushSubscriptionReportingEnabled
- Session Reporting:
IsAutomaticSessionReportingEnabled
- Debug Mode:
IsDebugMode
Each option can be configured for tailored analytics and engagement.
Notifications Module
Manage push notifications with the NotificationsManager
:
- Request Push Permissions: Prompts the user for permission to receive push notifications.
- Update Push Status: Use
UpdatePushPermissionStatus
to sync permissions with Reteno.
User Management
The UserManager
module handles user data and permissions:
- User Identification:
UserId
- Setting Attributes:
SetUserAttributes
for registered users, andSetAnonymousUserAttributes
for anonymous users.
In-App Messages
Configure in-app message behavior with the InAppMessagesManager
:
- Pause Messages: Temporarily stop in-app messaging with
PauseInAppMessages
. - Custom Data Events: Use
CustomData
to capture in-app message data.
Event Management
Track custom events and screen views with the EventManager
:
EventManager.LogEvent(customEvent);
EventManager.LogScreenView("screenName");
Debugging Tools
Use SDKDebug
for detailed logging:
SDKDebug.Info("message")
SDKDebug.Warn("message")
SDKDebug.Error("message")
Platform-Specific Configuration
Android Setup
Android - more detailed.
- Navigate to
Edit > Project Settings > Player > Android
. - Enable:
- Custom Main Gradle Template
- Custom Gradle Properties Template
- Resolve dependencies with
Assets > External Dependency Manager > Android Resolver > Force Resolve
.
iOS Setup
iOS - more detailed.
After building in Unity and opening the Xcode workspace:
- Select
Unity-iPhone
> Signing & Capabilities. - Enable "Automatically manage signing" and select your Team.
- Enable "App Groups" under NotificationServiceExtension.
Usage Examples
- Initializing Reteno SDK
RetenoSDK.Initialize("your_access_key");
- Requesting Push Permission
NotificationsManager.RequestPush( onPermissionGranted: () => Debug.Log("Permission granted"), onPermissionDenied: () => Debug.Log("Permission denied") );
Troubleshooting & FAQ
Common Issues
- Firebase Configuration Not Found: Ensure
GoogleService-Info.plist
orgoogle-services.json
is in the correct location. - Push Permission Denied: Verify user settings and permission requests.
Example Project
The com.reteno.example
project demonstrates basic usage, providing code samples and scenarios for integrating Reteno’s features.
Licensing
Reteno Unity Plugin is released under the MIT license. See LICENSE for details.