Engagement.unitypackage
into your Unity projectEngagementPlugin/EngagementConfiguration.cs
with your credentialsThe configuration of your application is performed via an EngagementConfiguration
class located in the EngagementPlugin/
directory.
WINDOWS_CONNECTION_STRING
: the Windows connection string (to retrieve from the Engagement portal)
ANDROID_CONNECTION_STRING
: the Android connection string (to retrieve from the Engagement portal)ANDROID_UNITY3D_ACTIVITY
: needs to be filled if your application does not use the default Unity Activity (com.unity3d.player.UnityPlayerActivity
)IOS_CONNECTION_STRING
: the iOS connection string (to retrieve from the Engagement portal)IOS_DISABLE_IDFA
: true
|false
: to disable the IDFA integration on iOSENABLE_PLUGIN_LOG
: true
|false
, enable the plugin debug logsENABLE_NATIVE_LOG
: true
|false
, enable the Engagement native SDK to debug logstrue
while working on the plugin integration.LOCATION_REPORTING_TYPE
: Can be one of the following (please refer to the Native SDK documentation for more information)
LocationReportingType.NONE
LocationReportingType.LAZY
LocationReportingType.REALTIME
LocationReportingType.FINEREALTIME
LOCATION_REPORTING_MODE
: Can be one of the following (please refer to the Native SDK documentation for more information)
LocationReportingMode.NONE
LocationReportingMode.FOREGROUND
LocationReportingMode.BACKGROUND
ENABLE_REACH
: true
|false
, to enable the reach integration ACTION_URL_SCHEME
: the url scheme of your application when using redirect actions in your campaignIOS_REACH_ICON
: the path (relative to the Assets/ directory) of the icon to display reach notification on iOS. If not specified, the application icon will be usedANDROID_REACH_ICON
: the path (relative to the Assets/ directory) of the icon to display reach notification on Android. If not specified, the application icon will be usedANDROID_GOOGLE_PROJECT_NUMBER
: the project number used as the GCM (Google Cloud Messaging) sender IDEngagementPlugin/Editor/EngagementPostBuild.cs
to see how it works under the hood).To initialize the Engagement service, just call EngagementAgent.Initialize()
. No arguments are needed as the credentials are automatically retrieved from the EngagementConfiguration
class.
Basic initialization:
void Start () {
// initialize the application
EngagementAgent.Initialize ();
// start your first activity
EngagementAgent.StartActivity ("home");
}
To be able to receive pushes from your application, you need to call EngagementReach.initialize()
and define the 3 delegates (events) to be called when a push related event is received
StringDataPushReceived(string _category, string _body)
to receive text data pushBase64DataPushReceived(string _category, byte[] data, string _encodedbody)
to receive binary push (through byte[] and base64 encoded string)HandleURL(string _url)
when an application specific URL is triggered (from a push campaign for example)EngagementConfiguration.ENABLE_REACH
variableEngagementConfiguration.ACTION_URL_SCHEME
settingInitialization with push support :
void Start () {
// initialize the Engagement Agent
EngagementAgent.Initialize ();
// set the Events
EngagementReach.HandleURL += (string _push) => {
Debug.Log ("OnHandleURL " + _push);
};
EngagementReach.StringDataPushReceived += (string _category, string _body) => {
Debug.Log ("StringDataPushReceived category:" + _category + ", body:" + _body);
};
EngagementReach.Base64DataPushReceived += (string _category, byte[] _data, string _body) => {
Debug.Log ("Base64DataPushReceived category:" + _category);
};
// Activate the push notification support
EngagementReach.Initialize();
// start your first activity
EngagementAgent.StartActivity ("home");
}
EngagementAgent.Initialize
EngagementReach.Initialize
(see above)
EngagementAgent.StartActivity
EngagementAgent.EndActivity
EngagementAgent.StartJob
EngagementAgent.EndJob
EngagementAgent.SendJobEvent
EngagementAgent.SendJobError
EngagementAgent.SendEvent
EngagementAgent.SendError
EngagementAgent.SendSessionEvent
EngagementAgent.SendSessionError
EngagementAgent.SendAppInfo
(see the AZME documentation)EngagementAgent.SaveUserPreferences
EngagementAgent.RestoreUserPreferences
EngagementAgent.SetEnabled
EngagementAgent.GetStatus
A sample application is available in the sample
directory.
build-sample.sh
to create a new sample projectsample-project
opennedEngagementPlugin/EngagementConfiguration.cs
with your credentials (see the configuration section)The source code of the plugin are included in the src/
directory. To build the package, just execute the package.sh
script at the root of the SDK.
It only works on Mac OSX, with XCode, Unity and Android Studio installed.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.