diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index 88b510951..88dc7f33c 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -28,10 +28,9 @@ - + - diff --git a/Assets/Plugins/Android/libs/appboy-ui.aar b/Assets/Plugins/Android/libs/appboy-ui.aar index 83ff4dde2..23c408af3 100644 Binary files a/Assets/Plugins/Android/libs/appboy-ui.aar and b/Assets/Plugins/Android/libs/appboy-ui.aar differ diff --git a/Assets/Plugins/Android/libs/appboy-unity.aar b/Assets/Plugins/Android/libs/appboy-unity.aar index 3eb4d5d3e..53e1290c9 100644 Binary files a/Assets/Plugins/Android/libs/appboy-unity.aar and b/Assets/Plugins/Android/libs/appboy-unity.aar differ diff --git a/Assets/Plugins/Android/libs/appboy.aar b/Assets/Plugins/Android/libs/appboy.aar index 806e915cd..f5438f042 100644 Binary files a/Assets/Plugins/Android/libs/appboy.aar and b/Assets/Plugins/Android/libs/appboy.aar differ diff --git a/Assets/Plugins/Appboy/AppboyBinding.cs b/Assets/Plugins/Appboy/AppboyBinding.cs index 195ca4a57..64acc7fb0 100755 --- a/Assets/Plugins/Appboy/AppboyBinding.cs +++ b/Assets/Plugins/Appboy/AppboyBinding.cs @@ -159,6 +159,9 @@ void Start() { [System.Runtime.InteropServices.DllImport("__Internal")] private static extern void _disableSDK(); + [System.Runtime.InteropServices.DllImport("__Internal")] + private static extern void _setAttributionData(string network, string campaign, string adgroup, string creative); + public static void LogCustomEvent(string eventName) { _logCustomEvent(eventName, null); } @@ -341,6 +344,10 @@ public static string GetInstallTrackingId() { return null; } + public static void SetAttributionData(string network, string campaign, string adgroup, string creative) { + _setAttributionData(network, campaign, adgroup, creative); + } + #elif UNITY_ANDROID private static AndroidJavaObject appboyUnityActivity; private static AndroidJavaObject appboy; @@ -746,6 +753,11 @@ public static string GetInstallTrackingId() { return Appboy.Call("getInstallTrackingId"); } + public static void SetAttributionData(string network, string campaign, string adgroup, string creative) { + var attributionData = new AndroidJavaObject("com.appboy.models.outgoing.AttributionData", network, campaign, adgroup, creative); + GetCurrentUser().Call("setAttributionData", attributionData); + } + #else // Empty implementations of the API, in case the application is being compiled for a platform other than iOS or Android. @@ -886,6 +898,9 @@ public static void DisableSDK() { public static string GetInstallTrackingId() { return null; } + + public static void SetAttributionData(string network, string campaign, string adgroup, string creative) { + } #endif } } diff --git a/Assets/Plugins/iOS/AppboyBinding.m b/Assets/Plugins/iOS/AppboyBinding.m index 47665a31b..48dbdf9f0 100644 --- a/Assets/Plugins/iOS/AppboyBinding.m +++ b/Assets/Plugins/iOS/AppboyBinding.m @@ -213,3 +213,7 @@ void _enableSDK() { void _disableSDK() { [AppboyUnityManager disableSDK]; } + +void _setAttributionData(const char* network, const char* campaign,const char* adgroup, const char* creative) { + [[AppboyUnityManager sharedInstance] setAttributionData:GetStringParam(network) campaign:GetStringParam(campaign) adgroup:GetStringParam(adgroup) creative:GetStringParam(creative)]; +} diff --git a/Assets/Plugins/iOS/AppboyUnityManager.h b/Assets/Plugins/iOS/AppboyUnityManager.h index 20007326b..c16e321e5 100644 --- a/Assets/Plugins/iOS/AppboyUnityManager.h +++ b/Assets/Plugins/iOS/AppboyUnityManager.h @@ -58,6 +58,7 @@ static NSString *const ABKUnityHandleInAppMessageDisplayKey = @"DisplayInAppMess - (void) setCustomAttributeArrayWithKey:(NSString *)key array:(NSArray *)valueArray; - (void) addToCustomAttributeArrayWithKey:(NSString *)key value:(NSString *)value; - (void) removeFromCustomAttributeArrayWithKey:(NSString *)key value:(NSString *)value; +- (void) setAttributionData:(NSString *)network campaign:(NSString *)campaign adgroup:(NSString *)adgroup creative:(NSString *)creative; - (void) setUserFacebookData:(NSString *)facebookId firstName:(NSString *)firstName lastName:(NSString *)lastName email:(NSString *)email bio:(NSString *)bio cityName:(NSString *)cityName gender:(NSInteger)gender numberOfFriends:(NSInteger)numberOfFriends birthday:(NSString *)birthday; - (void) setUserTwitterData:(NSInteger)twitterUserId twitterHandle:(NSString *)twitterHandle name:(NSString *)name description:(NSString *)description followerCount:(NSInteger)followerCount followingCount:(NSInteger)followingCount tweetCount:(NSInteger)tweetCount profileImageUrl:(NSString *)profileImageUrl; - (BOOL) submitFeedback:(NSString *)replyToEmail message:(NSString *)message isReportingABug:(BOOL)isReportingABug; diff --git a/Assets/Plugins/iOS/AppboyUnityManager.mm b/Assets/Plugins/iOS/AppboyUnityManager.mm index b9046a6da..a541e6067 100644 --- a/Assets/Plugins/iOS/AppboyUnityManager.mm +++ b/Assets/Plugins/iOS/AppboyUnityManager.mm @@ -141,6 +141,15 @@ - (void) removeFromCustomAttributeArrayWithKey:(NSString *)key value:(NSString * [[Appboy sharedInstance].user removeFromCustomAttributeArrayWithKey:key value:value]; } +- (void) setAttributionData:(NSString *)network campaign:(NSString *)campaign adgroup:(NSString *)adgroup creative:(NSString *)creative { + ABKAttributionData *attributionData = [[ABKAttributionData alloc] + initWithNetwork:network + campaign:campaign + adGroup:adgroup + creative:creative]; + [[Appboy sharedInstance].user setAttributionData:attributionData]; +} + - (void) setUserFacebookData:(NSString *)facebookId firstName:(NSString *)firstName lastName:(NSString *)lastName email:(NSString *)email bio:(NSString *)bio cityName:(NSString *)cityName gender:(NSInteger)gender numberOfFriends:(NSInteger)numberOfFriends birthday:(NSString *)birthday { NSMutableDictionary *facebookData = [NSMutableDictionary dictionary]; facebookData[@"id"] = facebookId; diff --git a/CHANGELOG.md b/CHANGELOG.md index 603c327ff..60f6445cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 1.15.0 + +##### Breaking +- Updated the Android plugin to use [Braze Android SDK 2.7.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#270). + - __Important:__ Note that in Braze Android SDK 2.7.0, `AppboyGcmReceiver` was renamed to `AppboyFcmReceiver`. This receiver is intended to be used for Firebase integrations. Please update the `AppboyGcmReceiver` declaration in your `AndroidManifest.xml` to reference `AppboyFcmReceiver` and remove the `com.google.android.c2dm.intent.REGISTRATION` intent filter action. + +##### Added +- Added `SetAttributionData` to the Appboy interface. + ## 1.14.0 ##### Breaking