Skip to content

Commit

Permalink
Merge pull request #37 from CleverTap/develop
Browse files Browse the repository at this point in the history
SDK-2868/Release v2.3.1
  • Loading branch information
william-ct authored Apr 11, 2023
2 parents 70d8188 + 986831f commit 9391d20
Show file tree
Hide file tree
Showing 59 changed files with 95 additions and 27 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
==========

Version 2.3.1 *(11 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.

Version 2.3.0 *(16 March, 2023)*
-------------------------------------------
- Updated to [CleverTap Android SDK v4.6.7](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev4.6.7_ptv1.0.5.1)
Expand Down
Binary file modified CleverTapUnityPlugin.unitypackage
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace CleverTap {
public class CleverTapBinding : MonoBehaviour {

public const string Version = "2.3.0";
public const string Version = "2.3.1";

#if UNITY_IOS
void Start() {
Expand Down Expand Up @@ -676,17 +676,17 @@ public static void CreateNotificationChannel(string channelId,string channelName

public static void CreateNotificationChannelWithSound(string channelId,string channelName, string channelDescription, int importance, bool showBadge, string sound){
AndroidJavaObject context = unityCurrentActivity.Call<AndroidJavaObject>("getApplicationContext");
CleverTapAPI.CallStatic("createNotificationChannel",context,channelId,channelName,channelDescription,importance,showBadge,sound);
CleverTapAPI.CallStatic("createNotificationChannelWithSound",context,channelId,channelName,channelDescription,importance,showBadge,sound);
}

public static void CreateNotificationChannelWithGroup(string channelId,string channelName, string channelDescription, int importance, string groupId, bool showBadge){
AndroidJavaObject context = unityCurrentActivity.Call<AndroidJavaObject>("getApplicationContext");
CleverTapAPI.CallStatic("createNotificationChannelwithGroup",context,channelId,channelName,channelDescription,importance,groupId,showBadge);
CleverTapAPI.CallStatic("createNotificationChannelWithGroup",context,channelId,channelName,channelDescription,importance,groupId,showBadge);
}

public static void CreateNotificationChannelWithGroupAndSound(string channelId,string channelName, string channelDescription, int importance, string groupId, bool showBadge, string sound){
AndroidJavaObject context = unityCurrentActivity.Call<AndroidJavaObject>("getApplicationContext");
CleverTapAPI.CallStatic("createNotificationChannelwithGroup",context,channelId,channelName,channelDescription,importance,groupId,showBadge,sound);
CleverTapAPI.CallStatic("createNotificationChannelWithGroupAndSound",context,channelId,channelName,channelDescription,importance,groupId,showBadge,sound);
}

public static void CreateNotificationChannelGroup(string groupId, string groupName){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void CleverTapInboxMessagesDidUpdateCallback(){
void CleverTapInboxCustomExtrasButtonSelect(string message) {
Debug.Log("unity received inbox message button with custom extras select: " + (!String.IsNullOrEmpty(message) ? message : "NULL"));
}
// returns on the click of app inbox message with a map of custom Key-Value pairs
// returns on the click of app inbox message with a string of the inbox payload along with page index and button index
void CleverTapInboxItemClicked(string message)
{
Debug.Log("unity received inbox message selected callback: " + (!String.IsNullOrEmpty(message) ? message : "NULL"));
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Plugin/CleverTapUnity/iOS/CleverTapSDK.framework/CleverTapSDK
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ typedef void (^CleverTapInboxUpdatedBlock)(void);

- (void)markReadInboxMessageForID:(NSString * _Nonnull)messageId;

/*!
@method
@abstract
This method marks the `CleverTapInboxMessage` object as read for given 'Message Ids` as Collection.
*/

- (void)markReadInboxMessagesForIDs:(NSArray<NSString *> *_Nonnull)messageIds;

/*!
@method
Expand Down Expand Up @@ -242,5 +251,12 @@ typedef void (^CleverTapInboxUpdatedBlock)(void);
*/
- (void)recordInboxNotificationClickedEventForID:(NSString * _Nonnull)messageId;

/*!
@method
@abstract
This method dismisses the inbox controller
*/
- (void)dismissAppInbox;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,17 @@ typedef NS_ENUM(int, CTSignedCallEvent) {
*/
extern NSString * _Nonnull const CleverTapGeofencesDidUpdateNotification;

/*!
@method
@abstract
Enables the location API
@discussion
Call this method (typically once at app launch) to enable the location API.
*/
+ (void)enableLocation:(BOOL)enabled;

/*!
@method
Expand Down Expand Up @@ -1263,7 +1274,7 @@ extern NSString * _Nonnull const CleverTapProfileDidInitializeNotification;
#if defined(CLEVERTAP_HOST_WATCHOS)
/** HostWatchOS
*/
- (BOOL)handleMessage:(NSDictionary<NSString *, id> *)message forWatchSession:(WCSession *)session API_AVAILABLE(ios(9.0));
- (BOOL)handleMessage:(NSDictionary<NSString *, id> *_Nonnull)message forWatchSession:(WCSession *_Nonnull)session API_AVAILABLE(ios(9.0));
#endif

/*!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

#define WR_SDK_REVISION @"40106"
#define WR_SDK_REVISION @"40202"

Binary file not shown.
Binary file modified Plugin/CleverTapUnity/iOS/CleverTapSDK.framework/Info.plist
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@
- (void)forceNewDeviceID;
- (void)forceUpdateCustomDeviceID:(NSString *)cleverTapID;
- (BOOL)isErrorDeviceID;
- (void)incrementLocalInAppCount;
- (int)getLocalInAppCount;
- (void)setSignedCallSDKVersion: (NSString *)version;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
@protocol CTInAppNotificationDisplayDelegate <NSObject>
- (void)handleNotificationCTA:(NSURL*)ctaURL buttonCustomExtras:(NSDictionary *)buttonCustomExtras forNotification:(CTInAppNotification*)notification fromViewController:(CTInAppDisplayViewController*)controller withExtras:(NSDictionary*)extras;
- (void)notificationDidDismiss:(CTInAppNotification*)notification fromViewController:(CTInAppDisplayViewController*)controller;
/**
Called when in-app button is tapped for requesting push permission.
*/
- (void)handleInAppPushPrimer:(CTInAppNotification*)notification
fromViewController:(CTInAppDisplayViewController*)controller
withFallbackToSettings:(BOOL)isFallbackToSettings;

/**
Called to notify that local in-app push primer is dismissed.
*/
- (void)inAppPushPrimerDidDismissed;
@optional
- (void)notificationDidShow:(CTInAppNotification*)notification fromViewController:(CTInAppDisplayViewController*)controller;
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
@property (nonatomic, copy, readonly) NSDictionary *customExtras;
@property (nonatomic, copy, readwrite) NSDictionary *actionExtras;

@property (nonatomic, readonly) BOOL isLocalInApp;
@property (nonatomic, readonly) BOOL isPushSettingsSoftAlert;
@property (nonatomic, readonly) BOOL fallBackToNotificationSettings;
@property (nonatomic, readonly) BOOL skipSettingsAlert;

- (instancetype)init __unavailable;
- (instancetype)initWithJSON:(NSDictionary*)json;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)deleteMessageWithId:(NSString *)messageId;
- (void)deleteMessagesWithId:(NSArray *_Nonnull)messageIds;
- (void)markReadMessageWithId:(NSString *)messageId;
- (void)markReadMessagesWithId:(NSArray *_Nonnull)messageIds;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

@interface CTLocationManager : NSObject

#if defined(CLEVERTAP_LOCATION)
+ (void)getLocationWithSuccess:(void (^)(CLLocationCoordinate2D location))success andError:(void (^)(NSString *reason))error;
#endif

@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
@property (nonatomic, copy, readonly) NSString *borderRadius;
@property (nonatomic, copy, readonly) NSString *borderColor;
@property (nonatomic, copy, readonly) NSDictionary *customExtras;
@property (nonatomic, copy, readonly) NSString *type;
@property (nonatomic, readonly) BOOL fallbackToSettings;

@property (nonatomic, copy, readonly) NSString *backgroundColor;
@property (nonatomic, readonly) NSURL *actionURL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
+ (instancetype _Nullable)sharedInstance;
- (void)setCredentialsWithAccountID:(NSString * _Nonnull)accountID token:(NSString * _Nonnull)token region:(NSString * _Nullable)region;
- (void)setCredentialsWithAccountID:(NSString * _Nonnull)accountID token:(NSString * _Nonnull)token proxyDomain:(NSString * _Nonnull)proxyDomain;
- (void)setCredentialsWithAccountID:(NSString * _Nonnull)accountID token:(NSString * _Nonnull)token proxyDomain:(NSString * _Nonnull)proxyDomain spikyProxyDomain:(NSString * _Nonnull)spikyProxyDomain;
- (void)setCredentialsWithAccountID:(NSString * _Nonnull)accountID token:(NSString * _Nonnull)token proxyDomain:(NSString * _Nonnull)proxyDomain spikyProxyDomain:(NSString * _Nullable)spikyProxyDomain;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

+ (void)putInt:(long)resetValue forKey:(NSString *_Nonnull)key;

+ (NSString *_Nonnull)getStringForKey:(NSString *_Nonnull)key withResetValue:(NSString *_Nullable)resetValue;
+ (NSString *_Nullable)getStringForKey:(NSString *_Nonnull)key withResetValue:(NSString *_Nullable)resetValue;

+ (void)putString:(NSString *_Nonnull)resetValue forKey:(NSString *_Nonnull)key;

Expand All @@ -17,12 +17,12 @@

+ (void)removeObjectForKey:(NSString *_Nonnull)key;

+ (id _Nonnull)unarchiveFromFile:(NSString *_Nonnull)filename ofType:(Class _Nonnull)cls removeFile:(BOOL)remove;
+ (id _Nullable)unarchiveFromFile:(NSString *_Nonnull)filename ofType:(Class _Nonnull)cls removeFile:(BOOL)remove;

+ (id _Nonnull)unarchiveFromFile:(NSString *_Nonnull)filename ofTypes:(nonnull NSSet<Class> *)classes removeFile:(BOOL)remove;
+ (id _Nullable)unarchiveFromFile:(NSString *_Nonnull)filename ofTypes:(nonnull NSSet<Class> *)classes removeFile:(BOOL)remove;

+ (BOOL)archiveObject:(id _Nonnull)object forFileName:(NSString *_Nonnull)fileName;

+ (NSString *)storageKeyWithSuffix: (NSString *)suffix config: (CleverTapInstanceConfig*)config;
+ (NSString * _Nonnull)storageKeyWithSuffix: (NSString * _Nonnull)suffix config: (CleverTapInstanceConfig* _Nonnull)config;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NS_ASSUME_NONNULL_BEGIN

@interface CTUserMO (CoreDataProperties)

+ (instancetype)fetchOrCreateFromJSON:(NSDictionary *)json forContext:(NSManagedObjectContext *)context;
+ (instancetype _Nullable)fetchOrCreateFromJSON:(NSDictionary *)json forContext:(NSManagedObjectContext *)context;
- (BOOL)updateMessages:(NSArray<NSDictionary*> *)messages forContext:(NSManagedObjectContext *)context;

@property (nullable, nonatomic, copy) NSString *accountId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
@required
- (void)messageDidShow:(CleverTapInboxMessage * _Nonnull)message;
- (void)messageDidSelect:(CleverTapInboxMessage * _Nonnull)message atIndex:(int)index withButtonIndex:(int)buttonIndex;
/**
Called when app inbox link is tapped for requesting push permission.
*/
- (void)messageDidSelectForPushPermission:(BOOL)fallbackToSettings;
@end

@interface CleverTapInboxViewController ()
Expand Down
15 changes: 9 additions & 6 deletions Plugin/CleverTapUnity/iOS/CleverTapUnityManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -559,15 +559,18 @@ - (void)messageButtonTappedWithCustomExtras:(NSDictionary *)customExtras {
}

- (void)messageDidSelect:(CleverTapInboxMessage *_Nonnull)message atIndex:(int)index withButtonIndex:(int)buttonIndex {
NSMutableDictionary *body = [NSMutableDictionary new];
if ([message json] != nil) {
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[message json]
options:0
error:&error];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
if ([message json] != nil) {
body[@"CTInboxMessagePayload"] = [NSMutableDictionary dictionaryWithDictionary:[message json]];
}
body[@"ContentPageIndex"] = @(index);
body[@"ButtonIndex"] = @(buttonIndex);
NSString *jsonString = [self dictToJson:body];
if (jsonString != nil) {
[self callUnityObject:kCleverTapGameObjectName forMethod:kCleverTapInboxItemClicked withMessage:jsonString];
}
[self callUnityObject:kCleverTapGameObjectName forMethod:kCleverTapInboxItemClicked withMessage:jsonString];
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/CleverTapUnity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void CleverTapInAppNotificationDismissedCallback(string message)
{
Debug.Log("unity received inapp notification dismissed: " + (!String.IsNullOrEmpty(message) ? message : "NULL"));
}
//returns data associated with inbox message item click
//returns data associated with inbox message item click along with page index and button index
void CleverTapInboxItemClicked(string message)
{
Debug.Log("unity received inbox message clicked callback: " + (!String.IsNullOrEmpty(message) ? message : "NULL"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ext {
targetSdkVersionVal = compileSdkVersionVal
buildToolsVersionVal = "30.0.3"

libraryVersion = "2.3.0"
libraryVersion = "2.3.1"
}

android {
Expand Down Expand Up @@ -51,7 +51,7 @@ dependencies {
// This will add classes from com.unity3d.player to our library which will allow the ClevertapPlugin.java class to get access to current unity activity and work on it accordingly
compileOnly fileTree('libs')

implementation 'com.clevertap.android:clevertap-android-sdk:4.6.7'
implementation 'com.clevertap.android:clevertap-android-sdk:4.6.9'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -818,10 +818,18 @@ public void onInboxButtonClick(HashMap<String, String> payload) {
}


public void onInboxItemClicked(CTInboxMessage message) {
public void onInboxItemClicked(CTInboxMessage message, int contentPageIndex, int buttonIndex) {
if (message != null && message.getData() != null) {
final String json = "{inbox button payload:" + message.getData().toString() + "}";
messageUnity(CLEVERTAP_GAME_OBJECT_NAME, CLEVERTAP_ON_INBOX_ITEM_CLICKED, json);
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("ContentPageIndex",contentPageIndex);
jsonObject.put("ButtonIndex",buttonIndex);
jsonObject.put("CTInboxMessagePayload",message.getData());
messageUnity(CLEVERTAP_GAME_OBJECT_NAME, CLEVERTAP_ON_INBOX_ITEM_CLICKED,
jsonObject.toString());
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
}

Expand Down

0 comments on commit 9391d20

Please sign in to comment.