From 32aeb3f92eced0402a456cd8577bd1e27e707279 Mon Sep 17 00:00:00 2001 From: Jared Poelman Date: Thu, 29 Aug 2019 13:38:16 -0400 Subject: [PATCH] Updating Unity plugins --- Assets/Plugins/Appboy/AppboyBinding.cs | 35 ++++++++++++++++++------ Assets/Plugins/iOS/AppboyBinding.m | 8 ------ Assets/Plugins/iOS/AppboyUnityManager.h | 3 -- Assets/Plugins/iOS/AppboyUnityManager.mm | 14 ---------- CHANGELOG.md | 9 ++++++ README.md | 4 +-- 6 files changed, 38 insertions(+), 35 deletions(-) diff --git a/Assets/Plugins/Appboy/AppboyBinding.cs b/Assets/Plugins/Appboy/AppboyBinding.cs index e39e94b59..e715140cb 100755 --- a/Assets/Plugins/Appboy/AppboyBinding.cs +++ b/Assets/Plugins/Appboy/AppboyBinding.cs @@ -117,9 +117,6 @@ void Start() { [System.Runtime.InteropServices.DllImport("__Internal")] private static extern void _setUserTwitterData(int twitterUserId, string twitterHandle, string name, string description, int followerCount, int followingCount, int tweetCount, string profileImageUrl); - [System.Runtime.InteropServices.DllImport("__Internal")] - private static extern void _submitFeedback(string replyToEmail, string message, bool isReportingABug); - [System.Runtime.InteropServices.DllImport("__Internal")] private static extern void _logInAppMessageClicked(string inAppMessageJSONString); @@ -144,9 +141,6 @@ void Start() { [System.Runtime.InteropServices.DllImport("__Internal")] private static extern void _logFeedDisplayed(); - [System.Runtime.InteropServices.DllImport("__Internal")] - private static extern void _logFeedbackDisplayed(); - [System.Runtime.InteropServices.DllImport("__Internal")] private static extern void _displayNextInAppMessage(bool withDelegate); @@ -285,7 +279,7 @@ public static void setUserTwitterData(int? twitterUserId, string twitterHandle, } public static void SubmitFeedback(string replyToEmail, string message, bool isReportingABug) { - _submitFeedback(replyToEmail, message, isReportingABug); + // no-op } public static void DisplayNextInAppMessage(bool withDelegate) { @@ -324,7 +318,7 @@ public static void LogFeedDisplayed() { } public static void LogFeedbackDisplayed() { - _logFeedbackDisplayed(); + // no-op } public static void WipeData() { @@ -348,9 +342,14 @@ public static void SetAttributionData(string network, string campaign, string ad _setAttributionData(network, campaign, adgroup, creative); } + public static void RequestLocationInitialization() { + // no-op + } + #elif UNITY_ANDROID private static AndroidJavaObject appboyUnityActivity; private static AndroidJavaObject inAppMessageUtils; + private static AndroidJavaObject appboyLocationService; void Start() { Debug.Log("Starting Appboy binding for Android clients."); @@ -385,6 +384,15 @@ public static AndroidJavaObject InAppMessageUtils { } } + public static AndroidJavaObject AppboyLocationService { + get { + if (appboyLocationService == null) { + appboyLocationService = new AndroidJavaClass("com.appboy.services.AppboyLocationService"); + } + return appboyLocationService; + } + } + #endregion private static AndroidJavaObject GetCurrentUser() { @@ -754,6 +762,14 @@ public static void SetAttributionData(string network, string campaign, string ad GetCurrentUser().Call("setAttributionData", attributionData); } + /// + /// When location permissions are granted, client app can call this method to request immediate + /// initialization of Braze geofences and also request a single location update. + /// + public static void RequestLocationInitialization() { + AppboyLocationService.CallStatic("requestInitialization", appboyUnityActivity); + } + #else // Empty implementations of the API, in case the application is being compiled for a platform other than iOS or Android. @@ -897,6 +913,9 @@ public static string GetInstallTrackingId() { public static void SetAttributionData(string network, string campaign, string adgroup, string creative) { } + + public static void RequestLocationInitialization() { + } #endif } } diff --git a/Assets/Plugins/iOS/AppboyBinding.m b/Assets/Plugins/iOS/AppboyBinding.m index 48dbdf9f0..5544c0452 100644 --- a/Assets/Plugins/iOS/AppboyBinding.m +++ b/Assets/Plugins/iOS/AppboyBinding.m @@ -158,10 +158,6 @@ void _setUserTwitterData(int twitterUserId, const char* twitterHandle, const cha [[AppboyUnityManager sharedInstance] setUserTwitterData:twitterUserId twitterHandle:GetStringParam(twitterHandle) name:GetStringParam(name) description:GetStringParam(description) followerCount:followerCount followingCount:followingCount tweetCount:tweetCount profileImageUrl:GetStringParam(profileImageUrl)]; } -void _submitFeedback(const char* replyToEmail, const char* message, bool isReportingABug) { - [[AppboyUnityManager sharedInstance] submitFeedback:GetStringParam(replyToEmail) message:GetStringParam(message) isReportingABug:isReportingABug]; -} - void _logInAppMessageClicked(const char* inAppMessageJSONString) { [[AppboyUnityManager sharedInstance] logInAppMessageClicked:GetStringParam(inAppMessageJSONString)]; } @@ -194,10 +190,6 @@ void _logFeedDisplayed() { [[AppboyUnityManager sharedInstance] logFeedDisplayed]; } -void _logFeedbackDisplayed() { - [[AppboyUnityManager sharedInstance] logFeedbackDisplayed]; -} - void _displayNextInAppMessage(bool withDelegate) { [[AppboyUnityManager sharedInstance] displayNextInAppMessageWithDelegate:withDelegate]; } diff --git a/Assets/Plugins/iOS/AppboyUnityManager.h b/Assets/Plugins/iOS/AppboyUnityManager.h index c16e321e5..a09555692 100644 --- a/Assets/Plugins/iOS/AppboyUnityManager.h +++ b/Assets/Plugins/iOS/AppboyUnityManager.h @@ -29,7 +29,6 @@ static NSString *const ABKUnityHandleInAppMessageDisplayKey = @"DisplayInAppMess + (AppboyUnityManager *) sharedInstance; - (void) showStreamView; -- (void) showFeedbackForm; - (void) logCustomEvent:(NSString *)eventName withProperties:(NSDictionary *)properties; - (void) changeUser:(NSString *)userId; - (void) logPurchase:(NSString *)productId inCurrency:(NSString *)currencyCode @@ -61,7 +60,6 @@ static NSString *const ABKUnityHandleInAppMessageDisplayKey = @"DisplayInAppMess - (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; - (void) parsePlist; - (NSString *) getApiKeyFromUnity; - (void) setListeners; @@ -80,7 +78,6 @@ static NSString *const ABKUnityHandleInAppMessageDisplayKey = @"DisplayInAppMess - (void) requestFeedRefresh; - (void) requestFeedFromCache:(NSNotification *)notification; - (void) logFeedDisplayed; -- (void) logFeedbackDisplayed; - (void) displayNextInAppMessageWithDelegate:(BOOL)withDelegate; + (void) wipeDataAndDisableForAppRun; + (void) disableSDK; diff --git a/Assets/Plugins/iOS/AppboyUnityManager.mm b/Assets/Plugins/iOS/AppboyUnityManager.mm index a541e6067..e0735fbcd 100644 --- a/Assets/Plugins/iOS/AppboyUnityManager.mm +++ b/Assets/Plugins/iOS/AppboyUnityManager.mm @@ -1,6 +1,5 @@ #import "AppboyUnityManager.h" #import -#import #import #import #import @@ -24,11 +23,6 @@ + (AppboyUnityManager*)sharedInstance { return sharedInstance; } -- (void) showFeedbackForm { - ABKModalFeedbackViewController *feedbackViewController = [[ABKModalFeedbackViewController alloc] init]; - [UnityGetGLViewController() presentViewController:feedbackViewController animated:YES completion:nil]; -} - - (void) logCustomEvent:(NSString *)eventName withProperties:(NSDictionary *)properties { [[Appboy sharedInstance] logCustomEvent:eventName withProperties:properties]; } @@ -195,10 +189,6 @@ - (void) setUserTwitterData:(NSInteger)twitterUserId twitterHandle:(NSString *)t [Appboy sharedInstance].user.twitterUser = twitterUser; } -- (BOOL) submitFeedback:(NSString *)replyToEmail message:(NSString *)message isReportingABug:(BOOL)isReportingABug { - return [[Appboy sharedInstance] submitFeedback:replyToEmail message:message isReportingABug:isReportingABug]; -} - // ABKInAppMessageDelegate methods - (ABKInAppMessageDisplayChoice)beforeInAppMessageDisplayed:(ABKInAppMessage *)inAppMessage { if (self.unityInAppMessageGameObjectName == nil) { @@ -482,10 +472,6 @@ - (void) logFeedDisplayed { [[Appboy sharedInstance] logFeedDisplayed]; } -- (void) logFeedbackDisplayed { - [[Appboy sharedInstance] logFeedbackDisplayed]; -} - - (void) displayNextInAppMessageWithDelegate:(BOOL)withDelegate { ABKInAppMessageController *delegate = nil; if (withDelegate) { diff --git a/CHANGELOG.md b/CHANGELOG.md index 34be94117..501f49811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 1.20.0 + +##### Breaking +- Updated the iOS plugin to use [Braze iOS SDK 3.18.0](https://github.com/Appboy/appboy-ios-sdk/releases/tag/3.18.0). + - Braze iOS SDK 3.18.0 removed the Feedback feature. As a result, all Feedback methods on the Appboy interface are now a no-op on iOS. + +##### Added +- Added `RequestLocationInitialization` to the Appboy interface, which wraps `AppboyLocationService.requestInitialization(context)` on the Android SDK. + ## 1.19.0 ##### Breaking diff --git a/README.md b/README.md index 9ad9b63ac..0ddb8d7b1 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,5 @@ To integrate Braze into your Android Unity application, complete our [Android Un To integrate Braze into your iOS Unity application, complete our [iOS Unity integration instructions][2]. [1]: https://github.com/Appboy/appboy-unity-sdk/releases -[2]: https://www.braze.com/documentation/Unity/iOS/ -[3]: https://documentation.braze.com/SDK_Integration/Unity/Android \ No newline at end of file +[2]: https://www.braze.com/docs/developer_guide/platform_integration_guides/unity/ios/sdk_integration/ +[3]: https://www.braze.com/docs/developer_guide/platform_integration_guides/unity/android/sdk_integration/