Skip to content

Commit

Permalink
Merge pull request #43 from CleverTap/feat/SDK-2805-iOS-push-primer-s…
Browse files Browse the repository at this point in the history
…upport

Added `markReadInboxMessages` api to mark multiple inbox messages as …
  • Loading branch information
kushCT authored May 15, 2023
2 parents 927b3c8 + f818a76 commit 8160b2c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ void Start() {
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void CleverTap_markReadInboxMessageForID(string messageId);

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void CleverTap_markReadInboxMessagesForIDs(string[] messageIds,int arrLength);

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

Expand Down Expand Up @@ -526,6 +529,11 @@ public static void MarkReadInboxMessageForID(string messageId) {
CleverTap_markReadInboxMessageForID(messageId);
}

public static void MarkReadInboxMessagesForIDs(string[] messageIds) {
int arrLength = messageIds.Length;
CleverTap_MarkReadInboxMessagesForIDs(messageIds, arrLength);
}

public static void RecordInboxNotificationViewedEventForID(string messageId) {
CleverTap_recordInboxNotificationViewedEventForID(messageId);
}
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 @@ -458,6 +458,10 @@ void CleverTap_markReadInboxMessageForID(const char* messageId) {
[[CleverTapUnityManager sharedInstance] markReadInboxMessageForID:clevertap_stringToNSString(messageId)];
}

void CleverTap_markReadInboxMessagesForIDs(const char* messageIds[], int size) {
[[CleverTapUnityManager sharedInstance] markReadInboxMessagesForIDs:clevertap_NSArrayFromArray(messageIds, size)];
}

void CleverTap_recordInboxNotificationViewedEventForID(const char* messageId) {
[[CleverTapUnityManager sharedInstance] recordInboxNotificationViewedEventForID:clevertap_stringToNSString(messageId)];
}
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 @@ -96,6 +96,7 @@
- (void)deleteInboxMessageForID:(NSString *)messageId;
- (void)deleteInboxMessagesForIDs:(NSArray *)messageIds;
- (void)markReadInboxMessageForID:(NSString *)messageId;
- (void)markReadInboxMessagesForIDs:(NSArray *)messageIds;
- (void)recordInboxNotificationViewedEventForID:(NSString *)messageId;
- (void)recordInboxNotificationClickedEventForID:(NSString *)messageId;

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 @@ -543,6 +543,10 @@ - (void)markReadInboxMessageForID:(NSString *)messageId {
[clevertap markReadInboxMessageForID:messageId];
}

- (void)markReadInboxMessagesForIDs:(NSArray *)messageIds {
[clevertap markReadInboxMessagesForIDs:messageIds];
}

- (void)recordInboxNotificationViewedEventForID:(NSString *)messageId {

[clevertap recordInboxNotificationViewedEventForID:messageId];
Expand Down

0 comments on commit 8160b2c

Please sign in to comment.