Skip to content

Commit

Permalink
Updating Unity plugins for version 4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
radixdev committed Jul 17, 2023
1 parent b72e747 commit 5d89edb
Show file tree
Hide file tree
Showing 14 changed files with 318 additions and 7 deletions.
Binary file modified Assets/Plugins/Android/appboy-ui.aar
Binary file not shown.
Binary file modified Assets/Plugins/Android/appboy-unity.aar
Binary file not shown.
Binary file modified Assets/Plugins/Android/appboy.aar
Binary file not shown.
4 changes: 2 additions & 2 deletions Assets/Plugins/Appboy/BrazeAndroidPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ public void LogContentCardDismissed(string contentCardString) {
}

public void RequestContentCardsRefresh() {
Braze.Call("requestContentCardsRefresh", false);
Braze.Call("requestContentCardsRefresh");
}

public void RequestContentCardsRefreshFromCache() {
Braze.Call("requestContentCardsRefresh", true);
Braze.Call("requestContentCardsRefreshFromCache");
}

public void WipeData() {
Expand Down
11 changes: 10 additions & 1 deletion Assets/Plugins/Appboy/Internal/BrazeInternalComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public void onPushTokenReceivedFromSystem(String token) {
public BrazeInAppMessageListener iamListener;

public void beforeInAppMessageDisplayed(string messageJSON) {
Debug.Log("BrazeInternalComponent.beforeInAppMessageDisplayed called with json: " + messageJSON);
if (iamListener == null || iamListener.BeforeInAppMessageDisplayed == null) {
Debug.Log("BrazeInternalComponent.beforeInAppMessageDisplayed no-op on null listener");
return;
}

Expand All @@ -45,7 +47,9 @@ public void beforeInAppMessageDisplayed(string messageJSON) {
}

public void onInAppMessageDismissed(string messageJSON) {
Debug.Log("BrazeInternalComponent.onInAppMessageDismissed called with json: " + messageJSON);
if (iamListener == null || iamListener.OnInAppMessageDismissed == null) {
Debug.Log("BrazeInternalComponent.onInAppMessageDismissed no-op on null listener");
return;
}

Expand All @@ -54,7 +58,9 @@ public void onInAppMessageDismissed(string messageJSON) {
}

public void onInAppMessageClicked(string messageJSON) {
Debug.Log("BrazeInternalComponent.onInAppMessageClicked called with json: " + messageJSON);
if (iamListener == null || iamListener.OnInAppMessageClicked == null) {
Debug.Log("BrazeInternalComponent.onInAppMessageClicked no-op on null listener");
return;
}

Expand All @@ -63,7 +69,9 @@ public void onInAppMessageClicked(string messageJSON) {
}

public void onInAppMessageButtonClicked(string argvJSON) {
Debug.Log("BrazeInternalComponent.onInAppMessageButtonClicked called with json: " + argvJSON);
if (iamListener == null || iamListener.OnInAppMessageButtonClicked == null) {
Debug.Log("BrazeInternalComponent.onInAppMessageButtonClicked no-op on null listener");
return;
}

Expand All @@ -80,7 +88,9 @@ public void onInAppMessageButtonClicked(string argvJSON) {
}

public void onInAppMessageHTMLClicked(string argvJSON) {
Debug.Log("BrazeInternalComponent.onInAppMessageHTMLClicked called with json: " + argvJSON);
if (iamListener == null || iamListener.OnInAppMessageHTMLClicked == null) {
Debug.Log("BrazeInternalComponent.onInAppMessageHTMLClicked no-op on null listener");
return;
}

Expand All @@ -95,6 +105,5 @@ public void onInAppMessageHTMLClicked(string argvJSON) {
Debug.Log("Received invalid in-app message data from native side.");
}
}

}
}
8 changes: 8 additions & 0 deletions Assets/Plugins/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 4.2.0

#### Breaking
- Updated the Android plugin to use [Braze Android SDK 26.2.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#2620)

##### Fixed
- Fixed an issue on Android where In-App Message events would not properly get forwarded to the Unity layer.

## 4.1.1

##### Fixed
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 4.2.0

#### Breaking
- Updated the Android plugin to use [Braze Android SDK 26.2.0](https://github.com/braze-inc/braze-android-sdk/blob/master/CHANGELOG.md#2620)

##### Fixed
- Fixed an issue on Android where In-App Message events would not properly get forwarded to the Unity layer.

## 4.1.1

##### Fixed
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022 Braze, Inc.
Copyright (c) 2023 Braze, Inc.
All rights reserved.

* Use of source code or binaries contained within Braze’s SDKs is permitted only to enable use of the Braze platform by customers of Braze.
Expand Down
Binary file modified unity-samples/Assets/Plugins/Android/appboy-ui.aar
Binary file not shown.
Binary file modified unity-samples/Assets/Plugins/Android/appboy-unity.aar
Binary file not shown.
Binary file modified unity-samples/Assets/Plugins/Android/appboy.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion unity-samples/Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
implementation 'androidx.core:core:1.7.0'
implementation 'androidx.core:core:1.6.0'
**DEPS**}

android {
Expand Down
34 changes: 34 additions & 0 deletions unity-samples/Assets/Scripts/MainMenu.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
using Appboy;
using Appboy.Models;
using Appboy.Models.InAppMessage;
using UnityEngine;
using UnityEngine.SceneManagement;
using Utilities;
using System.Collections.Generic;
using System.Text;
using System;

public class MainMenu : MonoBehaviour {

private void Start() {
BrazeInAppMessageListener listener = new BrazeInAppMessageListener() {
OnInAppMessageButtonClicked = OnInAppMessageButtonClicked,
OnInAppMessageClicked = OnInAppMessageClicked,
OnInAppMessageHTMLClicked = OnInAppMessageHTMLClicked,
OnInAppMessageDismissed = OnInAppMessageDismissed,
};
Appboy.AppboyBinding.inAppMessageListener = listener;
}

public void OnChangeUserButtonClick() {
SceneManager.LoadScene(Constants.ChangeUserScene);
}
Expand Down Expand Up @@ -78,6 +90,28 @@ public void OnDisplayNextInAppMessage() {
Appboy.AppboyBinding.DisplayNextInAppMessage();
}

public void OnPrintAllGameObjects() {
GameObject[] allObjects = UnityEngine.Object.FindObjectsOfType<GameObject>();
foreach(object gameObject in allObjects)
Debug.Log(gameObject + " is a GameObject.");
}

public void OnInAppMessageDismissed(IInAppMessage inAppMessage) {
Debug.Log($"OnInAppMessageDismissed: {inAppMessage.Message}");
}

public void OnInAppMessageHTMLClicked(IInAppMessage inAppMessage, Uri uri) {
Debug.Log($"OnInAppMessageHTMLClicked: {inAppMessage.Message} {uri.AbsoluteUri}");
}

public void OnInAppMessageClicked(IInAppMessage inAppMessage) {
Debug.Log($"OnInAppMessageClicked: {inAppMessage.Message}");
}

public void OnInAppMessageButtonClicked(IInAppMessage inAppMessage, InAppMessageButton inAppMessageButton) {
Debug.Log($" OnInAppMessageButtonClicked: {inAppMessage.Message} {inAppMessageButton}");
}

public void OnPresetUserDataClick() {
Appboy.AppboyBinding.SetUserFirstName("jared");
Appboy.AppboyBinding.SetUserLastName("contreras");
Expand Down
Loading

0 comments on commit 5d89edb

Please sign in to comment.