Skip to content

Commit

Permalink
Retrieve IInAppMessage object and send it to Analytics method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Gonzalez committed Apr 30, 2018
1 parent 83bd90b commit 104051d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Assets/Plugins/Appboy/AppboyBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,9 @@ public static AndroidJavaObject Appboy {

public static AndroidJavaObject InAppMessageUtils {
get {
if (inAppMessageUtils != null) return inAppMessageUtils;

inAppMessageUtils = new AndroidJavaClass("com.appboy.unity.utils.InAppMessageUtils");
inAppMessageUtils.CallStatic("setContext", AppboyUnityActivity);

if (inAppMessageUtils == null) {
inAppMessageUtils = new AndroidJavaClass("com.appboy.unity.utils.InAppMessageUtils");
}
return inAppMessageUtils;
}
}
Expand Down Expand Up @@ -694,25 +692,30 @@ public static void RequestFeedRefreshFromCache() {
}

public static void LogInAppMessageClicked(string inAppMessageJSONString) {
InAppMessageUtils.CallStatic("logInAppMessageClick", new object[] { inAppMessageJSONString });
var inAppMessage = InAppMessageUtils.CallStatic<AndroidJavaObject>("inAppMessageFromString", appboyUnityActivity, inAppMessageJSONString);
InAppMessageUtils.CallStatic("logInAppMessageClick", inAppMessage);
}

public static void LogInAppMessageImpression(string inAppMessageJSONString) {
InAppMessageUtils.CallStatic("logInAppMessageImpression", new object[] { inAppMessageJSONString });
var inAppMessage = InAppMessageUtils.CallStatic<AndroidJavaObject>("inAppMessageFromString", appboyUnityActivity, inAppMessageJSONString);
InAppMessageUtils.CallStatic("logInAppMessageImpression", inAppMessage);
}

public static void LogInAppMessageButtonClicked(string inAppMessageJSONString, int buttonID) {
InAppMessageUtils.CallStatic("logInAppMessageButtonClick", new object[] { inAppMessageJSONString, buttonID });
var inAppMessage = InAppMessageUtils.CallStatic<AndroidJavaObject>("inAppMessageFromString", appboyUnityActivity, inAppMessageJSONString);
InAppMessageUtils.CallStatic("logInAppMessageButtonClick", inAppMessage, buttonID);
}

[System.Obsolete("LogSlideupClicked is deprecated, please use LogInAppMessageClicked instead.")]
public static void LogSlideupClicked(string slideupJSONString) {
InAppMessageUtils.CallStatic("logInAppMessageClick", new object[] { slideupJSONString });
var inAppMessage = InAppMessageUtils.CallStatic<AndroidJavaObject>("inAppMessageFromString", appboyUnityActivity, slideupJSONString);
InAppMessageUtils.CallStatic("logInAppMessageClick", inAppMessage);
}

[System.Obsolete("LogSlideupImpression is deprecated, please use LogInAppMessageImpression instead.")]
public static void LogSlideupImpression(string slideupJSONString) {
InAppMessageUtils.CallStatic("logInAppMessageImpression", new object[] { slideupJSONString });
var inAppMessage = InAppMessageUtils.CallStatic<AndroidJavaObject>("inAppMessageFromString", appboyUnityActivity, slideupJSONString);
InAppMessageUtils.CallStatic("logInAppMessageImpression", inAppMessage);
}

public static void LogFeedDisplayed() {
Expand Down

0 comments on commit 104051d

Please sign in to comment.