Skip to content

Commit

Permalink
Merge pull request #39 from CleverTap/develop
Browse files Browse the repository at this point in the history
 SDK-2868/Dismiss_AppInbox
  • Loading branch information
william-ct authored Apr 13, 2023
2 parents 9391d20 + f343376 commit ce52e83
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Change Log
==========

Version 2.3.1 *(11 April, 2023)*
Version 2.3.1 *(13 April, 2023)*
-------------------------------------------
- Updated to [CleverTap Android SDK v4.6.9](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev4.6.9)
- Updated to [CleverTap iOS SDK v4.2.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/4.2.2)
- Fixes `CreateNotificationChannelWithSound`, `CreateNotificationChannelWithGroup`, `CreateNotificationChannelWithGroupAndSound` - Only for Android
- Updates the callback `CleverTapInboxItemClicked` to receive inbox item click with item payload and index.
- Updates the callback `CleverTapInboxItemClicked` to receive inbox item click with item payload.The `ContentPageIndex` corresponds the index of the item clicked in the list whereas the `ButtonIndex` for the App Inbox button clicked (0, 1, or 2). A value of -1 indicates the App Inbox item is clicked.
- Adds `DismissAppInbox` to dismiss the App Inbox.

Version 2.3.0 *(16 March, 2023)*
-------------------------------------------
Expand Down
Binary file modified CleverTapUnityPlugin.unitypackage
Binary file not shown.
Binary file modified Plugin/CleverTapUnity/Android/clevertapsdk-unity-2.3.1.aar
Binary file not shown.
14 changes: 14 additions & 0 deletions Plugin/CleverTapUnity/CleverTapUnity-Scripts/CleverTapBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ void Start() {
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void CleverTap_showAppInbox(string styleConfig);

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void CleverTap_dismissAppInbox();

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern int CleverTap_getInboxMessageCount();

Expand Down Expand Up @@ -453,6 +456,10 @@ public static void ShowAppInbox(Dictionary<string, object> styleConfig) {
CleverTap_showAppInbox(styleConfigString);
}

public static void DismissAppInbox() {
CleverTap_dismissAppInbox();
}

public static int GetInboxMessageCount() {
return CleverTap_getInboxMessageCount();
}
Expand Down Expand Up @@ -953,6 +960,10 @@ public static void ShowAppInbox(string styleConfig){
CleverTap.Call("showAppInbox", styleConfig);
}

public static void DismissAppInbox(){
CleverTap.Call("dismissAppInbox");
}

public static int GetInboxMessageCount(){
return CleverTap.Call<int>("getInboxMessageCount");
}
Expand Down Expand Up @@ -1144,6 +1155,9 @@ public static void InitializeInbox(){
public static void ShowAppInbox(string styleConfig){
}

public static void DismissAppInbox(){
}

public static int GetInboxMessageCount(){
return -1;
}
Expand Down
4 changes: 4 additions & 0 deletions Plugin/CleverTapUnity/iOS/CleverTapBinding.m
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ void CleverTap_showAppInbox(const char* styleConfig) {
[[CleverTapUnityManager sharedInstance] showAppInbox: styleConfigDict];
}

void CleverTap_dismissAppInbox() {
[[CleverTapUnityManager sharedInstance] dismissAppInbox];
}

char* CleverTap_getAllInboxMessages() {
id ret = [[CleverTapUnityManager sharedInstance] getAllInboxMessages];
NSString *jsonString = clevertap_toJsonString(ret);
Expand Down
1 change: 1 addition & 0 deletions Plugin/CleverTapUnity/iOS/CleverTapUnityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@

- (void)initializeInbox;
- (void)showAppInbox:(NSDictionary *)styleConfig;
- (void)dismissAppInbox;
- (int)getInboxMessageUnreadCount;
- (int)getInboxMessageCount;
- (NSArray *)getAllInboxMessages;
Expand Down
4 changes: 4 additions & 0 deletions Plugin/CleverTapUnity/iOS/CleverTapUnityManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ - (void)showAppInbox:(NSDictionary *)styleConfig {
}
}

- (void)dismissAppInbox {
[clevertap dismissAppInbox];
}

- (CleverTapInboxStyleConfig *)_dictToInboxStyleConfig: (NSDictionary *)dict {
CleverTapInboxStyleConfig *_config = [CleverTapInboxStyleConfig new];
NSString *title = [dict valueForKey:@"navBarTitle"];
Expand Down
6 changes: 6 additions & 0 deletions docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ void LaunchInbox()
CleverTapBinding.ShowAppInbox("");
}
```

#### Dismiss the App Inbox

```
CleverTapBinding.DismissAppInbox();
```
## Enable Debugging

#### Set Debug Level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public void suspendInAppNotifications(){
try {
clevertap.suspendInAppNotifications();
} catch (Throwable t) {
Log.e(LOG_TAG, "recordScreenView error", t);
Log.e(LOG_TAG, "Unable to suspendInAppNotification", t);
}
}

Expand All @@ -475,7 +475,7 @@ public void discardInAppNotifications(){
try {
clevertap.discardInAppNotifications();
} catch (Throwable t) {
Log.e(LOG_TAG, "recordScreenView error", t);
Log.e(LOG_TAG, "Unable to discardInAppNotification", t);
}
}

Expand All @@ -484,7 +484,7 @@ public void resumeInAppNotifications(){
try {
clevertap.resumeInAppNotifications();
} catch (Throwable t) {
Log.e(LOG_TAG, "recordScreenView error", t);
Log.e(LOG_TAG, "Unable to resumeInAppNotification", t);
}
}

Expand Down Expand Up @@ -610,6 +610,14 @@ public void showAppInbox(final String jsonString) {
}
}

public void dismissAppInbox() {
try {
clevertap.dismissAppInbox();
} catch (Throwable t) {
Log.e(LOG_TAG, "Unable to dismissAppInbox", t);
}
}

public String getAllInboxMessages() {
try {
return inboxMessageListToJSONArray(clevertap.getAllInboxMessages()).toString();
Expand Down

0 comments on commit ce52e83

Please sign in to comment.