├── src ├── Android │ ├── libEngagementUnity │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ └── strings.xml │ │ │ │ ├── drawable │ │ │ │ │ ├── engagement_close.png │ │ │ │ │ └── engagement_content_title.xml │ │ │ │ └── layout │ │ │ │ │ ├── engagement_loading.xml │ │ │ │ │ ├── engagement_poll_choice.xml │ │ │ │ │ ├── engagement_notification_overlay.xml │ │ │ │ │ ├── engagement_poll_question.xml │ │ │ │ │ ├── engagement_content_title.xml │ │ │ │ │ ├── engagement_web_announcement.xml │ │ │ │ │ ├── engagement_text_announcement.xml │ │ │ │ │ ├── engagement_button_bar.xml │ │ │ │ │ ├── engagement_poll.xml │ │ │ │ │ └── engagement_notification_area.xml │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── azure │ │ │ │ └── engagement │ │ │ │ ├── shared │ │ │ │ ├── EngagementDelegate.java │ │ │ │ └── EngagementDataPushReceiver.java │ │ │ │ └── unity │ │ │ │ └── IntentCatcherActivity.java │ │ ├── libs │ │ │ ├── unity-classes.jar │ │ │ └── mobile-engagement-4.3.1.jar │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── settings.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── ios │ ├── EngagementReach │ │ ├── libreach.a │ │ ├── res │ │ │ ├── close.png │ │ │ ├── AEDefaultPollView.xib │ │ │ ├── AEDefaultAnnouncementView.xib │ │ │ └── AENotificationView.xib │ │ └── Headers │ │ │ ├── AEReachAbstractAnnouncement.h │ │ │ ├── AEReachNotifAnnouncement.h │ │ │ ├── AEDefaultPollViewController.h │ │ │ ├── AEPollViewController.h │ │ │ ├── AENotifier.h │ │ │ ├── AEReachPoll.h │ │ │ ├── AEAutorotateView.h │ │ │ ├── AEDefaultAnnouncementViewController.h │ │ │ ├── AEAnnouncementViewController.h │ │ │ ├── AEReachDataPushDelegate.h │ │ │ ├── AENotificationView.h │ │ │ ├── AEViewControllerUtil.h │ │ │ ├── AEReachPollQuestion.h │ │ │ ├── AEReachAnnouncement.h │ │ │ ├── AEReachDataPush.h │ │ │ ├── AEContentViewController.h │ │ │ ├── AEWebAnnouncementJsBridge.h │ │ │ ├── AEInteractiveContent.h │ │ │ ├── AEReachContent.h │ │ │ ├── AEReachModule.h │ │ │ └── AEDefaultNotifier.h │ ├── EngagementSDK │ │ ├── libengagement.a │ │ ├── Headers │ │ │ ├── AEPushMessage.h │ │ │ ├── EngagementViewController.h │ │ │ ├── EngagementTableViewController.h │ │ │ ├── AEUserNotificationHandler.h │ │ │ ├── AEModule.h │ │ │ └── AEStorage.h │ │ └── Classes │ │ │ ├── AEIdfaProvider.h │ │ │ └── AEIdfaProvider.m │ ├── EngagementUnity.xcodeproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── src │ │ ├── EngagementUnity.h │ │ └── EngagementShared.h └── EngagementPlugin │ ├── WSA │ ├── Resources.zip │ ├── Microsoft.Azure.Engagement.EngagementAgent.Portable.dll │ ├── Microsoft.Azure.Engagement.EngagementAgent.Universal.dll │ ├── Microsoft.Azure.Engagement.EngagementReach.Portable.dll │ ├── Microsoft.Azure.Engagement.EngagementReach.Universal.dll │ ├── Resources.zip.meta │ ├── Microsoft.Azure.Engagement.EngagementAgent.Portable.dll.meta │ ├── Microsoft.Azure.Engagement.EngagementAgent.Universal.dll.meta │ ├── Microsoft.Azure.Engagement.EngagementReach.Portable.dll.meta │ └── Microsoft.Azure.Engagement.EngagementReach.Universal.dll.meta │ ├── Editor │ ├── Ionic.Zip.dll │ ├── engagement_notification_icon.zip │ ├── engagement_notification_icon.zip.meta │ ├── EngagementPostBuild.cs.meta │ └── Ionic.Zip.dll.meta │ ├── WSA.meta │ ├── iOS.meta │ ├── Android.meta │ ├── Editor.meta │ ├── Scripts.meta │ ├── iOS │ ├── res.meta │ ├── AEIdfaProvider.h.meta │ ├── libEngagementUnity.a.meta │ ├── AEIdfaProvider.m.meta │ ├── EngagementNotifications.m.meta │ ├── res │ │ ├── AEDefaultPollView.xib.meta │ │ ├── AENotificationView.xib.meta │ │ ├── AEDefaultAnnouncementView.xib.meta │ │ └── close.png.meta │ ├── AEIdfaProvider.h │ ├── AEIdfaProvider.m │ └── EngagementNotifications.m │ ├── Scripts │ ├── Lib.meta │ ├── Lib │ │ └── MiniJSON.cs.meta │ ├── EngagementAgent.cs.meta │ ├── EngagementReach.cs.meta │ ├── EngagementWrapper.cs.meta │ ├── EngagementReach.cs │ └── EngagementWrapper.cs │ ├── EngagementConfiguration.cs.meta │ ├── Azure Mobile Engagement iOS SDK license.txt │ ├── Azure Mobile Engagement Android SDK license.txt │ ├── EngagementConfiguration.cs │ └── ThirdPartyNotices.txt ├── Engagement.unitypackage ├── .gitignore ├── sample ├── build-sample.sh ├── SampleSetup.cs └── Sample.cs ├── Azure Mobile Engagement iOS SDK license.txt ├── Azure Mobile Engagement Android SDK license.txt ├── licence.txt ├── package.sh ├── SECURITY.md ├── ThirdPartyNotices.txt └── README.md /src/Android/libEngagementUnity/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /src/Android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':libEngagementUnity' 2 | -------------------------------------------------------------------------------- /Engagement.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/Engagement.unitypackage -------------------------------------------------------------------------------- /src/ios/EngagementReach/libreach.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/ios/EngagementReach/libreach.a -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Resources.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/WSA/Resources.zip -------------------------------------------------------------------------------- /src/ios/EngagementReach/res/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/ios/EngagementReach/res/close.png -------------------------------------------------------------------------------- /src/ios/EngagementSDK/libengagement.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/ios/EngagementSDK/libengagement.a -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LibAZMEUnity 3 | 4 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Editor/Ionic.Zip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/Editor/Ionic.Zip.dll -------------------------------------------------------------------------------- /src/Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/libs/unity-classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/Android/libEngagementUnity/libs/unity-classes.jar -------------------------------------------------------------------------------- /src/EngagementPlugin/Editor/engagement_notification_icon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/Editor/engagement_notification_icon.zip -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/libs/mobile-engagement-4.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/Android/libEngagementUnity/libs/mobile-engagement-4.3.1.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | local.properties 3 | *.iml 4 | **/.idea/ 5 | **/.idea/** 6 | **/xcuserdata/ 7 | .DS_Store 8 | build/ 9 | captures/ 10 | engagement-project/ 11 | ~build/ 12 | sample/SampleProject/ -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/drawable/engagement_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/Android/libEngagementUnity/src/main/res/drawable/engagement_close.png -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementAgent.Portable.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementAgent.Portable.dll -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementAgent.Universal.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementAgent.Universal.dll -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementReach.Portable.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementReach.Portable.dll -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementReach.Universal.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/azure-mobile-engagement-unity/HEAD/src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementReach.Universal.dll -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Resources.zip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2edef1e3160c50745a5c735194a6fc90 3 | timeCreated: 1457039599 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8a9573301d438f4dab2e6c73e8a0cb2 3 | folderAsset: yes 4 | timeCreated: 1456401057 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a01d7f6091cb4e98bfa452cb660e48f 3 | folderAsset: yes 4 | timeCreated: 1447678557 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10991c71f63854cca8b72f93ae9a36eb 3 | folderAsset: yes 4 | timeCreated: 1447678557 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bb3252f7a72d43b094e1fb58c6b2e2d 3 | folderAsset: yes 4 | timeCreated: 1447740762 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Editor/engagement_notification_icon.zip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ef693fca247b46369ecded71e0528b2 3 | timeCreated: 1450536409 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cea2edd8889464ca0bbfcea94e964a03 3 | folderAsset: yes 4 | timeCreated: 1459281971 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/res.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8d40ff4de581496d9fe657b199c4ca1 3 | folderAsset: yes 4 | timeCreated: 1449063468 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts/Lib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3e849a6519f94d09822fe0afbeeaeae 3 | folderAsset: yes 4 | timeCreated: 1451413795 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 25 15:28:17 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip 7 | -------------------------------------------------------------------------------- /src/ios/EngagementUnity.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts/Lib/MiniJSON.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dddcdfc10fe074907ba122689b3b8c3e 3 | timeCreated: 1451413795 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/EngagementPlugin/EngagementConfiguration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b893f2bb2c8904a328600cca9ac3f1bd 3 | timeCreated: 1451413795 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts/EngagementAgent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee540bf6759b94a6188115ff912ae545 3 | timeCreated: 1451413798 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts/EngagementReach.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ab1f364313ae714da78215ac2d21453 3 | timeCreated: 1455263808 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts/EngagementWrapper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12fb29933623747fca9c19dc0f8b6886 3 | timeCreated: 1451413795 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Editor/EngagementPostBuild.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91901459b9eb6409c919beae6fffa989 3 | timeCreated: 1450518446 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/AEIdfaProvider.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 887feca3f68fd49c5947c74979c4fa0b 3 | timeCreated: 1451063230 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | userData: 19 | assetBundleName: 20 | assetBundleVariant: 21 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/libEngagementUnity.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 896d9717b92d6496e811a9c02b565b1e 3 | timeCreated: 1479504216 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | userData: 19 | assetBundleName: 20 | assetBundleVariant: 21 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/java/com/microsoft/azure/engagement/shared/EngagementDelegate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT license. See License.txt in the project root for license information. 4 | */ 5 | 6 | package com.microsoft.azure.engagement.shared; 7 | 8 | import org.json.JSONObject; 9 | 10 | public class EngagementDelegate { 11 | public void onGetStatusResult(JSONObject _result) {}; 12 | public void didReceiveDataPush(JSONObject _data ) {}; 13 | } -------------------------------------------------------------------------------- /src/Android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Editor/Ionic.Zip.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7684861381ae4b3aa50f0ba960c66f3 3 | timeCreated: 1449757491 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /sample/build-sample.sh: -------------------------------------------------------------------------------- 1 | PROJECTNAME=SampleProject 2 | UNITY=/Applications/Unity/Unity.app/Contents/MacOS/Unity 3 | PROJECTPATH=$PWD/$PROJECTNAME 4 | AZMEPACKAGEPATH=$PWD/../Engagement.unitypackage 5 | 6 | rm -rf $PROJECTNAME 7 | $UNITY -batchmode -quit -createProject $PROJECTNAME 8 | $UNITY -batchmode -quit -projectPath $PROJECTPATH -importPackage $AZMEPACKAGEPATH 9 | 10 | ASSETSPATH="$PROJECTNAME/Assets" 11 | EDITORPATH="$ASSETSPATH/Editor" 12 | mkdir $EDITORPATH 13 | 14 | cp Sample.cs $ASSETSPATH 15 | cp SampleSetup.cs $EDITORPATH 16 | 17 | $UNITY -projectPath $PROJECTPATH -executeMethod SampleSetup.CreateSampleScene & -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/AEIdfaProvider.m.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5d1efbd9a91f430499e2068b35a2786 3 | timeCreated: 1451063230 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | iOS: 19 | enabled: 1 20 | settings: {} 21 | tvOS: 22 | enabled: 1 23 | settings: {} 24 | userData: 25 | assetBundleName: 26 | assetBundleVariant: 27 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/EngagementNotifications.m.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a73a3efe742d4c438607445c4fac64c 3 | timeCreated: 1450537501 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | iOS: 19 | enabled: 1 20 | settings: {} 21 | tvOS: 22 | enabled: 1 23 | settings: {} 24 | userData: 25 | assetBundleName: 26 | assetBundleVariant: 27 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/res/AEDefaultPollView.xib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75b66adc109a84c07a0f3b821133bc2d 3 | timeCreated: 1450461354 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | iOS: 19 | enabled: 1 20 | settings: {} 21 | tvOS: 22 | enabled: 1 23 | settings: {} 24 | userData: 25 | assetBundleName: 26 | assetBundleVariant: 27 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/res/AENotificationView.xib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55ee99498e2654b3a9e870a49877e520 3 | timeCreated: 1450461354 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | iOS: 19 | enabled: 1 20 | settings: {} 21 | tvOS: 22 | enabled: 1 23 | settings: {} 24 | userData: 25 | assetBundleName: 26 | assetBundleVariant: 27 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/res/AEDefaultAnnouncementView.xib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 172744131054d4d3896cc1661a792028 3 | timeCreated: 1450461354 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | iOS: 19 | enabled: 1 20 | settings: {} 21 | tvOS: 22 | enabled: 1 23 | settings: {} 24 | userData: 25 | assetBundleName: 26 | assetBundleVariant: 27 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/olivier/Tools/adt-bundle/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /sample/SampleSetup.cs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT license. See License.txt in the project root for license information. 5 | */ 6 | 7 | using UnityEngine; 8 | using UnityEditor; 9 | using System.Collections; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | 13 | public class SampleSetup 14 | { 15 | 16 | static void CreateSampleScene () 17 | { 18 | EditorApplication.NewEmptyScene (); 19 | new GameObject("EngagementCamera").AddComponent(); 20 | GameObject go = new GameObject("EngagementSample"); 21 | go.AddComponent(); 22 | string sn = "Assets/SampleScene.unity"; 23 | EditorApplication.SaveScene (sn); 24 | var sceneToAdd = new EditorBuildSettingsScene(sn, true); 25 | EditorBuildSettings.scenes = new EditorBuildSettingsScene[1]{sceneToAdd}; 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/ios/EngagementSDK/Headers/AEPushMessage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | 7 | /** 8 | * A `AEPushMessage` object represents a Engagement push message. 9 | * 10 | * Engagement push messages are passed through Engagement agent to modules. 11 | * 12 | * **See also** 13 | * 14 | * - 15 | */ 16 | @interface AEPushMessage : NSObject 17 | 18 | /** Message's identifier */ 19 | @property(nonatomic, retain) NSString* messageId; 20 | 21 | /** Reach values */ 22 | @property(nonatomic, retain) NSDictionary* reachValues; 23 | 24 | /** Message's payload */ 25 | @property(nonatomic, retain) NSDictionary* payload; 26 | 27 | /** 28 | * Parse payload data. 29 | * @param payloadData in NSData format. 30 | * @return Parsing error. 31 | */ 32 | - (NSError*)parseJsonPayload:(NSData*)payloadData; 33 | 34 | @end -------------------------------------------------------------------------------- /src/Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachAbstractAnnouncement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import "AEInteractiveContent.h" 7 | 8 | /** Announcement kind */ 9 | static NSString* const kAEAnnouncementKind = @"a"; 10 | 11 | /** 12 | * The `AEReachAbstractAnnouncement` is a base class for all kind of announcements. 13 | */ 14 | @interface AEReachAbstractAnnouncement : AEInteractiveContent 15 | { 16 | } 17 | 18 | /** 19 | * Initialize an abstract announcement. Should only be called by subclasses. 20 | * @param reachValues Parsed JSON reach values. 21 | * @param params special parameters to replace in the action URL. 22 | * @result An initialized abstract announcement or nil if it couldn't be parsed. 23 | */ 24 | - (id)initWithReachValues:(NSDictionary*)reachValues params:(NSDictionary*)params; 25 | 26 | /** URL to launch as an action */ 27 | @property(nonatomic, retain) NSString* actionURL; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.0" 6 | 7 | defaultConfig { 8 | minSdkVersion 10 9 | targetSdkVersion 26 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 16 | } 17 | } 18 | 19 | lintOptions { 20 | // to disable error in engagement_web_announcement.xml: 21 | disable 'WebViewLayout' 22 | } 23 | } 24 | 25 | android.libraryVariants.all { variant -> 26 | variant.outputs.each { output -> 27 | output.packageLibrary.exclude('libs/unity-classes.jar') 28 | } 29 | } 30 | 31 | repositories { 32 | flatDir { 33 | dirs 'res' 34 | } 35 | } 36 | 37 | dependencies { 38 | compile fileTree(dir: 'libs', include: ['*.jar']) 39 | testCompile 'junit:junit:4.12' 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/ios/EngagementSDK/Headers/EngagementViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | /** 9 | * Helper class used to replace iOS's `UIViewController` class. 10 | */ 11 | @interface EngagementViewController : UIViewController { 12 | 13 | } 14 | 15 | /** 16 | * Override this to specify the name reported by your activity. The default implementation returns 17 | * the simple name of the class and removes the "ViewController" suffix if any (e.g. 18 | * "Tab1ViewController" -> "Tab1"). 19 | * @result the activity name reported by the Engagement service. 20 | */ 21 | - (NSString*)engagementActivityName; 22 | 23 | /** 24 | * Override this to attach extra information to your activity. The default implementation attaches 25 | * no extra information (i.e. return nil). 26 | * @result activity extra information, nil if no extra. 27 | */ 28 | - (NSDictionary*)engagementActivityExtra; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachNotifAnnouncement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import "AEReachAbstractAnnouncement.h" 7 | 8 | /** 9 | * The `AEReachNotifAnnouncement` class defines objects that represent a Engagement _notification only_ announcement. 10 | * 11 | * This is a special announcement used when you just want to display the notification (application banner or apple 12 | * push). 13 | * When the user clicks on the notification, the action url is launched, and the announcement is acknownledged. 14 | */ 15 | @interface AEReachNotifAnnouncement : AEReachAbstractAnnouncement 16 | 17 | /** 18 | * Parse a notif announcement 19 | * @param reachValues Parsed reach values. 20 | * @param params special parameters to replace in the action URL. 21 | * @result A new notif announcement or nil if it couldn't be parsed. 22 | */ 23 | + (id)notifAnnouncementWithReachValues:(NSDictionary*)reachValues params:(NSDictionary*)params; 24 | 25 | @end -------------------------------------------------------------------------------- /src/ios/EngagementSDK/Headers/EngagementTableViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | /** 9 | * Helper class used to replace iOS's `UITableViewController` class. 10 | */ 11 | @interface EngagementTableViewController : UITableViewController { 12 | 13 | } 14 | 15 | /** 16 | * Override this to specify the name reported by your activity. The default implementation returns 17 | * the simple name of the class and removes the "ViewController" suffix if any (e.g. 18 | * "Tab1ViewController" -> "Tab1"). 19 | * @result the activity name reported by the Engagement service. 20 | */ 21 | - (NSString*)engagementActivityName; 22 | 23 | /** 24 | * Override this to attach extra information to your activity. The default implementation attaches 25 | * no extra information (i.e. return nil). 26 | * @result activity extra information, nil if no extra. 27 | */ 28 | - (NSDictionary*)engagementActivityExtra; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Azure Mobile Engagement iOS SDK license.txt: -------------------------------------------------------------------------------- 1 | Azure Mobile Engagement iOS SDK 2 | Copyright (c) Microsoft Corporation 3 | All rights reserved. 4 | MIT License 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Azure Mobile Engagement Android SDK license.txt: -------------------------------------------------------------------------------- 1 | Azure Mobile Engagement Android SDK 2 | Copyright (c) Microsoft Corporation 3 | All rights reserved. 4 | MIT License 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /licence.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/EngagementPlugin/Azure Mobile Engagement iOS SDK license.txt: -------------------------------------------------------------------------------- 1 | Azure Mobile Engagement iOS SDK 2 | Copyright (c) Microsoft Corporation 3 | All rights reserved. 4 | MIT License 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Azure Mobile Engagement Android SDK license.txt: -------------------------------------------------------------------------------- 1 | Azure Mobile Engagement Android SDK 2 | Copyright (c) Microsoft Corporation 3 | All rights reserved. 4 | MIT License 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEDefaultPollViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | #import "AEPollViewController.h" 8 | 9 | @class AEReachPoll; 10 | 11 | 12 | /** 13 | * Default implementation of . 14 | * 15 | * This view controller display a poll using layout view named `AEDefaultPollView.xib`.
16 | * You can change the xib file to your needs as long as you keep view identifier and types. 17 | */ 18 | @interface AEDefaultPollViewController : AEPollViewController { 19 | @private 20 | BOOL _hasBody; 21 | NSMutableDictionary* _selectedChoices; 22 | } 23 | 24 | /** Submit's button */ 25 | @property(nonatomic, retain) UIBarButtonItem* submitButton; 26 | 27 | /** Navigation bar displaying poll's title */ 28 | @property(nonatomic, retain) IBOutlet UINavigationBar* titleBar; 29 | 30 | /** Table view responsible for displaying questions and choices */ 31 | @property(nonatomic, retain) IBOutlet UITableView* tableView; 32 | 33 | /** Toolbar containing action and exit buttons */ 34 | @property(nonatomic, retain) IBOutlet UIToolbar* toolbar; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementAgent.Portable.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4546bd8055218be4788585bdc51adf36 3 | timeCreated: 1461179686 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | CPU: AnyCPU 18 | DefaultValueInitialized: true 19 | OS: AnyOS 20 | Linux: 21 | enabled: 0 22 | settings: 23 | CPU: x86 24 | Linux64: 25 | enabled: 0 26 | settings: 27 | CPU: x86_64 28 | OSXIntel: 29 | enabled: 0 30 | settings: 31 | CPU: AnyCPU 32 | OSXIntel64: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | Win: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | Win64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | WindowsStoreApps: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | DontProcess: True 49 | PlaceholderPath: 50 | SDK: AnySDK 51 | ScriptingBackend: AnyScriptingBackend 52 | userData: 53 | assetBundleName: 54 | assetBundleVariant: 55 | -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementAgent.Universal.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f20c5d326b96194899976c84e6f11b4 3 | timeCreated: 1461179685 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | CPU: AnyCPU 18 | DefaultValueInitialized: true 19 | OS: AnyOS 20 | Linux: 21 | enabled: 0 22 | settings: 23 | CPU: x86 24 | Linux64: 25 | enabled: 0 26 | settings: 27 | CPU: x86_64 28 | OSXIntel: 29 | enabled: 0 30 | settings: 31 | CPU: AnyCPU 32 | OSXIntel64: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | Win: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | Win64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | WindowsStoreApps: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | DontProcess: True 49 | PlaceholderPath: 50 | SDK: AnySDK 51 | ScriptingBackend: AnyScriptingBackend 52 | userData: 53 | assetBundleName: 54 | assetBundleVariant: 55 | -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementReach.Portable.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1de94610cdcba334a98c663d591cd0d3 3 | timeCreated: 1461179686 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | CPU: AnyCPU 18 | DefaultValueInitialized: true 19 | OS: AnyOS 20 | Linux: 21 | enabled: 0 22 | settings: 23 | CPU: x86 24 | Linux64: 25 | enabled: 0 26 | settings: 27 | CPU: x86_64 28 | OSXIntel: 29 | enabled: 0 30 | settings: 31 | CPU: AnyCPU 32 | OSXIntel64: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | Win: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | Win64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | WindowsStoreApps: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | DontProcess: True 49 | PlaceholderPath: 50 | SDK: AnySDK 51 | ScriptingBackend: AnyScriptingBackend 52 | userData: 53 | assetBundleName: 54 | assetBundleVariant: 55 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEPollViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import "AEContentViewController.h" 6 | 7 | @class AEReachPoll; 8 | 9 | /** 10 | * Abstract view controller displaying a Engagement poll. 11 | * 12 | * By inheriting from this class you can create your own view controller to display polls. 13 | */ 14 | @interface AEPollViewController : AEContentViewController 15 | 16 | /** 17 | * Init the view controller with the given poll. 18 | * Subclasses should re-implement this method. 19 | * @param poll Poll to display 20 | */ 21 | - (instancetype)initWithPoll:(AEReachPoll*)poll; 22 | 23 | /** 24 | * Submit answers for the associated poll and dismiss this view controller.
25 | * Dictionary keys must be the question ids and values must be the associated choice ids. 26 | * Should be called by subclasses when the user clicks on the 'action' button associated to 27 | * the poll. 28 | * @param answers The poll answers to submit. 29 | */ 30 | - (void)submitAnswers:(NSDictionary*)answers; 31 | 32 | /** 33 | * Use this property to store poll information when the initWithPoll: 34 | * method is called. 35 | * Subclasses should also read this property to init their subviews. 36 | */ 37 | @property(nonatomic, retain) AEReachPoll* poll; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/AEIdfaProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | 7 | /** 8 | * Provider for the Apple IDFA. 9 | * 10 | * This class must be integrated into your project whether you want Engagement to collect the IDFA or not. By default, 11 | * this class will return the actual 12 | * advertising identifier (on iOS 6+) using the AdSupport framework. This can be disabled by adding the preprocessor 13 | * macro named `ENGAGEMENT_DISABLE_IDFA`. 14 | * 15 | */ 16 | @interface AEIdfaProvider : NSObject 17 | 18 | /** 19 | * The singleton instance of the IDFA provider. 20 | * 21 | * @return a shared instance of `AEIdfaProvider`. 22 | */ 23 | + (id)shared; 24 | 25 | /** 26 | * Check if IDFA reporting is enabled and ad tracking is enabled or not. 27 | * 28 | * @return A Boolean NSNumber that indicates whether the user has limited ad tracking or nil 29 | * if IDFA reporting is not enabled. 30 | */ 31 | - (NSNumber*)isIdfaEnabled; 32 | 33 | /* Return the identifier for advertisers or nil if not enabled/available. */ 34 | 35 | /** 36 | * Get the advertising identifier UUID value. 37 | * 38 | * @return the value of the advertising identifier or nil if ad tracking is disabled 39 | * or IDFA collection is disabled. 40 | */ 41 | - (NSString*)idfa; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AENotifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import "AEInteractiveContent.h" 7 | 8 | /** 9 | * Custom notifier specification. 10 | * 11 | * You can define how a content notification is done for a set of categories by implementing this 12 | * protocol and registering your instances by calling <[AEReachModule registerNotifier:forCategory:]>
13 | * It is recommended to extend the default implementation: which 14 | * performs most of the work and has convenient callbacks. 15 | */ 16 | @protocol AENotifier 17 | 18 | @required 19 | 20 | /** 21 | * Handle a notification for a content. 22 | * @param content content to be notified. 23 | * @result YES to accept the content, NO to postpone the content (like overlay disabled in a 24 | * specific context). 25 | */ 26 | - (BOOL)handleNotification:(AEInteractiveContent*)content; 27 | 28 | /** 29 | * Reach module needs to control notification appearance. 30 | * When this method is called the notifier should clear any displayed notification for the given category. 31 | * @param category the category to clear. This parameter can be ignored if the notifier handles only one kind of 32 | * category. 33 | */ 34 | - (void)clearNotification:(NSString*)category; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /src/EngagementPlugin/WSA/Microsoft.Azure.Engagement.EngagementReach.Universal.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e64dc91678a05f341bf65200c0f53b5e 3 | timeCreated: 1461179691 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | CPU: AnyCPU 18 | DefaultValueInitialized: true 19 | OS: AnyOS 20 | Linux: 21 | enabled: 0 22 | settings: 23 | CPU: x86 24 | Linux64: 25 | enabled: 0 26 | settings: 27 | CPU: x86_64 28 | OSXIntel: 29 | enabled: 0 30 | settings: 31 | CPU: AnyCPU 32 | OSXIntel64: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | Web: 37 | enabled: 0 38 | settings: {} 39 | Win: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | Win64: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | WindowsStoreApps: 48 | enabled: 1 49 | settings: 50 | CPU: AnyCPU 51 | DontProcess: True 52 | PlaceholderPath: 53 | SDK: AnySDK 54 | ScriptingBackend: AnyScriptingBackend 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /src/ios/EngagementSDK/Classes/AEIdfaProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | 7 | /** 8 | * Provider for the Apple IDFA. 9 | * 10 | * This class must be integrated into your project whether you want Engagement to collect the IDFA or not. By default, 11 | * this class will return the actual 12 | * advertising identifier (on iOS 6+) using the AdSupport framework. This can be disabled by adding the preprocessor 13 | * macro named `ENGAGEMENT_DISABLE_IDFA`. 14 | * 15 | */ 16 | @interface AEIdfaProvider : NSObject 17 | 18 | /** 19 | * The singleton instance of the IDFA provider. 20 | * 21 | * @return a shared instance of `AEIdfaProvider`. 22 | */ 23 | + (id)shared; 24 | 25 | /** 26 | * Check if IDFA reporting is enabled and ad tracking is enabled or not. 27 | * 28 | * @return A Boolean NSNumber that indicates whether the user has limited ad tracking or nil 29 | * if IDFA reporting is not enabled. 30 | */ 31 | - (NSNumber*)isIdfaEnabled; 32 | 33 | /* Return the identifier for advertisers or nil if not enabled/available. */ 34 | 35 | /** 36 | * Get the advertising identifier UUID value. 37 | * 38 | * @return the value of the advertising identifier or nil if ad tracking is disabled 39 | * or IDFA collection is disabled. 40 | */ 41 | - (NSString*)idfa; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachPoll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import "AEInteractiveContent.h" 7 | 8 | /** Announcement kind */ 9 | static NSString* const kAEPollKind = @"p"; 10 | 11 | /** 12 | * The `AEReachPoll` class defines objects that represent generic Engagement poll. 13 | * 14 | * You usually have to use this class when you implement your own poll 15 | * view controller. 16 | * 17 | * **See also** 18 | * 19 | * - 20 | */ 21 | @interface AEReachPoll : AEInteractiveContent { 22 | @private 23 | NSArray* _questions; 24 | NSMutableDictionary* _answers; 25 | } 26 | 27 | /** 28 | * Poll questions.
29 | * Contains objects. 30 | */ 31 | @property(readonly) NSArray* questions; 32 | 33 | /** 34 | * Parse a poll 35 | * @param reachValues Parsed reach values. 36 | * @result A new poll or nil if it couldn't be parsed. 37 | */ 38 | + (id)pollWithReachValues:(NSDictionary*)reachValues; 39 | 40 | /** 41 | * Fill answer for a given question. Answers are sent when calling <[AEReachContent actionContent]>. 42 | * @param qid Question id as specified in <[AEReachPollQuestion questionId]>. 43 | * @param cid Choice id as specified in <[AEReachPollChoice choiceId]>. 44 | * @see questions 45 | */ 46 | - (void)fillAnswerWithQuestionId:(NSString*)qid choiceId:(NSString*)cid; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/res/close.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd3f139f1a7d44101ae0623d6f9e6c94 3 | timeCreated: 1450461354 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEAutorotateView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | /** 9 | * A view intended to be presented on the current application window. 10 | * 11 | * Inside a window, only the first subview gets rotation events. To get around this problem, 12 | * this view listen to device orientation changes and resize + apply the proper transform on the view. 13 | * 14 | * This view can be used as a container to another view by using the initialization method 15 | * or it can be used as a replacement to the `UIView` class. 16 | */ 17 | @interface AEAutorotateView : UIView { 18 | @private 19 | UIView* _view; 20 | UIInterfaceOrientation _orientation; 21 | } 22 | 23 | /** 24 | * Initialize the view by using a child content. 25 | * This view will just be used as a wrapper to the provided view. 26 | * @param view The view to wrap. 27 | */ 28 | - (id)initWithContent:(UIView*)view; 29 | 30 | /** 31 | * Transform to apply on the view based on the current device orientation. 32 | * The default implementation will return an affine transformation matrix constructed from the provided orientation.
33 | * @param orientation Orientation that will be applied. 34 | * @result The new `CGAffineTransform` to apply on this view. 35 | */ 36 | - (CGAffineTransform)transformForOrientation:(UIInterfaceOrientation)orientation; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEDefaultAnnouncementViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import "AEAnnouncementViewController.h" 7 | #import "AEWebAnnouncementJsBridge.h" 8 | 9 | @class AEAnnouncementViewController; 10 | 11 | /** 12 | * Default implementation of AEAnnouncementViewController. 13 | * 14 | * This view controller display an announcement using layout view named `AEDefaultAnnouncementView.xib`.
15 | * You can change the xib file to your needs as long as you keep view identifier and types. 16 | * 17 | * This class is using the Javascript bridge AEWebAnnouncementJsBridge to perform actions when 18 | * a recognized Javascript function is called inside a web announcement. 19 | */ 20 | @interface AEDefaultAnnouncementViewController : AEAnnouncementViewController 21 | 22 | /** Navigation bar displaying announcement's title */ 23 | @property(nonatomic, retain) IBOutlet UINavigationBar* titleBar; 24 | 25 | /** Text announcement's content goes in this view. */ 26 | @property(nonatomic, retain) IBOutlet UITextView* textView; 27 | 28 | /** Web announcement's content goes in this view. */ 29 | @property(nonatomic, retain) IBOutlet UIWebView* webView; 30 | 31 | /** Toolbar containing action and exit buttons */ 32 | @property(nonatomic, retain) IBOutlet UIToolbar* toolbar; 33 | 34 | /** 35 | * Javascript bridge 36 | */ 37 | @property(nonatomic, retain) AEWebAnnouncementJsBridge* jsBridge; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_poll_choice.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEAnnouncementViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | #import "AEContentViewController.h" 8 | #import "AEReachAnnouncement.h" 9 | 10 | @class AEReachAnnouncement; 11 | 12 | /** 13 | * Abstract view controller displaying a Engagement announcement. 14 | * 15 | * By inheriting from this class you can create your own view controller to display announcements. 16 | * If you plan to display Web announcements using this controller, make sure to use an object of type 17 | * AEWebAnnouncementJsBridge 18 | * as a delegate to your `UIWebView`. 19 | */ 20 | @interface AEAnnouncementViewController : AEContentViewController 21 | 22 | /** 23 | * Init the view controller with the given announcement. 24 | * Subclasses should re-implement this method. 25 | * @param anAnnouncement Announcement to display 26 | */ 27 | - (instancetype)initWithAnnouncement:(AEReachAnnouncement*)anAnnouncement; 28 | 29 | /** 30 | * Report the announcement as actioned and dismiss this view controller. 31 | * Should be called by subclasses when the user clicks on the 'action' button associated to 32 | * the announcement. 33 | */ 34 | - (void)action; 35 | 36 | /** 37 | * Use this property to store announcement information when the 38 | * method is called. 39 | * Subclasses should also read this property to init their subviews. 40 | */ 41 | @property(nonatomic, retain) AEReachAnnouncement* announcement; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachDataPushDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | 7 | /** 8 | * The `AEReachDataPushDelegate` protocol defines methods a delegate of should implement to receive data 9 | * pushes. 10 | * 11 | * To process data push, you must implement method 12 | * if it's a file upload or a base64 data, otherwise you implement .
13 | * To use it in your application just call the method <[AEReachModule dataPushDelegate]> after module 14 | * initialization. 15 | */ 16 | @protocol AEReachDataPushDelegate 17 | 18 | @optional 19 | 20 | /** 21 | * This function is called when a datapush of type text has been received. 22 | * @param category short string describing your data to push 23 | * @param body Your content. 24 | * @result YES to acknowledge the content, NO to cancel. 25 | **/ 26 | - (BOOL)didReceiveStringDataPushWithCategory:(NSString*)category body:(NSString*)body; 27 | 28 | /** 29 | * This function is called when a datapush of type base64 has been received. 30 | * @param category short string describing your data to push 31 | * @param decodedBody Your base64 content decoded. 32 | * @param encodedBody Your base64 content encoded. 33 | * @result YES to acknowledge the content, NO to cancel. 34 | **/ 35 | - (BOOL)didReceiveBase64DataPushWithCategory:(NSString*)category decodedBody:(NSData*)decodedBody encodedBody:(NSString*) 36 | encodedBody; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_notification_overlay.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AENotificationView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | /** 9 | * A `AENotificationView` object represnts a view that is responsible for displaying reach notifications used by the 10 | * default notifier . 11 | * 12 | * This view is using the layout named `AEDefaultNotificationView.xib`. 13 | * You can change the xib file to your needs as long as you keep view identifier and types.
14 | * This class overrides the method `layoutSubviews` to move and resize subviews when some of them are hidden. 15 | */ 16 | @interface AENotificationView : UIView 17 | { 18 | @private 19 | UILabel* _titleView; 20 | UILabel* _messageView; 21 | UIImageView* _iconView; 22 | UIImageView* _imageView; 23 | UIButton* _notificationButton; 24 | UIButton* _closeButton; 25 | } 26 | 27 | /** Returns the title view of the notification. */ 28 | @property(nonatomic, readonly) UILabel* titleView; 29 | 30 | /** Returns the message view of the notification. */ 31 | @property(nonatomic, readonly) UILabel* messageView; 32 | 33 | /** Returns the icon view of the notification. */ 34 | @property(nonatomic, readonly) UIImageView* iconView; 35 | 36 | /** Returns the image view of the notification. */ 37 | @property(nonatomic, readonly) UIImageView* imageView; 38 | 39 | /** Returns the main button of the notification. */ 40 | @property(nonatomic, readonly) UIButton* notificationButton; 41 | 42 | /** Returns the close button of the notification. */ 43 | @property(nonatomic, readonly) UIButton* closeButton; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEViewControllerUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | /** 9 | * The `AEViewControllerUtil` provides utility methods to present and dismiss view controllers on screen. 10 | */ 11 | @interface AEViewControllerUtil : NSObject 12 | 13 | /** 14 | * Present the controller's view inside the key window using an optional vertical cover animation: 15 | * The view slides up from the bottom of the screen. 16 | * The given controller will be retained until method is called. 17 | * @param controller The view controller to present. 18 | * @param animated If YES, animates the view; otherwise, does not. 19 | */ 20 | + (void)presentViewController:(UIViewController*)controller animated:(BOOL)animated; 21 | 22 | /** 23 | * Dismiss the given view controller. Remove the view from it's parent using a vertical slide animation. 24 | * The controller is released. 25 | * @param controller The view controller to dismiss. 26 | * @see dismissViewController:animated: 27 | */ 28 | + (void)dismissViewController:(UIViewController*)controller; 29 | 30 | /** 31 | * Dismiss the given view controller. 32 | * The controller is released. 33 | * @param controller The view controller to dismiss 34 | * @param animated If YES, animates the view; otherwise, does not. 35 | * @see dismissViewController: 36 | */ 37 | + (void)dismissViewController:(UIViewController*)controller animated:(BOOL)animated; 38 | 39 | /** 40 | * Get an available window for this application. 41 | */ 42 | + (UIWindow*)availableWindow; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachPollQuestion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | 7 | /** 8 | * The `AEReachPollQuestion` class defines objects that represent poll's questions 9 | */ 10 | @interface AEReachPollQuestion : NSObject { 11 | @private 12 | NSString* _questionId; 13 | NSString* _title; 14 | NSArray* _choices; 15 | } 16 | 17 | /** 18 | * Create and return a poll's question. 19 | * @param qId The unique identifier for the quetion. 20 | * @param title The question's title. 21 | * @param choices The question's choices. 22 | */ 23 | - (id)initWithId:(NSString*)qId title:(NSString*)title choices:(NSArray*)choices; 24 | 25 | /** The unique question identifier */ 26 | @property(readonly) NSString* questionId; 27 | 28 | /** Localized question text */ 29 | @property(readonly) NSString* title; 30 | 31 | /** 32 | * Choices.
33 | * Contains objects 34 | */ 35 | @property(readonly) NSArray* choices; 36 | 37 | @end 38 | 39 | /** 40 | * The `AEReachPollQuestion` class defines objects that represent poll's choices 41 | */ 42 | @interface AEReachPollChoice : NSObject { 43 | @private 44 | NSString* _choiceId; 45 | NSString* _title; 46 | BOOL _isDefault; 47 | } 48 | 49 | /** 50 | * Create and return a question's choice. 51 | * @param cId The unique identifier for the choice. 52 | * @param title The choice's title. 53 | * @param isDefault Is this the default choice for the associated question. 54 | */ 55 | - (id)initWithId:(NSString*)cId title:(NSString*)title isDefault:(BOOL)isDefault; 56 | 57 | /** The unique choice identifier */ 58 | @property(readonly) NSString* choiceId; 59 | 60 | /** The localized choice text */ 61 | @property(readonly) NSString* title; 62 | 63 | /** YES if this choice is the default one for the associated question. */ 64 | @property(readonly) BOOL isDefault; 65 | @end 66 | -------------------------------------------------------------------------------- /sample/Sample.cs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT license. See License.txt in the project root for license information. 5 | */ 6 | 7 | using UnityEngine; 8 | using System.Collections; 9 | using System.Xml; 10 | using System.Xml.Schema; 11 | using System.IO; 12 | using System.Collections.Generic; 13 | using Microsoft.Azure.Engagement.Unity; 14 | 15 | public class Sample : MonoBehaviour 16 | { 17 | 18 | private string log = ""; 19 | private int maxLine = 0; 20 | 21 | void Start () 22 | { 23 | Display("Engagement Sample"); 24 | EngagementAgent.Initialize (); 25 | 26 | EngagementReach.HandleURL += (string _push) => { 27 | Display ("HandleURL " + _push); 28 | }; 29 | 30 | EngagementReach.StringDataPushReceived += (string _category, string _body) => { 31 | Display ("StringDataPushReceived category:" + _category ); 32 | }; 33 | 34 | EngagementReach.Base64DataPushReceived += (string _category, byte[] _data, string _body) => { 35 | Display("Base64DataPushReceived category:" + _category); 36 | }; 37 | EngagementReach.Initialize (); 38 | 39 | EngagementAgent.StartActivity ("home"); 40 | EngagementAgent.GetStatus (OnStatusReceived); 41 | } 42 | 43 | void OnStatusReceived(Dictionary _status) 44 | { 45 | Display ("deviceId:"+_status["deviceId"]); 46 | Display ("pluginVersion:"+_status["pluginVersion"]); 47 | Display ("nativeVersion:"+_status["nativeVersion"]); 48 | } 49 | 50 | public void Display(string str) 51 | { 52 | Debug.Log (str); 53 | 54 | maxLine++; 55 | if (maxLine == 6) { 56 | maxLine = 0; 57 | log = str; 58 | } 59 | else 60 | log = log +"\n"+str; 61 | 62 | } 63 | 64 | public void OnGUI() { 65 | GUIStyle myStyle = new GUIStyle(); 66 | myStyle.fontSize = 32; 67 | Rect r = new Rect ( Screen.width/4, Screen.height/4, Screen.width / 2, Screen.height / 2); 68 | GUI.Box(r,log,myStyle); 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachAnnouncement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import "AEReachAbstractAnnouncement.h" 7 | 8 | /** 9 | * Announcement's type. 10 | */ 11 | typedef NS_ENUM (NSInteger, AEAnnouncementType) 12 | { 13 | /** Unknwon announcement type */ 14 | AEAnnouncementTypeUnknown = -1, 15 | 16 | /** Announcement with a text plain content */ 17 | AEAnnouncementTypeText = 1, 18 | 19 | /** Announcement with an HTML content */ 20 | AEAnnouncementTypeHtml = 2 21 | }; 22 | 23 | /** 24 | * The `AEReachAnnouncement` class defines objects that represent generic Engagement announcements. 25 | * 26 | * You usually have to use this class when you implement your own 27 | * announcement view controller.
The Engagement Reach SDK will instantiate your view controller using 28 | * method <[AEAnnouncementViewController initWithAnnouncement:]>. 29 | */ 30 | @interface AEReachAnnouncement : AEReachAbstractAnnouncement { 31 | @private 32 | AEAnnouncementType _type; 33 | NSDictionary* _cachedParams; 34 | } 35 | 36 | /** 37 | * Parse an announcement 38 | * @param reachValues Parsed reach values. 39 | * @param params Special parameters to replace in the action URL and body of the announcement. 40 | * @result A new announcement or nil if it couldn't be parsed. 41 | */ 42 | + (id)announcementWithReachValues:(NSDictionary*)reachValues params:(NSDictionary*)params; 43 | 44 | /** 45 | * Get the mime type for this announcement. This is useful to interpret the text returned by 46 | * #body. 47 | * 48 | * Possible values are: 49 | * 50 | * - `AEAnnouncementTypeUnknown`: Unknown announcement type 51 | * - `AEAnnouncementTypeText`: A text announcement (associated mimetype is text/plain) 52 | * - `AEAnnouncementTypeHtml`: An HTML announcement (associated mimetype is text/html) 53 | */ 54 | @property(readonly) AEAnnouncementType type; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachDataPush.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import "AEReachContent.h" 6 | 7 | /** 8 | * Data push's type. 9 | */ 10 | typedef NS_ENUM (NSInteger, AEDatapushType) 11 | { 12 | /** Unknwon data-push type */ 13 | AEDatapushTypeUnknown = -1, 14 | 15 | /** Data-push with a text content */ 16 | AEDatapushTypeText = 1, 17 | 18 | /** Data-push with a base 64 encoded content */ 19 | AEDatapushTypeBase64 = 2 20 | }; 21 | 22 | /** Datapush kind */ 23 | static NSString* const kAEDatapushKind = @"d"; 24 | 25 | /** 26 | * The `AEReachDataPush` class defines objects that represent a generic reach content. 27 | */ 28 | @interface AEReachDataPush : AEReachContent 29 | { 30 | @private 31 | AEDatapushType _type; 32 | NSDictionary* _cachedParams; 33 | } 34 | 35 | /** 36 | * Parse an announcement 37 | * @param reachValues Parsed reach values. 38 | * @param params special parameters to replace in the body of the datapush. 39 | * @result A new announcement or nil if it couldn't be parsed. 40 | */ 41 | + (id)datapushWithReachValues:(NSDictionary*)reachValues params:(NSDictionary*)params; 42 | 43 | /** 44 | * Intialize data push. 45 | * @param reachValues Parsed reach values. 46 | * @param params special parameters to replace in the body of the datapush. 47 | * @result A new announcement or nil if it couldn't be parsed. 48 | */ 49 | - (id)initWithReachValues:(NSDictionary*)reachValues params:(NSDictionary*)params; 50 | 51 | /** 52 | * Get the type for this data push. 53 | * 54 | * Possible values are: 55 | * 56 | * - `AEDatapushTypeUnknown`: Unknown data push type 57 | * - `AEDatapushTypeText`: A text data push 58 | * - `AEDatapushTypeBase64`: A base 64 data push 59 | */ 60 | @property(readonly) AEDatapushType type; 61 | 62 | /** Get decoded body. Only apply on base 64 data pushes (return `nil` for other types). */ 63 | @property(readonly) NSData* decodedBody; 64 | 65 | @end -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_poll_question.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | 21 | 28 | 29 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEContentViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | @class AEInteractiveContent; 9 | 10 | /** 11 | * Abstract view controller used to display an announcement or a poll. 12 | */ 13 | @interface AEContentViewController : UIViewController 14 | 15 | /** 16 | * Return the displayed content. Subclasses must override this method. 17 | * @result The associated content. 18 | */ 19 | - (AEInteractiveContent*)content; 20 | 21 | /** 22 | * Report content as exited and dimiss this view controller. 23 | * Should be called by subclasses when the user clicks on the _exit_ button associated to 24 | * the announcement or poll. 25 | */ 26 | - (void)exit; 27 | 28 | /** 29 | * Load a button toolbar used by poll and announcement views. 30 | * @param toolbar The native toolbar to load. 31 | */ 32 | - (void)loadToolbar:(UIToolbar*)toolbar; 33 | 34 | /** 35 | * Method called when action button from a loaded toolbar has been clicked. 36 | * Sub-classes must re-implement this method. 37 | * @param sender The object that sent the action message. 38 | */ 39 | - (void)actionButtonClicked:(id)sender; 40 | 41 | /** 42 | * Method called when exit button from a loaded toolbar has been clicked. 43 | * By default, this method will just call the method. 44 | * @param sender The object that sent the action message. 45 | */ 46 | - (void)exitButtonClicked:(id)sender; 47 | 48 | /** 49 | * Method called when the action bar button item has been loaded. 50 | * Sub-classes can reimplement this method to customize the style of the action button. 51 | * @param actionButton The button used to action the campaign. 52 | */ 53 | - (void)actionButtonLoaded:(UIBarButtonItem*)actionButton; 54 | 55 | /** 56 | * Method called when the exit bar button item has been loaded. 57 | * Sub-classes can reimplement this method to customize the style of the exit button. 58 | * @param exitButton The button used to exit the campaign. 59 | */ 60 | - (void)exitButtonLoaded:(UIBarButtonItem*)exitButton; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEWebAnnouncementJsBridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | @protocol AEWebAnnouncementActionDelegate; 9 | 10 | /** 11 | * 12 | * Javascript bridge used by web announcements. 13 | * 14 | * Create a bridge between javascript methods embed inside a web announcement and objective c methods 15 | * defined in .
16 | * The mapping is as follow: 17 | * - *engagementReachContent.actionContent()* is mapped to <[AEWebAnnouncementActionDelegate action]> 18 | * - *engagementReachContent.exitContent()* is mapped to <[AEWebAnnouncementActionDelegate exit]> 19 | * 20 | * This class must be used in association with a `UIWebView`: 21 | * 22 | * [webView setDelegate:[AEWebAnnouncementJsBridge jsBridgeWithDelegate:self]]; 23 | * 24 | */ 25 | @interface AEWebAnnouncementJsBridge : NSObject 26 | { 27 | @private 28 | id _delegate; 29 | } 30 | 31 | /** 32 | * Create a bridge between Javascript functions and Objective C methods.
33 | * Used the returned object as a delegate to an existing `UIWebView`. 34 | * @param delegate The delegate that will receive reach actions each time a recognized Javascript function is called. 35 | */ 36 | + (id)jsBridgeWithDelegate:(id)delegate; 37 | 38 | @end 39 | 40 | /** 41 | * The `AEWebAnnouncementActionDelegate` protocol defines the methods a delegate of a object 42 | * should implement. 43 | * 44 | * Each time a recognized Javascript method is called, the corresponding delegate method will be called. 45 | * See methods definition for the list of recognized actions. 46 | */ 47 | @protocol AEWebAnnouncementActionDelegate 48 | 49 | /** 50 | * Mapped to the javascript function *engagementReachContent.actionContent()*
51 | * The announcement has been actioned. 52 | */ 53 | - (void)action; 54 | 55 | /** 56 | * Mapped to the javascript function *engagementReachContent.exitContent()*
57 | * The announcement has been exited. 58 | */ 59 | - (void)exit; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /src/ios/EngagementSDK/Headers/AEUserNotificationHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | /** 10 | * This user notification handler is an implementation of the UNUserNotificationCenterDelegate protocol 11 | * for Engagement notifications. 12 | * 13 | * @see UNUserNotificationCenterDelegate 14 | */ 15 | @interface AEUserNotificationHandler : NSObject 16 | 17 | /** 18 | * Called when a notification is delivered to a foreground app. 19 | * This implementation forces system notifications from Engagement to NOT be presented 20 | * while the application is in foreground. 21 | * The completionHandler, if not nil, is called on Engagement notifications only. 22 | * @param center The notification center that received the notification. 23 | * @param notification The notification that is about to be delivered. 24 | * @param completionHandler The block to execute with the presentation option for the notification. 25 | */ 26 | - (void)userNotificationCenter:(UNUserNotificationCenter *)center 27 | willPresentNotification:(UNNotification *)notification 28 | withCompletionHandler:(nullable void (^)(UNNotificationPresentationOptions options)) completionHandler; 29 | 30 | /** 31 | * Called to let the application know which action was selected by the user for a given notification. 32 | * This implementation handles Engagement notifications being actioned by the user. 33 | * A notification is not actioned if it has been dismissed by the user. 34 | * The completionHandler, if not nil, is called on Engagement notifications only. 35 | * @param center The notification center that received the notification. 36 | * @param notification The user’s response to the notification. 37 | * @param completionHandler The block to execute when the user’s response is finished processing. 38 | */ 39 | - (void)userNotificationCenter:(UNUserNotificationCenter *)center 40 | didReceiveNotificationResponse:(UNNotificationResponse *)response 41 | withCompletionHandler:(nullable void(^)()) completionHandler; 42 | 43 | @end 44 | 45 | NS_ASSUME_NONNULL_END 46 | 47 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_content_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | 21 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/EngagementPlugin/iOS/AEIdfaProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import "AEIdfaProvider.h" 6 | #import 7 | 8 | @implementation AEIdfaProvider 9 | 10 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | #pragma mark Singleton method 12 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 13 | 14 | + (id)shared 15 | { 16 | static dispatch_once_t once; 17 | static id sharedInstance; 18 | dispatch_once(&once, ^{ 19 | sharedInstance = [[self alloc] init]; 20 | }); 21 | return sharedInstance; 22 | } 23 | 24 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 25 | #pragma mark Public methods 26 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 27 | 28 | - (NSNumber*)isIdfaEnabled 29 | { 30 | #ifndef ENGAGEMENT_DISABLE_IDFA 31 | ASIdentifierManager* sharedManager = [self ASIdentifierManager]; 32 | if (sharedManager) 33 | { 34 | return [NSNumber numberWithBool:[sharedManager isAdvertisingTrackingEnabled]]; 35 | } 36 | #endif 37 | return nil; 38 | } 39 | 40 | - (NSString*)idfa 41 | { 42 | #ifndef ENGAGEMENT_DISABLE_IDFA 43 | ASIdentifierManager* sharedManager = [self ASIdentifierManager]; 44 | if (sharedManager) 45 | { 46 | if ([sharedManager isAdvertisingTrackingEnabled]) 47 | { 48 | return [[sharedManager advertisingIdentifier] UUIDString]; 49 | } 50 | } 51 | #endif 52 | return nil; 53 | } 54 | 55 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 56 | #pragma mark Private methods 57 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 58 | 59 | #ifndef ENGAGEMENT_DISABLE_IDFA 60 | - (ASIdentifierManager*)ASIdentifierManager 61 | { 62 | Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager"); 63 | if (ASIdentifierManagerClass) 64 | { 65 | return [ASIdentifierManagerClass sharedManager]; 66 | } 67 | return nil; 68 | } 69 | 70 | #endif 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /src/ios/EngagementSDK/Classes/AEIdfaProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import "AEIdfaProvider.h" 6 | #import 7 | 8 | @implementation AEIdfaProvider 9 | 10 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11 | #pragma mark Singleton method 12 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 13 | 14 | + (id)shared 15 | { 16 | static dispatch_once_t once; 17 | static id sharedInstance; 18 | dispatch_once(&once, ^{ 19 | sharedInstance = [[self alloc] init]; 20 | }); 21 | return sharedInstance; 22 | } 23 | 24 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 25 | #pragma mark Public methods 26 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 27 | 28 | - (NSNumber*)isIdfaEnabled 29 | { 30 | #ifndef ENGAGEMENT_DISABLE_IDFA 31 | ASIdentifierManager* sharedManager = [self ASIdentifierManager]; 32 | if (sharedManager) 33 | { 34 | return [NSNumber numberWithBool:[sharedManager isAdvertisingTrackingEnabled]]; 35 | } 36 | #endif 37 | return nil; 38 | } 39 | 40 | - (NSString*)idfa 41 | { 42 | #ifndef ENGAGEMENT_DISABLE_IDFA 43 | ASIdentifierManager* sharedManager = [self ASIdentifierManager]; 44 | if (sharedManager) 45 | { 46 | if ([sharedManager isAdvertisingTrackingEnabled]) 47 | { 48 | return [[sharedManager advertisingIdentifier] UUIDString]; 49 | } 50 | } 51 | #endif 52 | return nil; 53 | } 54 | 55 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 56 | #pragma mark Private methods 57 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 58 | 59 | #ifndef ENGAGEMENT_DISABLE_IDFA 60 | - (ASIdentifierManager*)ASIdentifierManager 61 | { 62 | Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager"); 63 | if (ASIdentifierManagerClass) 64 | { 65 | return [ASIdentifierManagerClass sharedManager]; 66 | } 67 | return nil; 68 | } 69 | 70 | #endif 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/java/com/microsoft/azure/engagement/unity/IntentCatcherActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT license. See License.txt in the project root for license information. 4 | */ 5 | 6 | package com.microsoft.azure.engagement.unity; 7 | 8 | import android.app.Activity; 9 | import android.content.Intent; 10 | import android.content.pm.ApplicationInfo; 11 | import android.content.pm.PackageManager; 12 | import android.net.Uri; 13 | import android.os.Bundle; 14 | import android.util.Log; 15 | 16 | import com.microsoft.azure.engagement.shared.EngagementShared; 17 | 18 | // To compensate for the lack of onNewIntent() on the UnityActivity 19 | 20 | public class IntentCatcherActivity extends Activity { 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | 26 | Uri data = getIntent().getData(); 27 | if (data != null) { 28 | String url = data.toString(); 29 | Log.i(EngagementShared.LOG_TAG, "IntentCatcher handURL " + url); 30 | EngagementWrapper.handleOpenURL(url); 31 | } 32 | 33 | // By default, the ActivityName is com.unity3d.player.UnityPlayerActivity, but this can be overriden in the manifest 34 | Class clazz = com.unity3d.player.UnityPlayerActivity.class; 35 | try { 36 | ApplicationInfo ai =getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); 37 | Bundle bundle = ai.metaData; 38 | String activityName = bundle.getString("engagement:unity:activityname"); 39 | if (activityName==null) 40 | Log.d(EngagementShared.LOG_TAG,"could not retrieve engagement:unity:activityname"); 41 | else 42 | clazz = Class.forName(activityName); 43 | 44 | } catch (Exception e) { 45 | Log.e(EngagementShared.LOG_TAG,"Failed to find activityname: " + e.getMessage()); 46 | } 47 | 48 | Log.i(EngagementShared.LOG_TAG,"Launching activity"+clazz.toString()); 49 | Intent gameIntent = new Intent(this, clazz); 50 | startActivity(gameIntent); 51 | 52 | // Close the IntentCatcherActivity 53 | if (!isFinishing()) 54 | finish(); 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /src/ios/src/EngagementUnity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT license. See License.txt in the project root for license information. 4 | */ 5 | 6 | #import 7 | #import "EngagementShared.h" 8 | 9 | #define UNITY_METHOD_ONDATAPUSHRECEIVED "onDataPushReceived" 10 | #define UNITY_METHOD_ONHANDLEURL "onHandleURL" 11 | #define UNITY_METHOD_ONSTATUSRECEIVED "onStatusReceived" 12 | 13 | #define DEFINE_NOTIFICATION(name) \ 14 | extern __attribute__((visibility ("default"))) NSString* const name ; 15 | #define REGISTER_SELECTOR(observer,sel, notif_name) [[NSNotificationCenter defaultCenter] \ 16 | addObserver:observer selector:sel name:notif_name object:nil ] 17 | 18 | @interface EngagementUnity : NSObject 19 | { 20 | @public 21 | #define MAX_CHAR 256 22 | char instanceObject[MAX_CHAR]; 23 | } 24 | 25 | // singleton 26 | + (EngagementUnity*)instance; 27 | + (void)load; 28 | 29 | - (void)didFailToRegisterForRemoteNotificationsWithError:(NSNotification*)notification ; 30 | - (void)didReceiveRemoteNotification:(NSNotification*)notification ; 31 | - (void)didRegisterForRemoteNotificationsWithDeviceToken: (NSNotification*)notification ; 32 | - (void)registerApplication; 33 | 34 | @end 35 | 36 | // Interface Unity -> Plugin 37 | extern void initializeEngagement(const char* _instanceName); 38 | extern void initializeReach() ; 39 | extern void startActivity(const char* _activityName, const char* _extraInfos) ; 40 | extern void endActivity(); 41 | extern void sendEvent(const char* _eventName, const char* _extraInfos); 42 | extern void startJob(const char* _jobName, const char* _extraInfos); 43 | extern void endJob(const char* _jobName); 44 | extern void sendAppInfo(const char* _extraInfos); 45 | extern void sendSessionEvent(const char* _eventName, const char* _extraInfos); 46 | extern void sendJobEvent(const char* _eventName, const char* _jobName, const char* _extraInfos); 47 | extern void sendJobError(const char* _errorName, const char* _jobName, const char* _extraInfos); 48 | extern void sendError(const char* _errorName, const char* _extraInfos); 49 | extern void sendSessionError(const char* _errorName, const char* _extraInfos); 50 | 51 | 52 | 53 | extern void getStatus(); 54 | 55 | 56 | // Interface Plugin -> Unity 57 | extern void UnitySendMessage(const char *, const char *, const char *); 58 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_web_announcement.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | 21 | 26 | 27 | 31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /package.sh: -------------------------------------------------------------------------------- 1 | 2 | PACKAGEPATH="$PWD/Engagement.unitypackage" 3 | rm $PACKAGEPATH 4 | 5 | SRCDIR="$PWD/src" 6 | 7 | #-1 Create Empty App to receive the package 8 | 9 | UNITYPROJECTNAME="engagement-project" 10 | UNITYPROJECT="$PWD/$UNITYPROJECTNAME" 11 | rm -rf $UNITYPROJECT 12 | 13 | echo "Creating $UNITYPROJECT" 14 | UNITYAPP=/Applications/Unity/Unity.app/Contents/MacOS/Unity 15 | $UNITYAPP -batchmode -quit -createProject $UNITYPROJECTNAME 16 | 17 | #-2 Copy the plugin files to the project 18 | 19 | cp -r src/EngagementPlugin "$UNITYPROJECT/Assets" 20 | 21 | TARGETAZME="$UNITYPROJECT/Assets/EngagementPlugin" 22 | 23 | #-3 Build the iOS Library 24 | 25 | TARGETIOS="$TARGETAZME/iOS" 26 | SRCIOSDIR="$PWD/src/iOS" 27 | 28 | PROJECTFILENAME="EngagementUnity.xcodeproj" 29 | BUILD_PATH="$PWD/~build" 30 | BUILD_DIR="$BUILD_PATH/build-$TARGETAPP" 31 | TMP_DIR="$BUILD_PATH/tmp-$TARGETAPP" 32 | 33 | rm -rf "$BUILD_PATH" 34 | rm -rf "$PROJECTDIR/$PROJECTFILENAME/build" 35 | mkdir "$BUILD_PATH" 36 | TARGETAPP="EngagementUnity" 37 | CONFIG="Release" 38 | xcodebuild -project "$SRCIOSDIR/$PROJECTFILENAME" -target "$TARGETAPP" -configuration "$CONFIG" BUILD_DIR="$BUILD_DIR" TMP_DIR="$TMP_DIR" 39 | 40 | #-4 Copy iOS artefacts 41 | 42 | IOSLIBRARYNAME="libEngagementUnity.a" 43 | rm "$TARGETIOS/$IOSLIBRARYNAME" 44 | cp "$BUILD_DIR/$CONFIG-iphoneos/$IOSLIBRARYNAME" "$TARGETIOS/$IOSLIBRARYNAME" 45 | 46 | rm -rf "$TARGETIOS/res" 47 | mkdir "$TARGETIOS/res" 48 | 49 | cp "$SRCIOSDIR/EngagementReach/res/close.png" "$TARGETIOS/res" 50 | cp "$SRCIOSDIR/EngagementReach/res/AEDefaultAnnouncementView.xib" "$TARGETIOS/res" 51 | cp "$SRCIOSDIR/EngagementReach/res/AEDefaultPollView.xib" "$TARGETIOS/res" 52 | cp "$SRCIOSDIR/EngagementReach/res/AENotificationView.xib" "$TARGETIOS/res" 53 | cp "$SRCIOSDIR/EngagementSDK/Classes/AEIdfaProvider.h" "$TARGETIOS" 54 | cp "$SRCIOSDIR/EngagementSDK/Classes/AEIdfaProvider.m" "$TARGETIOS" 55 | 56 | #-5 Build Android library 57 | 58 | TARGETANDROID="$TARGETAZME/Android" 59 | ANDROIDLIBRARYNAME="libEngagementUnity.aar" 60 | 61 | rm -rf "$TARGETANDROID" 62 | mkdir "$TARGETANDROID" 63 | 64 | SAVEPWD=$PWD 65 | cd "$PWD/src/Android" 66 | ./gradlew clean 67 | ./gradlew build 68 | cd "$SAVEPWD" 69 | 70 | cp "$SAVEPWD/src/Android/libEngagementUnity/build/outputs/aar/libEngagementUnity-release.aar" "$TARGETANDROID/$ANDROIDLIBRARYNAME" 71 | 72 | #-7 Build the package by launching Unity from the command line 73 | 74 | 75 | $UNITYAPP -batchmode -quit -projectPath "$UNITYPROJECT" -exportPackage "Assets/EngagementPlugin" "$PACKAGEPATH" 76 | 77 | #-8 Done 78 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_text_announcement.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 20 | 21 | 26 | 27 | 31 | 32 | 33 | 34 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/Android/libEngagementUnity/src/main/res/layout/engagement_button_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 20 | 25 | 26 | 31 | 32 | 48 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEReachModule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | #import "AEModule.h" 8 | #import "AEReachDataPushDelegate.h" 9 | #import "AENotifier.h" 10 | 11 | @class AEStorage; 12 | @class AEContentViewController; 13 | 14 | /* Export module name */ 15 | extern NSString* const kAEReachModuleName; 16 | 17 | /* Export reach xml namespace */ 18 | extern NSString* const kAEReachNamespace; 19 | 20 | /* Export reach default category */ 21 | extern NSString* const kAEReachDefaultCategory; 22 | 23 | /* Reach module state */ 24 | typedef enum _AEReachModuleState 25 | { 26 | AEReachModuleStateIdle = 1, 27 | AEReachModuleStateNotifying = 2, 28 | AEReachModuleStateLoading = 3, 29 | AEReachModuleStateShowing = 4 30 | } AEReachModuleState; 31 | 32 | /** 33 | * The Reach Engagement module 34 | * 35 | * This is the module that manage reach functionalities. It listens push messages thanks to 36 | * <[AEModule pushMessageReceived:]> and <[AEModule displayPushMessageNotification:]> and notify the user 37 | * about announcements and polls.
38 | * You usually create the module using the method moduleWithNotificationIcon: and pass it when you initialize Engagement 39 | * (using method <[EngagementAgent init:modules:]>) 40 | * 41 | * *Example of a basic integration:* 42 | * 43 | * - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 44 | * AEReachModule* reach = [AEReachModule moduleWithNotificationIcon:[UIImage imageNamed:@"icon.png"]]; 45 | * [EngagementAgent init:@"Endpoint={YOUR_APP_COLLECTION.DOMAIN};SdkKey={YOUR_APPID};AppId={YOUR_APPID}" 46 | *modules:reach, nil]; 47 | * 48 | * ... 49 | * 50 | * return YES; 51 | * } 52 | * 53 | */ 54 | @interface AEReachModule : NSObject 55 | { 56 | @private 57 | /* Storage */ 58 | AEStorage* _db; 59 | AEStorage* _feedbackDb; 60 | 61 | /* Background/Inactive state tracking */ 62 | BOOL _didEnterBackground; 63 | BOOL _willResignActive; 64 | BOOL _applicationLaunchedViaSystemPush; 65 | 66 | /* Set of DLCs that are pending download (key = localId) */ 67 | NSMutableIndexSet* _pendingDlcs; 68 | 69 | /* Cached Reach Values */ 70 | NSDictionary* _cachedReachValues; 71 | 72 | /* Entries scheduled to be removed */ 73 | NSMutableIndexSet* _trash; 74 | 75 | /* Scanning db storage context */ 76 | BOOL _scanning; 77 | 78 | /* Current state */ 79 | AEReachModuleState _state; 80 | 81 | /** The message identifier being processed */ 82 | NSInteger _processingId; 83 | 84 | /* Current activity */ 85 | NSString* _currentActivity; 86 | 87 | /* Announcement controller classes by category */ 88 | NSMutableDictionary* _announcementControllers; 89 | 90 | /* Poll controller classes by category */ 91 | NSMutableDictionary* _pollControllers; 92 | 93 | /* Notification handlers by category */ 94 | NSMutableDictionary* _notifiers; 95 | 96 | /* Special parameters to inject in announcement's action url and body */ 97 | NSDictionary* _params; 98 | 99 | /* Remember if the agent has been started or not */ 100 | BOOL _isStarted; 101 | 102 | /* Data push delegate */ 103 | id _dataPushDelegate; 104 | 105 | /* Current displayed controller */ 106 | AEContentViewController* _displayedController; 107 | 108 | /* Auto badge */ 109 | BOOL _autoBadgeEnabled; 110 | BOOL _badgeNotificationReceived; 111 | 112 | /* Maximum number of contents */ 113 | NSUInteger _maxContents; 114 | } 115 | 116 | /** 117 | * Instantiate a new reach Engagement module. 118 | * @param icon The image to use as the notification icon 119 | */ 120 | + (id)moduleWithNotificationIcon:(UIImage*)icon; 121 | 122 | /** 123 | * Enable or disable automatic control of the badge value. If enabled, the Reach module will automatically 124 | * clear the application badge and also reset the value stored by Engagement every time the application 125 | * is started or foregrounded. 126 | * @param enabled YES to enable auto badge, NO otherwise (Disabled by default). 127 | */ 128 | - (void)setAutoBadgeEnabled:(BOOL)enabled; 129 | 130 | /** 131 | * Set the maximum number of in-app campaigns that can be displayed. 132 | * @param maxCampaigns The maximum number of in-app campaigns that can be displayed (0 to disable in-app campaigns). 133 | */ 134 | - (void)setMaxInAppCampaigns:(NSUInteger)maxCampaigns; 135 | 136 | /** 137 | * Register an announcement category. 138 | * @param category The name of the category to map. 139 | * @param clazz The associated view controller class to instantiate when an announcement of the given 140 | * category is received. The controller class should inherit from . 141 | */ 142 | - (void)registerAnnouncementController:(Class)clazz forCategory:(NSString*)category; 143 | 144 | /** 145 | * Register a poll category. 146 | * @param category The name of the category to map. 147 | * @param clazz The associated view controller class to instantiate when an poll of the given 148 | * category is received. The controller class should inherit from . 149 | */ 150 | - (void)registerPollController:(Class)clazz forCategory:(NSString*)category; 151 | 152 | /** 153 | * Register a notifier for a given category. 154 | * @param notifier Notifier to register for a category. 155 | * @param category The name of the category. 156 | */ 157 | - (void)registerNotifier:(id)notifier forCategory:(NSString*)category; 158 | 159 | /** 160 | * Mark given content processed. It will be removed from cache, 161 | * and any other waiting contents will be displayed to the user. 162 | * @param content The content to mark as processed. 163 | */ 164 | - (void)markContentProcessed:(AEReachContent*)content; 165 | 166 | /** 167 | * Called when loading page is dismissed by user. 168 | */ 169 | - (void)onLoadingViewDismissed; 170 | 171 | /** 172 | * Called when a notification is actioned. 173 | * @param content The content associated to the notification. 174 | */ 175 | - (void)onNotificationActioned:(AEReachContent*)content; 176 | 177 | /** 178 | * Indicate if feedback with status code should be sent for a push message. 179 | * This method queries the db and updates the db at the same time. 180 | * @param status The flag indicating if feedback should be sent or not. 181 | * @param pushId Push Id of the message. 182 | */ 183 | - (BOOL)shouldSendFeedback:(NSString*)status forPushId:(NSString*)pushId; 184 | 185 | /** The delegate that will handle data pushes. */ 186 | @property(nonatomic, retain) id dataPushDelegate; 187 | 188 | @end 189 | -------------------------------------------------------------------------------- /src/ios/EngagementReach/Headers/AEDefaultNotifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | */ 4 | 5 | #import 6 | #import 7 | #import "AENotifier.h" 8 | 9 | #define NOTIFICATION_AREA_VIEW_TAG 36822491 10 | 11 | #define NOTIFICATION_ICON_TAG 1 12 | #define NOTIFICATION_TITLE_TAG 2 13 | #define NOTIFICATION_MESSAGE_TAG 3 14 | #define NOTIFICATION_IMAGE_TAG 4 15 | #define NOTIFICATION_BUTTON_TAG 5 16 | #define NOTIFICATION_CLOSE_TAG 6 17 | 18 | /** 19 | * 20 | * This is the default notifier used by . 21 | * 22 | * It will display a banner notification inside the current application window or in a dedicated view tag if it exists. 23 | * By default the banner notification overlay will be presented at the bottom of the screen. If you prefer to display it 24 | * at the top of screen, 25 | * edit the provided _`AENotificationView.xib`_ and change the `AutoSizing` property of the main view so it can be kept 26 | * at the top of its superview. 27 | * 28 | * # Some examples of custom notifiers based on this class # 29 | * 30 | * ** Using a different nib file: ** 31 | * 32 | * #import "AEDefaultNotifier.h" 33 | * @interface MyNotifier : AEDefaultNotifier 34 | * @end 35 | * 36 | * @implementation MyNotifier 37 | * -(NSString*)nibNameForCategory:(NSString*)category 38 | * { 39 | * return "MyNotificationView"; 40 | * } 41 | * @end 42 | * 43 | * ** Creating the notification view programmatically: ** 44 | * 45 | * #import "AEDefaultNotifier.h" 46 | * @interface MyNotifier : AEDefaultNotifier 47 | * @end 48 | * 49 | * @implementation MyNotifier 50 | * 51 | * -(UIView*)notificationViewForContent:(AEInteractiveContent*)content 52 | * { 53 | * UIView* notificationView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 250, 80)]; 54 | * notificationView.backgroundColor = [UIColor redColor]; 55 | * 56 | * // Title 57 | * UILabel* title = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 230, 30)]; 58 | * title.text = content.notificationTitle; 59 | * [notificationView addSubview:title]; 60 | * [title release]; 61 | * 62 | * // Notification button 63 | * UIButton* button = [[UIButton alloc] initWithFrame:notificationView.frame]; 64 | * [button addTarget:self action:@selector(onNotificationActioned) forControlEvents:UIControlEventTouchDown]; 65 | * [notificationView addSubview:button]; 66 | * [button release]; 67 | * 68 | * return [notificationView autorelease]; 69 | * } 70 | * @end 71 | */ 72 | @interface AEDefaultNotifier : NSObject 73 | { 74 | @private 75 | UIImage* _notificationIcon; 76 | AEInteractiveContent* _content; 77 | UIView* _containerView; 78 | } 79 | 80 | /** 81 | * Create a default notifier with a given notification icon. 82 | * The default notification view AENotificationView will be used to display notifications. 83 | * @param icon Notification icon. 84 | */ 85 | + (id)notifierWithIcon:(UIImage*)icon; 86 | 87 | /** 88 | * This method is called when a view is requested to display notifications.
89 | * The default implementation of this class return `NotificationView`, the name of 90 | * the xib file provided with the reach library.
91 | * Subclasses can reimplement this method to return another xib filename. The file must be inside the 92 | * main application bundle and should only contain one view. 93 | * 94 | * @param category Associated category. Can be ignored if this notifier handles only one category. 95 | * @result Nib name for the given category. 96 | */ 97 | - (NSString*)nibNameForCategory:(NSString*)category; 98 | 99 | /** 100 | * This method is called when a new notification view is requested for the given content. 101 | * By default this method load the view from the nib returned by , 102 | * and prepare it by calling the method .
103 | * Subclasses can override this method to create a custom view for the given content. 104 | * 105 | * @param content Content to be notified. You can use the methods <[AEInteractiveContent notificationTitle]>, 106 | * <[AEInteractiveContent notificationMessage]>, <[AEInteractiveContent notificationIcon]>, 107 | * <[AEInteractiveContent notificationCloseable]>, <[AEInteractiveContent notificationImage]> to prepare your view. 108 | * @result View displaying the notification. 109 | */ 110 | - (UIView*)notificationViewForContent:(AEInteractiveContent*)content; 111 | 112 | /** 113 | * This function is called when the notification view must be prepared, e.g. change texts, 114 | * icon etc... based on the specified content. This is the responsibility of this method to 115 | * associate actions to the buttons. At this point the notification is not yet attached to the 116 | * view hierarchy, so you can not have access to its superview. 117 | * 118 | * The provided custom view must contains the following subviews: 119 | * 120 | * - `UIImageView` with tag 1 to display the notification icon 121 | * - `UILabel` with tag 2 to display the notification's title 122 | * - `UILabel` with tag 3 to display the notification's message 123 | * - `UIImageView` with tag 4 to display the additional notification image 124 | * - `UIButton` with tag 5 used when the notification is 'actioned' 125 | * - `UIButton` with tag 6 used when the notification is 'exited' 126 | * 127 | * @param content Content to be notified. 128 | * @param view View used to display the notification. 129 | */ 130 | - (void)prepareNotificationView:(UIView*)view forContent:(AEInteractiveContent*)content; 131 | 132 | /** 133 | * This function is called when the notification view has been added to a window. 134 | * By default, this method do nothing but subclasses can override this method to perform additional tasks 135 | * associated with presenting the notification view. 136 | * @param view View containing the notification. 137 | */ 138 | - (void)notificationViewDidAppear:(UIView*)view; 139 | 140 | /** 141 | * This function is called when the notification view has been removed from the view hierarchy. 142 | * By default, this method do nothing but subclasses can override this method to perform additional tasks 143 | * associated with hiding the notification view. 144 | * @param view View containing the notification. 145 | */ 146 | - (void)notificationViewDidDisappear:(UIView*)view; 147 | 148 | /** 149 | * Animate the area notification view when it appears. 150 | * Default implementation performs a fade-in animation. 151 | * Subclasses can override this method to customize the animation. 152 | * @param view View to animate. 153 | */ 154 | - (void)animateAreaNoticationView:(UIView*)view; 155 | 156 | /** 157 | * Animate the overlay notification view when it appears. 158 | * Default implementation performs a vertical slide animation. 159 | * Subclasses can override this method to customize the animation. 160 | * @param view View to animate. 161 | */ 162 | - (void)animateOverlayNotificationView:(UIView*)view; 163 | 164 | /** 165 | * Called when the notification is actioned (example : when the user clicks on the notification). 166 | * If you override the method , be sure to map this method to one of your U.I. 167 | * controls. 168 | */ 169 | - (void)onNotificationActioned; 170 | 171 | /** 172 | * Called when the notification is exited (example : when the close button is clicked). 173 | * If you override the method , be sure to map this method to one of your U.I. 174 | * controls 175 | */ 176 | - (void)onNotificationExited; 177 | 178 | @end 179 | -------------------------------------------------------------------------------- /src/EngagementPlugin/Scripts/EngagementWrapper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT license. See License.txt in the project root for license information. 4 | */ 5 | 6 | using UnityEngine; 7 | using System.Runtime.InteropServices; 8 | using System.Collections; 9 | using System.Collections.Generic; 10 | using System.Reflection; 11 | 12 | #if UNITY_WSA 13 | using Microsoft.Azure.Engagement; 14 | #endif 15 | 16 | namespace Microsoft.Azure.Engagement.Unity 17 | { 18 | internal class EngagementWrapper 19 | { 20 | 21 | #if UNITY_EDITOR 22 | 23 | public static void initializeReach() { } 24 | public static void startActivity(string _activityName, string _extraInfos) { } 25 | public static void endActivity() { } 26 | public static void startJob(string _jobName, string _extraInfos) { } 27 | public static void endJob(string _jobName) { } 28 | public static void sendEvent(string _eventName, string _extraInfos) { } 29 | public static void sendAppInfo(string _extraInfos) { } 30 | public static void sendSessionEvent(string _eventName, string _extraInfosJSON) { } 31 | public static void sendJobEvent(string _eventName, string _jobName, string _extraInfosJSON) { } 32 | public static void sendError(string _errorName, string _extraInfosJSON) { } 33 | public static void sendSessionError(string _errorName, string _extraInfosJSON) { } 34 | public static void sendJobError(string _errorName, string _jobName, string _extraInfosJSON) { } 35 | public static void registerForPushNotification() { } 36 | public static void onApplicationPause(bool _paused) { } 37 | public static void setEnabled(bool _enabled) { } 38 | public static void getStatus() 39 | { 40 | Dictionary status = new Dictionary(); 41 | status.Add("deviceId", "UnityEditor"); 42 | status.Add("pluginVersion", EngagementAgent.PLUGIN_VERSION); 43 | status.Add("nativeVersion", "0"); 44 | status.Add("isEnabled", false); 45 | string serialized = MiniJSON.Json.Serialize(status); 46 | EngagementAgent.Instance().onStatusReceived(serialized); 47 | } 48 | public static void saveUserPreferences() { } 49 | public static void restoreUserPreferences() { } 50 | 51 | #elif UNITY_IPHONE 52 | 53 | [DllImport("__Internal")] 54 | public static extern void initializeEngagement(string _instanceName ); 55 | 56 | [DllImport("__Internal")] 57 | public static extern void initializeReach(); 58 | 59 | [DllImport("__Internal")] 60 | public static extern void startActivity(string _activityName,string _extraInfos); 61 | 62 | [DllImport("__Internal")] 63 | public static extern void endActivity(); 64 | 65 | [DllImport("__Internal")] 66 | public static extern void startJob(string _jobName,string _extraInfos); 67 | 68 | [DllImport("__Internal")] 69 | public static extern void endJob(string _jobName); 70 | 71 | [DllImport("__Internal")] 72 | public static extern void sendEvent(string _eventName,string _extraInfos); 73 | 74 | [DllImport("__Internal")] 75 | public static extern void sendAppInfo(string _extraInfos); 76 | 77 | [DllImport("__Internal")] 78 | public static extern void sendSessionEvent(string _eventName, string _extraInfosJSON); 79 | 80 | [DllImport("__Internal")] 81 | public static extern void sendJobEvent(string _eventName, string _jobName,string _extraInfosJSON); 82 | 83 | [DllImport("__Internal")] 84 | public static extern void sendError(string _errorName, string _extraInfosJSON); 85 | 86 | [DllImport("__Internal")] 87 | public static extern void sendSessionError(string _errorName, string _extraInfosJSON); 88 | 89 | [DllImport("__Internal")] 90 | public static extern void sendJobError(string _errorName, string _jobName, string _extraInfosJSON); 91 | 92 | [DllImport("__Internal")] 93 | public static extern void getStatus(); 94 | 95 | [DllImport("__Internal")] 96 | public static extern void saveUserPreferences(); 97 | 98 | [DllImport("__Internal")] 99 | public static extern void restoreUserPreferences(); 100 | 101 | [DllImport("__Internal")] 102 | public static extern void setEnabled(bool _enabled); 103 | 104 | [DllImport("__Internal")] 105 | public static extern void onApplicationPause(bool _paused ); 106 | 107 | #elif UNITY_ANDROID 108 | 109 | static AndroidJavaClass activityJavaClass = null; 110 | static public AndroidJavaClass javaClass 111 | { 112 | get 113 | { 114 | if (null == activityJavaClass) 115 | { 116 | AndroidJavaClass player = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 117 | AndroidJavaObject activity = player.GetStatic("currentActivity"); 118 | 119 | /*Set Activity, will be used to retrieve URL scheme. */ 120 | activityJavaClass = new AndroidJavaClass("com.microsoft.azure.engagement.unity.EngagementWrapper"); 121 | activityJavaClass.CallStatic("setAndroidActivity", activity); 122 | } 123 | return activityJavaClass; 124 | } 125 | } 126 | 127 | public static void registerApp(string _instanceName, string _connectionString, int _locationType, int _locationMode, bool _enablePluginLog ) 128 | { 129 | javaClass.CallStatic("registerApp",_instanceName,_connectionString, _locationType,_locationMode,_enablePluginLog); 130 | } 131 | 132 | public static void initializeReach() 133 | { 134 | javaClass.CallStatic("initializeReach"); 135 | 136 | } 137 | 138 | public static void startActivity(string _activityName, string _extraInfos) 139 | { 140 | javaClass.CallStatic("startActivity",_activityName, _extraInfos); 141 | } 142 | 143 | public static void endActivity() 144 | { 145 | javaClass.CallStatic("endActivity"); 146 | } 147 | 148 | public static void startJob(string _jobName, string _extraInfos) 149 | { 150 | javaClass.CallStatic("startJob",_jobName, _extraInfos); 151 | } 152 | 153 | public static void endJob(string _jobName) 154 | { 155 | javaClass.CallStatic("endJob",_jobName); 156 | } 157 | 158 | public static void sendEvent(string _eventName, string _extraInfos) 159 | { 160 | javaClass.CallStatic("sendEvent",_eventName,_extraInfos); 161 | } 162 | 163 | public static void sendAppInfo( string _extraInfos) 164 | { 165 | javaClass.CallStatic("sendAppInfo",_extraInfos); 166 | } 167 | 168 | public static void sendSessionEvent(string _eventName, string _extraInfos) 169 | { 170 | javaClass.CallStatic("sendSessionEvent",_eventName,_extraInfos); 171 | } 172 | 173 | public static void sendJobEvent(string _eventName, string _jobName,string _extraInfos) 174 | { 175 | javaClass.CallStatic("sendJobEvent",_eventName,_jobName,_extraInfos); 176 | } 177 | 178 | public static void sendError(string _errorName, string _extraInfos) 179 | { 180 | javaClass.CallStatic("sendError",_errorName,_extraInfos); 181 | } 182 | 183 | public static void sendSessionError(string _errorName, string _extraInfos) 184 | { 185 | javaClass.CallStatic("sendSessionError",_errorName,_extraInfos); 186 | } 187 | 188 | public static void sendJobError(string _errorName, string _jobName, string _extraInfos) 189 | { 190 | javaClass.CallStatic("sendJobError",_errorName,_jobName,_extraInfos); 191 | } 192 | 193 | public static void getStatus( ) 194 | { 195 | javaClass.CallStatic("getStatus"); 196 | } 197 | 198 | public static void saveUserPreferences( ) 199 | { 200 | 201 | } 202 | 203 | public static void restoreUserPreferences( ) 204 | { 205 | 206 | } 207 | 208 | public static void setEnabled( bool _enabled) 209 | { 210 | javaClass.CallStatic("setEnabled",_enabled); 211 | } 212 | 213 | public static void onApplicationPause(bool _paused) 214 | { 215 | javaClass.CallStatic("onApplicationPause",_paused); 216 | } 217 | 218 | #elif UNITY_WSA 219 | // Nothing Here 220 | #else 221 | #error "unsupported platform" 222 | #endif 223 | 224 | } 225 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure Mobile Engagement service has been retired and is no longer available. 2 | 3 | ## Azure Mobile Engagement : Unity SDK 4 | 5 | ### Installation 6 | * Import the`Engagement.unitypackage`into your Unity project 7 | * Edit the configuration file `EngagementPlugin/EngagementConfiguration.cs` with your credentials 8 | * Add the SDK APis into your code (see the *Integration* Section) 9 | * Excute *File/Engagement/Generate Android Manifest* to update your project settings (needed to be executed everytime the configuration file is beging modified) 10 | 11 | ### Configuration 12 | The configuration of your application is performed via an `EngagementConfiguration` class located in the `EngagementPlugin/` directory. 13 | 14 | ##### Engagement Configuration 15 | 16 | ###### Windows Universal 10 / Windows Phone 8.1 17 | - `WINDOWS_CONNECTION_STRING` : the Windows connection string (to retrieve from the Engagement portal) 18 | ###### Android 19 | - `ANDROID_CONNECTION_STRING` : the Android connection string (to retrieve from the Engagement portal) 20 | - `ANDROID_UNITY3D_ACTIVITY`: needs to be filled if your application does not use the default Unity Activity (`com.unity3d.player.UnityPlayerActivity`) 21 | 22 | ###### iOS 23 | - `IOS_CONNECTION_STRING` : the iOS connection string (to retrieve from the Engagement portal) 24 | - `IOS_DISABLE_IDFA` : `true`|`false` : to disable the IDFA integration on iOS 25 | 26 | ###### Generic 27 | - `ENABLE_PLUGIN_LOG` : `true`|`false`, enable the plugin debug logs 28 | - `ENABLE_NATIVE_LOG` : `true`|`false`, enable the Engagement native SDK to debug logs 29 | - It is recommended to set both to `true` while working on the plugin integration. 30 | 31 | ##### Location Reporting 32 | - `LOCATION_REPORTING_TYPE`: Can be one of the following (please refer to the Native SDK documentation for more information) 33 | * `LocationReportingType.NONE` 34 | * `LocationReportingType.LAZY` 35 | * `LocationReportingType.REALTIME` 36 | * `LocationReportingType.FINEREALTIME` 37 | - `LOCATION_REPORTING_MODE`: Can be one of the following (please refer to the Native SDK documentation for more information) 38 | * `LocationReportingMode.NONE` 39 | * `LocationReportingMode.FOREGROUND` 40 | * `LocationReportingMode.BACKGROUND` 41 | 42 | ##### Reach support 43 | 44 | ###### Generic 45 | - `ENABLE_REACH` : `true`|`false`, to enable the reach integration 46 | - `ACTION_URL_SCHEME` : the url scheme of your application when using redirect actions in your campaign 47 | 48 | ###### iOS 49 | - `IOS_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 used 50 | 51 | ###### Android 52 | - `ANDROID_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 used 53 | - `ANDROID_GOOGLE_PROJECT_NUMBER` : the project number used as the GCM (Google Cloud Messaging) sender ID 54 | 55 | ##### Notes 56 | * On iOS, you need to add enable the Push Notification in your XCode capabilities 57 | * Do not follow the installation instruction from the Engagement native SDK for Android or iOS : in the Unity Engagement SDK, the application configuration is performed automatically (cf. `EngagementPlugin/Editor/EngagementPostBuild.cs` to see how it works under the hood). 58 | 59 | 60 | ### Basic Integration 61 | To initialize the Engagement service, just call `EngagementAgent.Initialize()`. No arguments are needed as the credentials are automatically retrieved from the `EngagementConfiguration`class. 62 | 63 | ##### Example 64 | Basic initialization: 65 | ```C# 66 | void Start () { 67 | // initialize the application 68 | EngagementAgent.Initialize (); 69 | // start your first activity 70 | EngagementAgent.StartActivity ("home"); 71 | } 72 | ``` 73 | 74 | ### Reach Integration 75 | 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 76 | * `StringDataPushReceived(string _category, string _body)` to receive text data push 77 | * `Base64DataPushReceived(string _category, byte[] data, string _encodedbody)` to receive binary push (through byte[] and base64 encoded string) 78 | * `HandleURL(string _url)` when an application specific URL is triggered (from a push campaign for example) 79 | 80 | ##### Notes 81 | * Reach must be enabled in the configuration file by setting the `EngagementConfiguration.ENABLE_REACH`variable 82 | * The URL scheme must match the one defined in the `EngagementConfiguration.ACTION_URL_SCHEME` setting 83 | 84 | ##### Example 85 | Initialization with push support : 86 | ```C# 87 | void Start () { 88 | // initialize the Engagement Agent 89 | EngagementAgent.Initialize (); 90 | 91 | // set the Events 92 | EngagementReach.HandleURL += (string _push) => { 93 | Debug.Log ("OnHandleURL " + _push); 94 | }; 95 | 96 | EngagementReach.StringDataPushReceived += (string _category, string _body) => { 97 | Debug.Log ("StringDataPushReceived category:" + _category + ", body:" + _body); 98 | }; 99 | 100 | EngagementReach.Base64DataPushReceived += (string _category, byte[] _data, string _body) => { 101 | Debug.Log ("Base64DataPushReceived category:" + _category); 102 | }; 103 | // Activate the push notification support 104 | EngagementReach.Initialize(); 105 | // start your first activity 106 | EngagementAgent.StartActivity ("home"); 107 | } 108 | 109 | ``` 110 | 111 | ### Full API 112 | 113 | ##### Initialization 114 | * `EngagementAgent.Initialize` 115 | * `EngagementReach.Initialize` 116 | 117 | (see above) 118 | 119 | ##### Reporting APIs 120 | * `EngagementAgent.StartActivity` 121 | * `EngagementAgent.EndActivity` 122 | * `EngagementAgent.StartJob` 123 | * `EngagementAgent.EndJob` 124 | * `EngagementAgent.SendJobEvent` 125 | * `EngagementAgent.SendJobError` 126 | * `EngagementAgent.SendEvent` 127 | * `EngagementAgent.SendError` 128 | * `EngagementAgent.SendSessionEvent` 129 | * `EngagementAgent.SendSessionError` 130 | * `EngagementAgent.SendAppInfo` 131 | (see the AZME documentation) 132 | 133 | ##### Miscellaneous: 134 | * `EngagementAgent.SaveUserPreferences` 135 | * `EngagementAgent.RestoreUserPreferences` 136 | * `EngagementAgent.SetEnabled` 137 | * `EngagementAgent.GetStatus` 138 | 139 | ### Sample Application 140 | A sample application is available in the `sample`directory. 141 | * Execute `build-sample.sh`to create a new sample project 142 | * Once done, the Unity Editor should be displayed with the `sample-project`openned 143 | * Edit the `EngagementPlugin/EngagementConfiguration.cs`with your credentials (see the configuration section) 144 | * In the Unity *PlayerSettings*, set the bundle id for your application 145 | * iOS: 146 | * Go to *File/Build Settings/iOS* and press *Build* to create the XCode projet 147 | * From XCode, activate the *Push Notification* from the *Capabilities* menu 148 | * Build and run from XCode! 149 | * Android: 150 | * Go to *File/Engagement/Generate Android Manifest* to create a manifest file with the requirements for Engagement 151 | * Go to *File/Build Settings/Android* and press *Build&Run* to launch the sample 152 | 153 | ### Building from source 154 | 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. 155 | 156 | It only works on Mac OSX, with XCode, Unity and Android Studio installed. 157 | 158 | ### History 159 | 160 | ##### 1.3.0 161 | * Updated iOS SDK to 4.1.0 (iOS 6 deprecation, iOS 11 support) 162 | * Updated iOS SDK to 4.3.1 (Android O support) 163 | * Fix generated Android manifest file not always detected 164 | 165 | ##### 1.2.2 166 | * Updated iOS SDK to 4.0.1 167 | 168 | ##### 1.2.1 169 | * Fix possible duplicate symbols when building iOS project in Unity 5.4 170 | 171 | ##### 1.2.0 172 | * Updated iOS SDK to 4.0.0 173 | * Updated Android SDK to 4.2.3 174 | * Fix iOS support for Unity 5.3.1+ versions 175 | 176 | ##### 1.1.0 177 | * Added Windows Phone 8.1/Windows Universal 10 support 178 | 179 | ##### 1.0.0 180 | * Initial release 181 | 182 | ## Open Source Code of Conduct 183 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 184 | --------------------------------------------------------------------------------