├── 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 |
37 |
38 |
43 |
44 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/src/Android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/src/Android/libEngagementUnity/src/main/res/drawable/engagement_content_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 | -
20 |
21 |
22 |
23 |
24 |
25 |
26 | -
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
43 |
44 |
45 |
46 |
47 | -
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | -
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/Android/libEngagementUnity/src/main/res/layout/engagement_poll.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
20 |
21 |
26 |
27 |
31 |
32 |
33 |
34 |
40 |
41 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/ios/EngagementSDK/Headers/AEModule.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | */
4 |
5 | #import
6 | #import
7 |
8 | @class AEPushMessage;
9 |
10 | /**
11 | * The `AEModule` protocol defines an interface for Engagement modules
12 | *
13 | * You can pass a module in the Engagement initialization method.
14 | *
15 | * **Related methods**
16 | *
17 | * - <[EngagementAgent init:modules:]>
18 | * - <[EngagementAgent getModule:]>
19 | */
20 | @protocol AEModule
21 |
22 | /**
23 | * Start module.
24 | * This method is called by the when Engagement has been initialized.
25 | * You can start using Engagement agent methods at this point.
26 | */
27 | - (void)start;
28 |
29 | /**
30 | * Stop module.
31 | * This method is called by the when Engagement is going to be released.
32 | * You should release uneeded resources in this method. You won't be able to call any methods from the
33 | * after this point.
34 | */
35 | - (void)stop;
36 |
37 | /**
38 | * The unique name of the module
39 | */
40 | - (NSString*)name;
41 |
42 |
43 | @optional
44 |
45 | /**
46 | * Called when a push message is received by Engagement.
47 | * This does not include the push message if it has been received following application launch
48 | * It stores the message locally and tried to process the message. If app is in the background,
49 | * message is processed once app becomes active.
50 | *
51 | * @param msg The push message.
52 | * @see AEPushMessage
53 | */
54 | - (void)pushMessageReceived:(AEPushMessage*)msg;
55 |
56 | /**
57 | * Called when remote notification is received.
58 | * @param userInfo The notification object.
59 | */
60 | - (void)processRemoteNotification:(NSDictionary*)userInfo;
61 |
62 | /**
63 | * Called when message with downloadble content is downloaded.
64 | * @param message Downloaded message.
65 | */
66 | - (void)dlcDownloaded:(AEPushMessage*)message;
67 |
68 | /**
69 | * Called when content of a message has failed to download.
70 | * @param messageId Message Id.
71 | */
72 | - (void)dlcDownloadFailed:(NSString*)messageId;
73 |
74 | /**
75 | * Called when campaigns are polled.
76 | * @param campaigns Polled campaigns.
77 | */
78 | - (void)campaignsPolled:(NSArray*)campaigns;
79 |
80 | /**
81 | * Called when failed to poll campaigns.
82 | */
83 | - (void)campaignsPollFailed;
84 |
85 | /**
86 | * Called when Engagement has detected that the current activity has changed.
87 | * @param activityName The name of the new activity.
88 | */
89 | - (void)activityChanged:(NSString*)activityName;
90 |
91 | /**
92 | * Called when an Apple push notification is received.
93 | * @param notification The notification payload.
94 | */
95 | - (void)pushNotificationReceived:(NSDictionary*)notification;
96 |
97 | /**
98 | * Called when the deviceid or the appid has changed.
99 | * You should use this method to clear the storage, for example.
100 | * Careful : The module is not started yet.
101 | */
102 | - (void)configurationChanged;
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/src/ios/EngagementReach/res/AEDefaultPollView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/ios/EngagementSDK/Headers/AEStorage.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | */
4 |
5 | #import
6 |
7 | /**
8 | * Data storage used by Engagement.
9 | */
10 | @interface AEStorage : NSObject
11 |
12 | /**
13 | * Create a new storage.
14 | * @param name The name of the store
15 | * @param version The version of the store
16 | * @param autoSync If `true` every operation on the store will be automatically written to the persistent storage.
17 | * Otherwise, the synchronize method should be called manually. You should consider synchronizing the store manually
18 | */
19 | + (instancetype)storageWithName:(NSString*)name version:(double)version autoSync:(BOOL)autoSync;
20 |
21 | /**
22 | * Create a new storage.
23 | * @param name The name of the store
24 | * @param autoSync If `true` every operation on the store will be automatically written to the persistent storage.
25 | * Otherwise, the synchronize method should be called manually. You should consider synchronizing the store manually
26 | * @param capacity max number of enteries of the storage
27 | */
28 | + (instancetype)userDefaultstorageWithName:(NSString*)name autoSync:(BOOL)autoSync capacity:(NSUInteger)capacity;
29 |
30 | /**
31 | * Set the maximum capacity of the store.
32 | * @param capacity Maximum number of entries to keep.
33 | */
34 | - (void)setCapacity:(NSUInteger)capacity;
35 |
36 | /**
37 | * Put a new entry in the store.
38 | * @param value Object to store. Should conform to `NSCoding`.
39 | * @result A unique identifier associated to the new entry.
40 | */
41 | - (NSUInteger)put:(id)value;
42 |
43 | /**
44 | * Put all entries in the store.
45 | * @param values Objects to store.
46 | * @result Unique identifiers associated to entries.
47 | */
48 | - (NSIndexSet*)putAll:(NSArray*)values;
49 |
50 | /**
51 | * Remove an existing value from the store based on its unique identifier
52 | * @param key Key's value to remove
53 | */
54 | - (void)remove:(NSUInteger)key;
55 |
56 | /** Clear any data from the store. Clear in memory data and remove persistant storage. */
57 | - (void)clear;
58 |
59 | /** Causes all in-memory data to be written to the persistent storage. */
60 | - (void)synchronize;
61 |
62 | /**
63 | * Makes the given object the cache’s delegate.
64 | * @param del The object to be registered as the delegate.
65 | */
66 | - (void)setDelegate:(id)del;
67 |
68 | @end
69 |
70 | /**
71 | * A `AEStorageEntry` object represents an entry in the
72 | *
73 | * An object of this type is returned while enumerating through a collection.
74 | */
75 | @interface AEStorageEntry : NSObject
76 |
77 | /** Unique identifier of the associated data */
78 | @property(nonatomic, assign) NSUInteger uid;
79 |
80 | /** Underlying data */
81 | @property(nonatomic, retain) NSObject* data;
82 |
83 | /**
84 | * Create a new storage entry.
85 | * @param uid Unique identifier of the entry.
86 | * @param data The underlying data object.
87 | */
88 | + (instancetype)dataWithId:(NSUInteger)uid data:(NSObject*)data;
89 |
90 | @end
91 |
92 | /**
93 | * The delegate of an NSCache object implements this protocol to perform specialized actions
94 | * when an object is about to be evicted from the cache.
95 | */
96 | @protocol AEStorageDelegate
97 |
98 | /**
99 | * Called when an object is evicted from the cache.
100 | * @param storage The storage with which the object of interest is associated.
101 | * @param entry The entry of interest in the storage.
102 | */
103 | + (void)storage:(AEStorage*)storage didEvictEntry:(AEStorageEntry*)entry;
104 |
105 | @end
106 |
--------------------------------------------------------------------------------
/src/ios/EngagementReach/Headers/AEInteractiveContent.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | */
4 |
5 | #import
6 | #import "AEReachContent.h"
7 |
8 | /**
9 | * Reach content behavior.
10 | */
11 | typedef NS_ENUM (NSInteger, AEContentBehavior)
12 | {
13 | /** A reach content that can be displayed at any time. */
14 | AEContentBehaviorAnyTime = 1,
15 |
16 | /** A reach content that can be displayed only when the application is in background. */
17 | AEContentBehaviorBackground = 2,
18 |
19 | /** A reach content that can be displayed during application session time. */
20 | AEContentBehaviorSession = 3,
21 | };
22 |
23 | /**
24 | * Abstract class for reach contents that can be displayed to the end-user.
25 | */
26 | @interface AEInteractiveContent : AEReachContent
27 | {
28 | @private
29 | NSString* _title;
30 | NSString* _actionLabel;
31 | NSString* _exitLabel;
32 | NSMutableArray* _allowedActivities;
33 | AEContentBehavior _behavior;
34 | NSString* _notificationTitle;
35 | NSString* _notificationMessage;
36 | BOOL _notificationIcon;
37 | BOOL _notificationCloseable;
38 | NSString* _notificationImageString;
39 | UIImage* _notificationImage;
40 | BOOL _notificationDisplayed;
41 | BOOL _notificationActioned;
42 | BOOL _contentDisplayed;
43 | BOOL _notifiedFromNativePush;
44 | }
45 |
46 | /**
47 | * Test if this content can be notified in the current UI context.
48 | * @param activity Current activity name, null if no current activity.
49 | * @result YES if this content can be notified in the current UI context.
50 | */
51 | - (BOOL)canNotify:(NSString*)activity;
52 |
53 | /** Report notification has been displayed */
54 | - (void)displayNotification;
55 |
56 | /**
57 | * Action the notification: this will display the announcement or poll, or will
58 | * launch the action URL associated to the notification, depending of the content kind.
59 | */
60 | - (void)actionNotification;
61 |
62 | /**
63 | * Action the notification: this will display the announcement or poll, or will
64 | * launch the action URL associated to the notification, depending of the content kind.
65 | * @param launchAction YES to launch associated action, NO to just report the notification action.
66 | */
67 | - (void)actionNotification:(BOOL)launchAction;
68 |
69 | /** Exit this notification. */
70 | - (void)exitNotification;
71 |
72 | /** Report content has been displayed */
73 | - (void)displayContent;
74 |
75 | /** Set is displayed value */
76 | - (void)setDisplayed:(BOOL)displayed;
77 |
78 | /** Set is actioned value */
79 | - (void)setActioned:(BOOL)actioned;
80 |
81 | /** Reach content's title */
82 | @property(nonatomic, readonly) NSString* title;
83 |
84 | /** The text label of the action button */
85 | @property(nonatomic, readonly) NSString* actionLabel;
86 |
87 | /** The text label of the exit button */
88 | @property(nonatomic, readonly) NSString* exitLabel;
89 |
90 | /** Reach content behavior (when to display the notification?) */
91 | @property(readonly) AEContentBehavior behavior;
92 |
93 | /** Notification's title */
94 | @property(readonly) NSString* notificationTitle;
95 |
96 | /** Notification's message */
97 | @property(readonly) NSString* notificationMessage;
98 |
99 | /** @result YES if the notification has a resource icon in notification content, NO otherwise */
100 | @property(readonly) BOOL notificationIcon;
101 |
102 | /** @result YES if the notification can be closed without looking at the content, NO otherwise */
103 | @property(readonly) BOOL notificationCloseable;
104 |
105 | /** @result notification image */
106 | @property(readonly) UIImage* notificationImage;
107 |
108 | /** @result YES if the content was notified from a native Apple Push Notification. */
109 | @property BOOL notifiedFromNativePush;
110 |
111 | @end
--------------------------------------------------------------------------------
/src/EngagementPlugin/iOS/EngagementNotifications.m:
--------------------------------------------------------------------------------
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 | #include
7 | #include
8 | #import
9 | #import
10 |
11 | #if ENGAGEMENT_UNITY != 1
12 | #error message("EngagementPostBuild.CS has not been executed - check your Engagement.package installation")
13 | #endif
14 |
15 | #include "../Classes/UnityAppController.h"
16 |
17 | @implementation UnityAppController(Engagement)
18 |
19 | #pragma clang diagnostic push
20 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
21 |
22 | #if !defined(UNITY_5_3_1) || UNITY_VERSION < UNITY_5_3_1
23 | // Temp fix while waiting the release of https://issuetracker.unity3d.com/issues/ios-remote-notifications-not-triggering-in-foreground
24 | - (void)application:(UIApplication *)application engagementDidReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
25 | {
26 | id instance =[NSClassFromString(@"EngagementShared") performSelector:NSSelectorFromString(@"instance")];
27 | [instance performSelector:NSSelectorFromString(@"didReceiveRemoteNotification:fetchCompletionHandler:") withObject:userInfo withObject:handler];
28 |
29 | // call the previous implementation (and not itself!)
30 | [self application:application engagementDidReceiveRemoteNotification:userInfo fetchCompletionHandler:handler];
31 | }
32 |
33 | #endif
34 |
35 | - (BOOL)application:(UIApplication*)application engagementDidFinishLaunchingWithOptions:(NSDictionary*)launchOptions
36 | {
37 | id instance =[NSClassFromString(@"EngagementUnity") performSelector:NSSelectorFromString(@"instance")];
38 | [instance performSelector:NSSelectorFromString(@"registerApplication")];
39 |
40 | // call the previous implementation (and not itself!)
41 | return [self application:application engagementDidFinishLaunchingWithOptions:launchOptions];
42 | }
43 |
44 | #pragma clang diagnostic pop
45 |
46 | // used in case the "parent" delegate was not implemented
47 | - (void)application:(UIApplication *)application engagementEmpty:(id)_fake
48 | {
49 |
50 | }
51 |
52 | + (void)swizzleInstanceSelector:(SEL)originalSelector withNewSelector:(SEL)newSelector
53 | {
54 | Method originalMethod = class_getInstanceMethod(self, originalSelector);
55 | Method newMethod = class_getInstanceMethod(self, newSelector);
56 |
57 | // if the original Method does not exist, replace it with an empty implementation
58 | if (originalMethod==nil)
59 | {
60 | Method emptyMethod = class_getInstanceMethod(self, @selector(application:engagementEmpty:));
61 | BOOL methodAdded = class_addMethod([self class],
62 | originalSelector,
63 | method_getImplementation(emptyMethod), // empty code
64 | method_getTypeEncoding(newMethod)); // but keep signature
65 |
66 | if (methodAdded==false)
67 | NSLog( @"Failed to add method %@",NSStringFromSelector(originalSelector));
68 |
69 | originalMethod = class_getInstanceMethod(self, originalSelector);
70 | }
71 |
72 | method_exchangeImplementations(originalMethod, newMethod);
73 | }
74 |
75 | +(void)load
76 | {
77 | #if !defined(UNITY_5_3_1) || UNITY_VERSION < UNITY_5_3_1
78 | [self swizzleInstanceSelector:@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:)
79 | withNewSelector:@selector(application:engagementDidReceiveRemoteNotification:fetchCompletionHandler:)];
80 | #endif
81 | [self swizzleInstanceSelector:@selector(application:didFinishLaunchingWithOptions:)
82 | withNewSelector:@selector(application:engagementDidFinishLaunchingWithOptions:)];
83 | }
84 | @end
85 |
86 |
--------------------------------------------------------------------------------
/src/EngagementPlugin/EngagementConfiguration.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 | namespace Microsoft.Azure.Engagement.Unity
8 | {
9 |
10 | ///
11 | /// Engagement configuration.
12 | ///
13 | ///
14 | /// Every time this class is being modified, the File/Engagement/Generate Android Manifest must be executed.
15 | ///
16 | public static class EngagementConfiguration
17 | {
18 | ///
19 | /// (Required) Your iOS Engagement application connection string.
20 | ///
21 | public const string IOS_CONNECTION_STRING = null;
22 |
23 | ///
24 | /// (Required) Your Android Engagement application connection string.
25 | ///
26 | public const string ANDROID_CONNECTION_STRING = null;
27 |
28 | ///
29 | /// (Required) Your Windows Engagement application connection string.
30 | ///
31 | public const string WINDOWS_CONNECTION_STRING = null;
32 |
33 | ///
34 | /// Enable\Disable console logs on native SDKs.
35 | ///
36 | public const bool ENABLE_NATIVE_LOG = true;
37 |
38 | ///
39 | /// Enable\Disable console logs on the Unity plugin.
40 | ///
41 | public const bool ENABLE_PLUGIN_LOG = true;
42 |
43 | ///
44 | /// Enable\Disable the use of the IDFA to compute the device id.
45 | ///
46 | ///
47 | /// If you are enabling the IDFA in the SDK but you are not using advertising elsewhere in the application,
48 | /// you might be rejected by the App Store review process. In this case you should keep this configuration to false.
49 | ///
50 | public const bool IOS_DISABLE_IDFA = false;
51 |
52 | ///
53 | /// If you customized the Unity3D Android activity then provide your customized activity here.
54 | ///
55 | public const string ANDROID_UNITY3D_ACTIVITY = null;
56 |
57 | ///
58 | /// Define the location reporting type thanks to enumeration.
59 | ///
60 | public const LocationReportingType LOCATION_REPORTING_TYPE = LocationReportingType.NONE;
61 |
62 | ///
63 | /// Define the location reporting mode thanks to enumeration.
64 | ///
65 | public const LocationReportingMode LOCATION_REPORTING_MODE = LocationReportingMode.NONE;
66 |
67 | ///
68 | /// (Required if location enabled for iOS) Starting with iOS 8, you must provide a description for how your application uses location services.
69 | ///
70 | public const string LOCATION_REPORTING_DESCRIPTION = null ;
71 |
72 | ///
73 | /// Enable\Disable the Reach feature of the SDK.
74 | ///
75 | public const bool ENABLE_REACH = true;
76 |
77 | ///
78 | /// Define a URL scheme used by action urls from Reach campaigns.
79 | ///
80 | public const string ACTION_URL_SCHEME = null;
81 |
82 | ///
83 | /// An icon file's path relative to the Assets/ directory if you want to use another one than the default iOS application icon.
84 | ///
85 | public const string IOS_REACH_ICON = null;
86 |
87 | ///
88 | /// An icon file's path relative to the Assets/ directory if you want to use another one than the default Android application icon.
89 | ///
90 | public const string ANDROID_REACH_ICON = null;
91 |
92 | ///
93 | /// (Required if Reach feature is enabled) Your Android Google project number to enable native push in the application.
94 | ///
95 | public const string ANDROID_GOOGLE_PROJECT_NUMBER = null;
96 | }
97 | }
98 |
99 |
100 |
--------------------------------------------------------------------------------
/src/ios/src/EngagementShared.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 "EngagementAgent.h"
8 | #import "AEReachDataPushDelegate.h"
9 | #import "AEReachModule.h"
10 |
11 | extern const NSString* ENGAGEMENT_LOGTAG ;
12 | extern const NSString* ENGAGEMENT_ERRORTAG ;
13 |
14 | typedef enum {
15 | LOCATIONREPORTING_NONE=100,
16 | LOCATIONREPORTING_LAZY=101,
17 | LOCATIONREPORTING_REALTIME=102,
18 | LOCATIONREPORTING_FINEREALTIME=103
19 | } locationReportingType;
20 |
21 | typedef enum {
22 | BACKGROUNDREPORTING_NONE=200,
23 | BACKGROUNDREPORTING_FOREGROUND=201,
24 | BACKGROUNDREPORTING_BACKGROUND=202
25 | } backgroundReportingType;
26 |
27 | @protocol EngagementDelegate
28 |
29 | - (void)didReceiveDataPush:(NSString*)_category withBody:(NSString*)_body isBase64:(NSNumber*)_isBase64;
30 | - (void)didReceiveURL:(NSString*)_url;
31 |
32 | @end
33 |
34 | @interface EngagementShared : NSObject
35 | {
36 | BOOL readyForPush;
37 | BOOL enablePluginLog;
38 | NSMutableArray* pendingNotifications ;
39 | NSMutableArray* dataPushes ;
40 | BOOL readyForURL;
41 | NSString* lastURL ;
42 | NSString* pluginVersion;
43 | NSString* nativeVersion;
44 | NSString* sdkName;
45 | NSDictionary *userPreferences;
46 |
47 | id delegate;
48 | }
49 |
50 | // singleton
51 | + (EngagementShared*)instance;
52 |
53 | // private
54 | - (void)processDataPush;
55 | - (void)addDataPush:(NSString*)_category withBody:(NSString*)_body isBase64:(BOOL)_isBase64;
56 | - (BOOL)didReceiveStringDataPushWithCategory:(NSString*)category body:(NSString*)body;
57 | - (BOOL)didReceiveBase64DataPushWithCategory:(NSString*)category decodedBody:(NSData *)decodedBody encodedBody:(NSString *)encodedBody;
58 |
59 | // public
60 |
61 | -(void)initSDK:(NSString*)_sdkName withPluginVersion:(NSString*)_pluginVersion withNativeVersion:(NSString*)_nativeVersion ;
62 | -(void)enablePluginLog:(BOOL)_enablePluginLog ;
63 | -(void)enableNativeLog:(BOOL)_enableNativeLog ;
64 |
65 | -(void)initialize: (NSString*)_connectionString withReachEnabled:(NSNumber*)_enableReach withReachIcon:(NSString*)_reachIcon withLocation:(locationReportingType)_locationReporting backgroundReporting:(backgroundReportingType)_backgroundReporting withDelegate:(id)_delegate;
66 |
67 | -(void)enablePush;
68 | -(void)enableURL;
69 |
70 | - (void)didFailToRegisterForRemoteNotificationsWithError:(NSError*)error;
71 | - (void)didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler;
72 | - (void)didReceiveRemoteNotification:(NSDictionary *)userInfo;
73 | - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
74 |
75 | - (void)startActivity:(NSString*)_activityName withExtraInfos:(NSString*)_extraInfos;
76 | - (void)endActivity;
77 | - (void)sendEvent:(NSString*)_eventName withExtraInfos:(NSString*)_extraInfos;
78 | - (void)startJob:(NSString*)_jobName withExtraInfos:(NSString*)_extraInfos;
79 | - (void)endJob:(NSString*)_jobName;
80 | - (void)sendAppInfo:(NSString*)_extraInfos;
81 |
82 | - (void)sendSessionEvent:(NSString*)_eventName withExtraInfos:(NSString*)_extraInfos;
83 | - (void)sendSessionError:(NSString*)_errorName withExtraInfos:(NSString*)_extraInfos;
84 | - (void)sendError:(NSString*)_errorName withExtraInfos:(NSString*)_extraInfos;
85 | - (void)sendJobEvent:(NSString*)_eventName inJob:(NSString*)_jobName withExtraInfos:(NSString*)_extraInfos;
86 | - (void)sendJobError:(NSString*)_errorName inJob:(NSString*)_jobName withExtraInfos:(NSString*)_extraInfos;
87 |
88 | - (NSDictionary*)getStatus ;
89 | - (void)handleOpenURL:(NSString*)_url;
90 | - (void)registerForPushNotification;
91 |
92 | -(void)saveUserPreferences;
93 | -(void)restoreUserPreferences;
94 | -(void)setEnabled:(BOOL)_enabled;
95 | -(BOOL)isEnabled;
96 |
97 | @end
98 |
99 |
100 |
--------------------------------------------------------------------------------
/src/ios/EngagementReach/Headers/AEReachContent.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | */
4 |
5 | #import
6 |
7 | /** If set, the notification has downloadable content */
8 | static NSInteger FLAG_DLC_NOTIFICATION = 1;
9 |
10 | /** If set, the clickable content exists */
11 | static NSInteger FLAG_DLC_CONTENT = 2;
12 |
13 | /** If set, both notification download and clickable content exists */
14 | static NSInteger FLAG_DLC_NOTIF_AND_CONTENT = 3;
15 |
16 |
17 | /**
18 | * Abstract class for reach contents such as announcements and polls.
19 | */
20 | @interface AEReachContent : NSObject
21 | {
22 | @private
23 | NSUInteger _localId;
24 | NSString* _category;
25 | NSString* _body;
26 | BOOL _processed;
27 | BOOL _feedback;
28 | NSDate* _expiryDate;
29 | BOOL _expiryLocaltz;
30 | NSString* _actionURL;
31 | NSInteger _dlc;
32 | NSString* _dlcId;
33 | BOOL _dlcCompleted;
34 | NSString* _pushId;
35 | }
36 |
37 | /**
38 | * Parse a reach content from a given xml element
39 | * @param reachValues Parsed JSON reach payload
40 | * @result The parsed reach content or nil if content couldn't be parsed.
41 | */
42 | - (id)initWithReachValues:(NSDictionary*)reachValues;
43 |
44 | /** The unique reach content identifier setter method. */
45 | @property(nonatomic, copy) NSString* contentId;
46 |
47 | /** The unique push identifier setter method. */
48 | @property(nonatomic, copy) NSString* pushId;
49 |
50 | /** Local storage identifier */
51 | @property(assign) NSUInteger localId;
52 |
53 | /**
54 | * Category of this content. You usually don't need to read this value by yourself.
55 | * Instead, you should use the method <[AEReachModule registerAnnouncementController:forCategory:]>
56 | * or <[AEReachModule registerPollController:forCategory:]> to tell the reach module
57 | * which controller to display for a given category.
58 | */
59 | @property(nonatomic, copy) NSString* category;
60 |
61 | /** Reach content's body */
62 | @property(nonatomic, copy) NSString* body;
63 |
64 | /** Feedback required ? */
65 | @property BOOL feedback;
66 |
67 | /** URL to launch as an action */
68 | @property(nonatomic, retain) NSString* actionURL;
69 |
70 | /** The reach kind of this content, it match naming used by reach feedbacks */
71 | - (NSString*)kind;
72 |
73 | /** Drop content. */
74 | - (void)drop;
75 |
76 | /** Report content has been actioned. */
77 | - (void)actionContent;
78 |
79 | /** Report content has been exited. */
80 | - (void)exitContent;
81 |
82 | /** @result YES if content is expired and should be dropped, NO otherwise */
83 | - (BOOL)isExpired;
84 |
85 | /**
86 | * Utility method to decode base64 data.
87 | * @param str The string to decode.
88 | */
89 | - (NSData*)decodeBase64:(NSString*)str;
90 |
91 | /**
92 | * Send feedback to reach about this content.
93 | * @param status The feedback status.
94 | * @param extras Extra information like poll answers.
95 | */
96 | - (void)sendFeedback:(NSString*)status extras:(NSDictionary*)extras;
97 |
98 | /**
99 | * Send content reply to the service that sent it, after that new contents can be notified.
100 | * @param status The feedback status.
101 | * @param extras Extra information like poll answers.
102 | */
103 | - (void)process:(NSString*)status extras:(NSDictionary*)extras;
104 |
105 | /**
106 | * Set or update payload.
107 | * @param payload New payload.
108 | */
109 | - (void)setPayload:(NSDictionary*)payload;
110 |
111 | /** Return true if download is needed */
112 | - (BOOL)hasDLC;
113 |
114 | /** Return true if download is needed after notification is clicked */
115 | - (BOOL)hasContentDLC;
116 |
117 | /** Return true if download is needed to display notification */
118 | - (BOOL)hasNotificationDLC;
119 |
120 | /** Return true if download is needed to display notification(this notification also has content to be shown after click) */
121 | - (BOOL)hasNotificationAndContentDLC;
122 |
123 | /**
124 | * Check if DLC completed.
125 | * @return true if DLC completed.
126 | */
127 | - (BOOL)isDlcCompleted;
128 |
129 | /**
130 | * Return dlc Id.
131 | * @return dlc Id.
132 | */
133 | - (NSString*)getDlcId;
134 |
135 | /**
136 | * Return unique push Id.
137 | * @return pushId.
138 | */
139 | - (NSString*)getPushId;
140 |
141 | @end
--------------------------------------------------------------------------------
/src/EngagementPlugin/Scripts/EngagementReach.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.Collections;
8 | using System.Collections.Generic;
9 | using System.Reflection;
10 | using System;
11 |
12 | #pragma warning disable 162
13 |
14 | namespace Microsoft.Azure.Engagement.Unity
15 | {
16 |
17 | public class EngagementReach : MonoBehaviour
18 | {
19 |
20 | ///
21 | /// Event when receiving a string datapush.
22 | ///
23 | /// The callback must of the form :
24 | /// DataPushStringReceived(string category, string body) {}
25 | ///
26 | ///
27 | public static Action StringDataPushReceived ;
28 | ///
29 | /// Event when receiving a base64 datapush.
30 | ///
31 | /// The callback must of the form :
32 | /// DataPushStringReceived(string category, byte[] decodedBody, string encodedBody) {}
33 | ///
34 | ///
35 | public static Action Base64DataPushReceived ;
36 |
37 | ///
38 | /// Event when receiving an openUrl event
39 | ///
40 | /// The callback must of the form :
41 | /// HandleURL(string url) {}
42 | ///
43 | ///
44 | public static Action HandleURL ;
45 |
46 | private EngagementReach()
47 | {
48 |
49 | }
50 |
51 | public static void Initialize( )
52 | {
53 | EngagementAgent.Logging ("Initializing Reach");
54 |
55 | if (EngagementConfiguration.ENABLE_REACH == false)
56 | {
57 | Debug.LogError ("Reach must be enabled in configuration first");
58 | return;
59 | }
60 |
61 | if (EngagementAgent.hasBeenInitialized == false)
62 | {
63 | Debug.LogError ("Agent must be initialized before initializing Reach");
64 | return ;
65 | }
66 | #if UNITY_WSA && !UNITY_EDITOR
67 | #else
68 | EngagementWrapper.initializeReach();
69 | #endif
70 | }
71 |
72 | // Delegates from Native
73 |
74 | public static void onDataPushString(string _category,string _body)
75 | {
76 | EngagementAgent.Logging("onDataPushString, category:" + _category);
77 | if (StringDataPushReceived != null)
78 | StringDataPushReceived(_category, _body);
79 | else
80 | EngagementAgent.Logging("WARNING: unitialized StringDataPushReceived");
81 | }
82 |
83 | public static void onDataPushBase64(string _category, byte [] _data, string _body)
84 | {
85 | EngagementAgent.Logging("onDataPushBase64, category:" + _category);
86 | if (Base64DataPushReceived != null)
87 | Base64DataPushReceived(_category, _data, _body);
88 | else
89 | EngagementAgent.Logging("WARNING: unitialized Base64DataPushReceived");
90 | }
91 |
92 |
93 | public static void onDataPushMessage(string _serialized)
94 | {
95 | Dictionary dict = (Dictionary)MiniJSON.Json.Deserialize(_serialized);
96 | string category = null;
97 | string body = null;
98 | bool isBase64 = (bool)dict ["isBase64"];
99 | if (dict["category"] != null)
100 | category = WWW.UnEscapeURL (dict["category"].ToString(),System.Text.Encoding.UTF8);
101 |
102 | EngagementAgent.Logging ("DataPushReceived, category: " + category+", isBase64:"+isBase64);
103 |
104 | if (isBase64 == false) {
105 | body = WWW.UnEscapeURL(dict["body"].ToString(), System.Text.Encoding.UTF8);
106 | onDataPushString(category,body);
107 |
108 | } else {
109 | body = dict ["body"].ToString ();
110 | byte[] data = Convert.FromBase64String(body);
111 | onDataPushBase64(category, data,body);
112 | }
113 | }
114 |
115 | public static void onHandleURLMessage(string _url)
116 | {
117 | EngagementAgent.Logging ("OnHandleURL: " + _url);
118 | if (HandleURL != null)
119 | HandleURL (_url);
120 | else
121 | EngagementAgent.Logging ("WARNING: unitialized HandleURL");
122 | }
123 | }
124 |
125 | }
126 |
127 | #pragma warning restore 162
128 |
--------------------------------------------------------------------------------
/src/ios/EngagementReach/res/AEDefaultAnnouncementView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/src/Android/libEngagementUnity/src/main/res/layout/engagement_notification_area.xml:
--------------------------------------------------------------------------------
1 |
15 |
18 |
19 |
25 |
26 |
31 |
32 |
36 |
37 |
46 |
47 |
56 |
57 |
65 |
66 |
67 |
72 |
73 |
80 |
81 |
82 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/src/Android/libEngagementUnity/src/main/java/com/microsoft/azure/engagement/shared/EngagementDataPushReceiver.java:
--------------------------------------------------------------------------------
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 | package com.microsoft.azure.engagement.shared;
8 |
9 | import java.io.UnsupportedEncodingException;
10 | import java.net.URLEncoder;
11 | import java.util.Map;
12 | import java.util.TreeMap;
13 | import android.annotation.TargetApi;
14 |
15 | import android.content.Context;
16 | import android.content.SharedPreferences;
17 | import android.util.Log;
18 |
19 | import com.microsoft.azure.engagement.reach.EngagementReachDataPushReceiver;
20 |
21 | import org.json.JSONException;
22 | import org.json.JSONObject;
23 |
24 | public class EngagementDataPushReceiver extends EngagementReachDataPushReceiver
25 | {
26 | public static final String ENGAGEMENT_PREFERENCES = "EngagementDataPush";
27 |
28 | // http://stackoverflow.com/questions/607176/java-equivalent-to-javascripts-encodeuricomponent-that-produces-identical-outpu
29 | public static String encodeURIComponent(String s) {
30 | if (s==null)
31 | return null;
32 | String result = null;
33 | try {
34 |
35 | result = URLEncoder.encode(s, "UTF-8")
36 | .replaceAll("\\+", "%20")
37 | .replaceAll("\\%21", "!")
38 | .replaceAll("\\%28", "(")
39 | .replaceAll("\\%29", ")")
40 | .replaceAll("\\%7E", "~");
41 | }
42 | catch (UnsupportedEncodingException e) {
43 | Log.e(EngagementShared.LOG_TAG,"Unsupported Encoding");
44 | }
45 | return result;
46 | }
47 |
48 | @TargetApi(9)
49 | public static Map getPendingDataPushes(Context context) {
50 |
51 | Map smap = new TreeMap();
52 |
53 | SharedPreferences settings = context.getSharedPreferences(ENGAGEMENT_PREFERENCES, 0/*MODE_PRIVATE*/);
54 | Map m = settings.getAll();
55 |
56 | // convert to treemap to keep the order by timestamp
57 | for (Map.Entry entry : m.entrySet()) {
58 | smap.put(entry.getKey(), entry.getValue().toString());
59 |
60 | }
61 | // remove all
62 | settings.edit().clear().apply();
63 |
64 | return smap;
65 | }
66 |
67 | @TargetApi(9)
68 | public static void addDataPush(Context context,String category, String body, boolean isBase64) {
69 | SharedPreferences settings = context.getSharedPreferences(ENGAGEMENT_PREFERENCES, 0/*MODE_PRIVATE*/);
70 | SharedPreferences.Editor prefEditor = settings.edit();
71 |
72 | Long tsLong = System.currentTimeMillis()/1000;
73 |
74 | JSONObject json = new JSONObject();
75 |
76 | try {
77 | json.put("isBase64",isBase64);
78 | if (category == null)
79 | json.put("category", JSONObject.NULL);
80 | else
81 | json.put("category",category);
82 | json.put("body",body);
83 | } catch (JSONException e) {
84 | Log.e(EngagementShared.LOG_TAG, "Cannot store push");
85 | return ;
86 | }
87 |
88 | String ts = tsLong.toString();
89 | String value= json.toString(); //category+" "+body;
90 | prefEditor.putString(ts, value);
91 | prefEditor.apply();
92 |
93 | final int MAX_CHAR = 128;
94 | int maxLength = (value.length() < MAX_CHAR)?value.length():MAX_CHAR;
95 | Log.i(EngagementShared.LOG_TAG, "received data push (" + ts + ") : " + value.substring(0,maxLength));
96 | }
97 |
98 | @Override
99 | protected Boolean onDataPushStringReceived(Context context, String category, String body) {
100 |
101 | String encodedCategory = encodeURIComponent(category);
102 | String encodedBody = encodeURIComponent(body);
103 |
104 | addDataPush(context.getApplicationContext(), encodedCategory, encodedBody, false);
105 | EngagementShared.instance().checkDataPush();
106 |
107 | return true;
108 | }
109 |
110 | @Override
111 | protected Boolean onDataPushBase64Received(Context context, String category, byte[] decodedBody, String encodedBody) {
112 |
113 | String encodedCategory = encodeURIComponent(category);
114 | addDataPush(context.getApplicationContext(),encodedCategory,encodedBody,true);
115 | EngagementShared.instance().checkDataPush();
116 |
117 | return true;
118 | }
119 | }
--------------------------------------------------------------------------------
/ThirdPartyNotices.txt:
--------------------------------------------------------------------------------
1 | THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
2 |
3 | Microsoft is offering you a license to use the following components included within the Microsoft Azure Mobile SDK subject to the terms of the Microsoft software license terms for the Microsoft Azure Mobile SDK. These notices below are provided for informational purposes only and are not the license terms under which Microsoft distributes these files. Microsoft reserves all rights not expressly granted herein.
4 |
5 | 1. Darktable - MiniJSON (https://gist.github.com/darktable/1411710)
6 | 2. DotNetZip (http://dotnetzip.codeplex.com/)
7 |
8 | %% Darktable - MiniJSON NOTICES AND INFORMATION BEGIN HERE
9 | =========================================
10 | Copyright (c) 2013 Calvin Rien
11 |
12 | Based on the JSON parser by Patrick van Bergen
13 | http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
14 |
15 | Simplified it so that it doesn't throw exceptions
16 | and can be used in Unity iPhone with maximum code stripping.
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining
19 | a copy of this software and associated documentation files (the
20 | "Software"), to deal in the Software without restriction, including
21 | without limitation the rights to use, copy, modify, merge, publish,
22 | distribute, sublicense, and/or sell copies of the Software, and to
23 | permit persons to whom the Software is furnished to do so, subject to
24 | the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be
27 | included in all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
32 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
33 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
34 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
35 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 | =========================================
37 | END OF Darktable - MiniJSON NOTICES AND INFORMATION
38 |
39 | %% DotNetZip NOTICES AND INFORMATION BEGIN HERE
40 | =========================================
41 | Microsoft Public License (Ms-PL)
42 |
43 | This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
44 |
45 | 1. Definitions
46 |
47 | The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
48 |
49 | A "contribution" is the original software, or any additions or changes to the software.
50 |
51 | A "contributor" is any person that distributes its contribution under this license.
52 |
53 | "Licensed patents" are a contributor's patent claims that read directly on its contribution.
54 |
55 | 2. Grant of Rights
56 |
57 | (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
58 |
59 | (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
60 |
61 | 3. Conditions and Limitations
62 |
63 | (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
64 |
65 | (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
66 |
67 | (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
68 |
69 | (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
70 |
71 | (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
72 | =========================================
73 | END OF DotNetZip NOTICES AND INFORMATION
74 |
--------------------------------------------------------------------------------
/src/EngagementPlugin/ThirdPartyNotices.txt:
--------------------------------------------------------------------------------
1 | THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
2 |
3 | Microsoft is offering you a license to use the following components included within the Microsoft Azure Mobile SDK subject to the terms of the Microsoft software license terms for the Microsoft Azure Mobile SDK. These notices below are provided for informational purposes only and are not the license terms under which Microsoft distributes these files. Microsoft reserves all rights not expressly granted herein.
4 |
5 | 1. Darktable - MiniJSON (https://gist.github.com/darktable/1411710)
6 | 2. DotNetZip (http://dotnetzip.codeplex.com/)
7 |
8 | %% Darktable - MiniJSON NOTICES AND INFORMATION BEGIN HERE
9 | =========================================
10 | Copyright (c) 2013 Calvin Rien
11 |
12 | Based on the JSON parser by Patrick van Bergen
13 | http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
14 |
15 | Simplified it so that it doesn't throw exceptions
16 | and can be used in Unity iPhone with maximum code stripping.
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining
19 | a copy of this software and associated documentation files (the
20 | "Software"), to deal in the Software without restriction, including
21 | without limitation the rights to use, copy, modify, merge, publish,
22 | distribute, sublicense, and/or sell copies of the Software, and to
23 | permit persons to whom the Software is furnished to do so, subject to
24 | the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be
27 | included in all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
32 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
33 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
34 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
35 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 | =========================================
37 | END OF Darktable - MiniJSON NOTICES AND INFORMATION
38 |
39 | %% DotNetZip NOTICES AND INFORMATION BEGIN HERE
40 | =========================================
41 | Microsoft Public License (Ms-PL)
42 |
43 | This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
44 |
45 | 1. Definitions
46 |
47 | The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
48 |
49 | A "contribution" is the original software, or any additions or changes to the software.
50 |
51 | A "contributor" is any person that distributes its contribution under this license.
52 |
53 | "Licensed patents" are a contributor's patent claims that read directly on its contribution.
54 |
55 | 2. Grant of Rights
56 |
57 | (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
58 |
59 | (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
60 |
61 | 3. Conditions and Limitations
62 |
63 | (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
64 |
65 | (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
66 |
67 | (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
68 |
69 | (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
70 |
71 | (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
72 | =========================================
73 | END OF DotNetZip NOTICES AND INFORMATION
74 |
--------------------------------------------------------------------------------
/src/Android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/src/ios/EngagementReach/res/AENotificationView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
32 |
33 |
34 |
35 |
36 |
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 |
--------------------------------------------------------------------------------