clevertap-react-native 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/android/build.gradle +3 -3
- package/android/local.properties +2 -2
- package/android/src/main/java/com/clevertap/react/CleverTapModule.java +37 -4
- package/clevertap-react-native.podspec +1 -1
- package/docs/install.md +29 -13
- package/index.d.ts +5 -3
- package/index.js +14 -6
- package/ios/CleverTapReact/CleverTapReact.h +2 -0
- package/ios/CleverTapReact/CleverTapReact.m +21 -2
- package/ios/CleverTapReact/CleverTapReactEventEmitter.m +7 -2
- package/package.json +1 -1
- package/android/.gradle/6.1.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.1.1/fileContent/fileContent.lock +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.1.1/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/6.1.1/gc.properties +0 -0
- package/android/.gradle/6.1.1/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/6.1.1/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/6.1.1/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/6.1.1/javaCompile/taskHistory.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/android.iml +0 -39
- package/android/build/generated/source/buildConfig/debug/com/clevertap/react/BuildConfig.java +0 -12
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -14
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -27
- package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/annotations_typedef_file/debug/typedefs.txt +0 -0
- package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -5698
- package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapApplication$1$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapApplication$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapApplication.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$ErrorMessages.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$InBoxMessages.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapUtils.class +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -14
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -17
- package/android/build/intermediates/merged_java_res/debug/out.jar +0 -0
- package/android/build/intermediates/merged_manifests/debug/output.json +0 -27
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -3940
- package/android/build/outputs/aar/android-debug.aar +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -39
- package/android/clevertap-react-native.iml +0 -253
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
==========
|
|
3
|
+
|
|
4
|
+
Version 0.9.2 *(7 October 2022)*
|
|
5
|
+
-------------------------------------------
|
|
6
|
+
- Supports [CleverTap iOS SDK v4.1.2](https://github.com/CleverTap/clevertap-ios-sdk/blob/master/CHANGELOG.md#version-412-september-16-2022) and associated enhancements
|
|
7
|
+
- Supports App Inbox Message tapped listener: `CleverTap.CleverTapInboxMessageTapped`
|
|
8
|
+
|
|
9
|
+
Version 0.9.1 *(21 September 2022)*
|
|
10
|
+
-------------------------------------------
|
|
11
|
+
- Supports CleverTap Android Core SDK [v4.6.3](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md) and associated enhancements
|
|
12
|
+
- Supports CleverTap Android Push Templates SDK [v1.0.5](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTPUSHTEMPLATESCHANGELOG.md) and associated enhancements
|
|
13
|
+
- Supports CleverTap Android HMS SDK [v1.3.1](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTHUAWEIPUSHCHANGELOG.md) and associated enhancements
|
|
14
|
+
- Supports CleverTap Android XPS SDK [v1.5.0](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTXIAOMIPUSHCHANGELOG.md) and associated Android 12, Region Changes and other enhancements
|
|
15
|
+
|
|
3
16
|
Version 0.9.0 *(23rd August 2022)*
|
|
4
17
|
-------------------------------------------
|
|
5
18
|
- Supports [CleverTap Android SDK v4.6.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev4.6.0_ptv1.0.4)
|
package/android/build.gradle
CHANGED
|
@@ -21,8 +21,8 @@ android {
|
|
|
21
21
|
defaultConfig {
|
|
22
22
|
minSdkVersion 16
|
|
23
23
|
targetSdkVersion 31
|
|
24
|
-
versionCode
|
|
25
|
-
versionName "0.9.
|
|
24
|
+
versionCode 92
|
|
25
|
+
versionName "0.9.2"
|
|
26
26
|
}
|
|
27
27
|
buildTypes {
|
|
28
28
|
release {
|
|
@@ -39,7 +39,7 @@ dependencies {
|
|
|
39
39
|
maven { url "$rootDir/../node_modules/react-native/android" }
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
api 'com.clevertap.android:clevertap-android-sdk:4.6.
|
|
42
|
+
api 'com.clevertap.android:clevertap-android-sdk:4.6.3'
|
|
43
43
|
implementation 'com.android.installreferrer:installreferrer:2.2'
|
|
44
44
|
//compile 'com.android.support:appcompat-v7:28.0.0'
|
|
45
45
|
implementation 'com.facebook.react:react-native:+'
|
package/android/local.properties
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
# Location of the SDK. This is only used by Gradle.
|
|
5
5
|
# For customization when using a Version Control System, please read the
|
|
6
6
|
# header note.
|
|
7
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Wed Sep 07 13:41:26 IST 2022
|
|
8
|
+
sdk.dir=/Users/ansh/Library/Android/sdk
|
|
@@ -7,6 +7,7 @@ import android.net.Uri;
|
|
|
7
7
|
import android.os.Build.VERSION;
|
|
8
8
|
import android.os.Build.VERSION_CODES;
|
|
9
9
|
import android.os.Bundle;
|
|
10
|
+
import android.text.TextUtils;
|
|
10
11
|
import android.util.Log;
|
|
11
12
|
import androidx.annotation.RequiresApi;
|
|
12
13
|
import com.clevertap.android.sdk.CTFeatureFlagsListener;
|
|
@@ -16,6 +17,8 @@ import com.clevertap.android.sdk.CleverTapAPI;
|
|
|
16
17
|
import com.clevertap.android.sdk.InAppNotificationButtonListener;
|
|
17
18
|
import com.clevertap.android.sdk.InAppNotificationListener;
|
|
18
19
|
import com.clevertap.android.sdk.InboxMessageButtonListener;
|
|
20
|
+
import com.clevertap.android.sdk.InboxMessageListener;
|
|
21
|
+
import com.clevertap.android.sdk.Logger;
|
|
19
22
|
import com.clevertap.android.sdk.SyncListener;
|
|
20
23
|
import com.clevertap.android.sdk.UTMDetail;
|
|
21
24
|
import com.clevertap.android.sdk.displayunits.DisplayUnitListener;
|
|
@@ -55,7 +58,7 @@ import org.json.JSONObject;
|
|
|
55
58
|
@SuppressWarnings({"unused", "RedundantSuppression"})
|
|
56
59
|
public class CleverTapModule extends ReactContextBaseJavaModule implements SyncListener,
|
|
57
60
|
InAppNotificationListener, CTInboxListener,
|
|
58
|
-
InboxMessageButtonListener,
|
|
61
|
+
InboxMessageButtonListener, InboxMessageListener,
|
|
59
62
|
InAppNotificationButtonListener, DisplayUnitListener, CTProductConfigListener,
|
|
60
63
|
CTFeatureFlagsListener, CTPushNotificationListener {
|
|
61
64
|
|
|
@@ -114,6 +117,7 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
114
117
|
private static final String CLEVERTAP_INBOX_MESSAGES_DID_UPDATE = "CleverTapInboxMessagesDidUpdate";
|
|
115
118
|
|
|
116
119
|
private static final String CLEVERTAP_ON_INBOX_BUTTON_CLICK = "CleverTapInboxMessageButtonTapped";
|
|
120
|
+
private static final String CLEVERTAP_ON_INBOX_MESSAGE_CLICK = "CleverTapInboxMessageTapped";
|
|
117
121
|
|
|
118
122
|
private static final String CLEVERTAP_ON_INAPP_BUTTON_CLICK = "CleverTapInAppNotificationButtonTapped";
|
|
119
123
|
|
|
@@ -459,6 +463,7 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
459
463
|
constants.put(CLEVERTAP_INBOX_DID_INITIALIZE, CLEVERTAP_INBOX_DID_INITIALIZE);
|
|
460
464
|
constants.put(CLEVERTAP_INBOX_MESSAGES_DID_UPDATE, CLEVERTAP_INBOX_MESSAGES_DID_UPDATE);
|
|
461
465
|
constants.put(CLEVERTAP_ON_INBOX_BUTTON_CLICK, CLEVERTAP_ON_INBOX_BUTTON_CLICK);
|
|
466
|
+
constants.put(CLEVERTAP_ON_INBOX_MESSAGE_CLICK, CLEVERTAP_ON_INBOX_MESSAGE_CLICK);
|
|
462
467
|
constants.put(CLEVERTAP_ON_DISPLAY_UNITS_LOADED, CLEVERTAP_ON_DISPLAY_UNITS_LOADED);
|
|
463
468
|
constants.put(CLEVERTAP_ON_INAPP_BUTTON_CLICK, CLEVERTAP_ON_INAPP_BUTTON_CLICK);
|
|
464
469
|
constants.put(CLEVERTAP_FEATURE_FLAGS_DID_UPDATE, CLEVERTAP_FEATURE_FLAGS_DID_UPDATE);
|
|
@@ -724,6 +729,15 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
724
729
|
sendEvent(CLEVERTAP_ON_INBOX_BUTTON_CLICK, getWritableMapFromMap(payload));
|
|
725
730
|
|
|
726
731
|
}
|
|
732
|
+
@Override
|
|
733
|
+
public void onInboxItemClicked(CTInboxMessage message){
|
|
734
|
+
WritableMap params = Arguments.createMap();
|
|
735
|
+
JSONObject data = message.getData();
|
|
736
|
+
if (data != null) {
|
|
737
|
+
params.putString("data", data.toString());
|
|
738
|
+
}
|
|
739
|
+
sendEvent(CLEVERTAP_ON_INBOX_MESSAGE_CLICK,params);
|
|
740
|
+
}
|
|
727
741
|
|
|
728
742
|
//Product Config Callback
|
|
729
743
|
@Override
|
|
@@ -1199,6 +1213,7 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
1199
1213
|
|
|
1200
1214
|
@ReactMethod
|
|
1201
1215
|
public void setPushTokenAsString(String token, String type) {
|
|
1216
|
+
Logger.v("setPushTokenAsString() called with: token = [" + token + "], type = [" + type + "]");
|
|
1202
1217
|
CleverTapAPI clevertap = getCleverTapAPI();
|
|
1203
1218
|
if (clevertap == null || token == null || type == null) {
|
|
1204
1219
|
return;
|
|
@@ -1208,9 +1223,6 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
1208
1223
|
case FCM:
|
|
1209
1224
|
clevertap.pushFcmRegistrationId(token, true);
|
|
1210
1225
|
break;
|
|
1211
|
-
case XPS:
|
|
1212
|
-
clevertap.pushXiaomiRegistrationId(token, true);
|
|
1213
|
-
break;
|
|
1214
1226
|
case BPS:
|
|
1215
1227
|
clevertap.pushBaiduRegistrationId(token, true);
|
|
1216
1228
|
break;
|
|
@@ -1223,6 +1235,26 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
1223
1235
|
}
|
|
1224
1236
|
}
|
|
1225
1237
|
|
|
1238
|
+
@ReactMethod
|
|
1239
|
+
public void setPushTokenAsStringWithRegion(String token, String type,String region) {
|
|
1240
|
+
Logger.v( "setPushTokenAsString() called with: token = [" + token + "], type = [" + type + "], region = [" + region + "]");
|
|
1241
|
+
|
|
1242
|
+
CleverTapAPI clevertap = getCleverTapAPI();
|
|
1243
|
+
if (clevertap == null || token == null || type == null || TextUtils.isEmpty(region)) {
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
switch (type) {
|
|
1248
|
+
case XPS:
|
|
1249
|
+
clevertap.pushXiaomiRegistrationId(token,region,true);
|
|
1250
|
+
break;
|
|
1251
|
+
default:
|
|
1252
|
+
Log.e(TAG, "Unknown push token type " + type);
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
|
|
1226
1258
|
@ReactMethod
|
|
1227
1259
|
public void showInbox(ReadableMap styleConfig) {
|
|
1228
1260
|
CTInboxStyleConfig inboxStyleConfig = styleConfigFromReadableMap(styleConfig);
|
|
@@ -1350,6 +1382,7 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
1350
1382
|
clevertap.setSyncListener(this);
|
|
1351
1383
|
clevertap.setCTNotificationInboxListener(this);
|
|
1352
1384
|
clevertap.setInboxMessageButtonListener(this);
|
|
1385
|
+
clevertap.setCTInboxMessageListener(this);
|
|
1353
1386
|
clevertap.setInAppNotificationButtonListener(this);
|
|
1354
1387
|
clevertap.setDisplayUnitListener(this);
|
|
1355
1388
|
clevertap.setCTProductConfigListener(this);
|
|
@@ -18,6 +18,6 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.preserve_paths = 'LICENSE.md', 'README.md', 'package.json', 'index.js'
|
|
19
19
|
s.source_files = 'ios/CleverTapReact/*.{h,m}'
|
|
20
20
|
|
|
21
|
-
s.dependency 'CleverTap-iOS-SDK', '4.
|
|
21
|
+
s.dependency 'CleverTap-iOS-SDK', '4.1.2'
|
|
22
22
|
s.dependency 'React-Core'
|
|
23
23
|
end
|
package/docs/install.md
CHANGED
|
@@ -60,22 +60,38 @@ If you're on RN 0.60 or your project configuration doesn't allow to add `use_fra
|
|
|
60
60
|
```gradle
|
|
61
61
|
dependencies {
|
|
62
62
|
...
|
|
63
|
-
|
|
63
|
+
//androidx
|
|
64
|
+
implementation 'androidx.core:core:1.3.0'
|
|
65
|
+
implementation 'androidx.appcompat:appcompat:1.3.1' //Mandatory for App Inbox
|
|
66
|
+
implementation 'androidx.fragment:fragment:1.3.6' //Mandatory for InApp
|
|
67
|
+
implementation 'androidx.recyclerview:recyclerview:1.2.1' //Mandatory for App Inbox
|
|
68
|
+
implementation 'androidx.viewpager:viewpager:1.0.0' //Mandatory for App Inbox
|
|
69
|
+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
|
70
|
+
|
|
71
|
+
//com.android
|
|
72
|
+
implementation 'com.android.installreferrer:installreferrer:2.2' //Mandatory for React Native SDK v0.3.9+
|
|
73
|
+
implementation 'com.android.support:multidex:1.0.3'
|
|
74
|
+
|
|
75
|
+
//react-native libs
|
|
76
|
+
implementation "com.facebook.react:react-native:+"
|
|
77
|
+
|
|
78
|
+
//com.google
|
|
64
79
|
implementation 'com.google.android.gms:play-services-base:17.6.0'
|
|
65
80
|
implementation 'com.google.firebase:firebase-messaging:21.0.0'
|
|
66
|
-
implementation 'com.google.android.
|
|
67
|
-
implementation 'com.google.android.exoplayer:exoplayer
|
|
68
|
-
implementation 'com.google.android.exoplayer:exoplayer-
|
|
69
|
-
implementation 'com.
|
|
70
|
-
implementation '
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
implementation '
|
|
75
|
-
|
|
76
|
-
//Mandatory for React Native SDK v0.3.9 and above add the following -
|
|
77
|
-
implementation 'com.android.installreferrer:installreferrer:2.2'
|
|
81
|
+
implementation 'com.google.android.material:material:1.4.0' //Mandatory for App Inbox
|
|
82
|
+
implementation 'com.google.android.exoplayer:exoplayer:2.17.1' //Optional for Audio/Video
|
|
83
|
+
implementation 'com.google.android.exoplayer:exoplayer-hls:2.17.1' //Optional for Audio/Video
|
|
84
|
+
implementation 'com.google.android.exoplayer:exoplayer-ui:2.17.1' //Optional for Audio/Video
|
|
85
|
+
//implementation 'com.google.android.gms:play-services-ads:19.0.1'
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
//clevertap
|
|
89
|
+
implementation 'com.clevertap.android:clevertap-android-sdk:4.6.3'
|
|
90
|
+
|
|
78
91
|
|
|
92
|
+
// other libs
|
|
93
|
+
implementation 'com.github.bumptech.glide:glide:4.12.0' //Mandatory for App Inbox
|
|
94
|
+
|
|
79
95
|
//Note - ExoPlayer dependencies are optional but all 3 are required for Audio/Video Inbox and InApp Messages
|
|
80
96
|
}
|
|
81
97
|
```
|
package/index.d.ts
CHANGED
|
@@ -64,10 +64,12 @@
|
|
|
64
64
|
export function registerForPush(): void;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @param
|
|
67
|
+
* Manually set the push token on the CleverTap user profile
|
|
68
|
+
* @param {string} token - the device token
|
|
69
|
+
* @param {string} type - for Android only, specifying the type of push service token. Values can be CleverTap.FCM for Firebase or CleverTap.XPS for Xiaomi or CleverTap.BPS for Baidu or CleverTap.HPS for Huawei,
|
|
70
|
+
* @param {string} region - for xps only ,to specify the region
|
|
69
71
|
*/
|
|
70
|
-
export function setPushToken(token: string, type: string): void;
|
|
72
|
+
export function setPushToken(token: string, type: string,region?:string): void;
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
* Create Notification Channel for Android O+
|
package/index.js
CHANGED
|
@@ -45,6 +45,7 @@ var CleverTap = {
|
|
|
45
45
|
CleverTapInboxDidInitialize: CleverTapReact.CleverTapInboxDidInitialize,
|
|
46
46
|
CleverTapInboxMessagesDidUpdate: CleverTapReact.CleverTapInboxMessagesDidUpdate,
|
|
47
47
|
CleverTapInboxMessageButtonTapped: CleverTapReact.CleverTapInboxMessageButtonTapped,
|
|
48
|
+
CleverTapInboxMessageTapped:CleverTapReact.CleverTapInboxMessageTapped,
|
|
48
49
|
CleverTapDisplayUnitsLoaded: CleverTapReact.CleverTapDisplayUnitsLoaded,
|
|
49
50
|
CleverTapInAppNotificationButtonTapped: CleverTapReact.CleverTapInAppNotificationButtonTapped,
|
|
50
51
|
CleverTapFeatureFlagsDidUpdate: CleverTapReact.CleverTapFeatureFlagsDidUpdate,
|
|
@@ -104,12 +105,19 @@ var CleverTap = {
|
|
|
104
105
|
},
|
|
105
106
|
|
|
106
107
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
* Manually set the push token on the CleverTap user profile
|
|
109
|
+
* @param {string} token - the device token
|
|
110
|
+
* @param {string} type - for Android only, specifying the type of push service token. Values can be CleverTap.FCM for Firebase or CleverTap.XPS for Xiaomi or CleverTap.BPS for Baidu or CleverTap.HPS for Huawei,
|
|
111
|
+
* @param {string} region - for xps only ,to specify the region
|
|
112
|
+
*/
|
|
113
|
+
setPushToken: function (token, type,region="") {
|
|
114
|
+
console.log(`CleverTap RN | setPushToken | received : token: '${token}' | type:'${type}' | region:'${region}' `)
|
|
115
|
+
if(type === CleverTap.XPS){
|
|
116
|
+
CleverTapReact.setPushTokenAsStringWithRegion(token, type,region);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
CleverTapReact.setPushTokenAsString(token, type);
|
|
120
|
+
}
|
|
113
121
|
},
|
|
114
122
|
|
|
115
123
|
/**
|
|
@@ -7,12 +7,14 @@ static NSString *const kCleverTapInAppNotificationButtonTapped = @"CleverTapInAp
|
|
|
7
7
|
static NSString *const kCleverTapInboxDidInitialize = @"CleverTapInboxDidInitialize";
|
|
8
8
|
static NSString *const kCleverTapInboxMessagesDidUpdate = @"CleverTapInboxMessagesDidUpdate";
|
|
9
9
|
static NSString *const kCleverTapInboxMessageButtonTapped = @"CleverTapInboxMessageButtonTapped";
|
|
10
|
+
static NSString *const kCleverTapInboxMessageTapped = @"CleverTapInboxMessageTapped";
|
|
10
11
|
static NSString *const kCleverTapDisplayUnitsLoaded = @"CleverTapDisplayUnitsLoaded";
|
|
11
12
|
static NSString *const kCleverTapFeatureFlagsDidUpdate = @"CleverTapFeatureFlagsDidUpdate";
|
|
12
13
|
static NSString *const kCleverTapProductConfigDidFetch = @"CleverTapProductConfigDidFetch";
|
|
13
14
|
static NSString *const kCleverTapProductConfigDidActivate = @"CleverTapProductConfigDidActivate";
|
|
14
15
|
static NSString *const kCleverTapProductConfigDidInitialize = @"CleverTapProductConfigDidInitialize";
|
|
15
16
|
static NSString *const kCleverTapPushNotificationClicked = @"CleverTapPushNotificationClicked";
|
|
17
|
+
static NSString *const kXPS = @"XPS";
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
@interface CleverTapReact : NSObject <RCTBridgeModule>
|
|
@@ -33,13 +33,15 @@ RCT_EXPORT_MODULE();
|
|
|
33
33
|
kCleverTapInboxDidInitialize: kCleverTapInboxDidInitialize,
|
|
34
34
|
kCleverTapInboxMessagesDidUpdate: kCleverTapInboxMessagesDidUpdate,
|
|
35
35
|
kCleverTapInboxMessageButtonTapped: kCleverTapInboxMessageButtonTapped,
|
|
36
|
+
kCleverTapInboxMessageTapped: kCleverTapInboxMessageTapped,
|
|
36
37
|
kCleverTapInAppNotificationButtonTapped: kCleverTapInAppNotificationButtonTapped,
|
|
37
38
|
kCleverTapDisplayUnitsLoaded: kCleverTapDisplayUnitsLoaded,
|
|
38
39
|
kCleverTapFeatureFlagsDidUpdate: kCleverTapFeatureFlagsDidUpdate,
|
|
39
40
|
kCleverTapProductConfigDidFetch: kCleverTapProductConfigDidFetch,
|
|
40
41
|
kCleverTapProductConfigDidActivate: kCleverTapProductConfigDidActivate,
|
|
41
42
|
kCleverTapProductConfigDidInitialize: kCleverTapProductConfigDidInitialize,
|
|
42
|
-
kCleverTapPushNotificationClicked: kCleverTapPushNotificationClicked
|
|
43
|
+
kCleverTapPushNotificationClicked: kCleverTapPushNotificationClicked,
|
|
44
|
+
kXPS: kXPS
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
|
|
@@ -90,6 +92,10 @@ RCT_EXPORT_METHOD(setPushTokenAsString:(NSString*)token withType:(NSString *)typ
|
|
|
90
92
|
[[CleverTap sharedInstance] setPushTokenAsString:token];
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
// setPushTokenAsStringWithRegion is a no-op in iOS
|
|
96
|
+
RCT_EXPORT_METHOD(setPushTokenAsStringWithRegion:(NSString*)token withType:(NSString *)type withRegion:(NSString *)region){
|
|
97
|
+
RCTLogInfo(@"[CleverTap setPushTokenAsStringWithRegion is no-op in iOS]");
|
|
98
|
+
}
|
|
93
99
|
|
|
94
100
|
#pragma mark - Personalization
|
|
95
101
|
|
|
@@ -595,11 +601,24 @@ RCT_EXPORT_METHOD(showInbox:(NSDictionary*)styleConfig) {
|
|
|
595
601
|
- (void)messageButtonTappedWithCustomExtras:(NSDictionary *)customExtras {
|
|
596
602
|
NSMutableDictionary *body = [NSMutableDictionary new];
|
|
597
603
|
if (customExtras != nil) {
|
|
598
|
-
body
|
|
604
|
+
body = [NSMutableDictionary dictionaryWithDictionary:customExtras];
|
|
599
605
|
}
|
|
600
606
|
[[NSNotificationCenter defaultCenter] postNotificationName:kCleverTapInboxMessageButtonTapped object:nil userInfo:body];
|
|
601
607
|
}
|
|
602
608
|
|
|
609
|
+
- (void)messageDidSelect:(CleverTapInboxMessage *_Nonnull)message atIndex:(int)index withButtonIndex:(int)buttonIndex {
|
|
610
|
+
NSMutableDictionary *body = [NSMutableDictionary new];
|
|
611
|
+
if ([message json] != nil) {
|
|
612
|
+
NSError *error;
|
|
613
|
+
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[message json]
|
|
614
|
+
options:0
|
|
615
|
+
error:&error];
|
|
616
|
+
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
|
617
|
+
body[@"data"] = jsonString;
|
|
618
|
+
}
|
|
619
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:kCleverTapInboxMessageTapped object:nil userInfo:body];
|
|
620
|
+
}
|
|
621
|
+
|
|
603
622
|
|
|
604
623
|
#pragma mark - Display Units
|
|
605
624
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
RCT_EXPORT_MODULE();
|
|
11
11
|
|
|
12
12
|
- (NSArray<NSString *> *)supportedEvents {
|
|
13
|
-
return @[kCleverTapProfileDidInitialize, kCleverTapProfileSync, kCleverTapInAppNotificationDismissed, kCleverTapInboxDidInitialize, kCleverTapInboxMessagesDidUpdate, kCleverTapInAppNotificationButtonTapped, kCleverTapInboxMessageButtonTapped, kCleverTapDisplayUnitsLoaded, kCleverTapFeatureFlagsDidUpdate, kCleverTapProductConfigDidFetch, kCleverTapProductConfigDidActivate, kCleverTapProductConfigDidInitialize, kCleverTapPushNotificationClicked];
|
|
13
|
+
return @[kCleverTapProfileDidInitialize, kCleverTapProfileSync, kCleverTapInAppNotificationDismissed, kCleverTapInboxDidInitialize, kCleverTapInboxMessagesDidUpdate, kCleverTapInAppNotificationButtonTapped, kCleverTapInboxMessageButtonTapped, kCleverTapInboxMessageTapped, kCleverTapDisplayUnitsLoaded, kCleverTapFeatureFlagsDidUpdate, kCleverTapProductConfigDidFetch, kCleverTapProductConfigDidActivate, kCleverTapProductConfigDidInitialize, kCleverTapPushNotificationClicked];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
@@ -54,7 +54,12 @@ RCT_EXPORT_MODULE();
|
|
|
54
54
|
selector:@selector(emitEventInternal:)
|
|
55
55
|
name:kCleverTapInboxMessageButtonTapped
|
|
56
56
|
object:nil];
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
59
|
+
selector:@selector(emitEventInternal:)
|
|
60
|
+
name:kCleverTapInboxMessageTapped
|
|
61
|
+
object:nil];
|
|
62
|
+
|
|
58
63
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
59
64
|
selector:@selector(emitEventInternal:)
|
|
60
65
|
name:kCleverTapFeatureFlagsDidUpdate
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/android/android.iml
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module external.linked.project.id="android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="FacetManager">
|
|
4
|
-
<facet type="android-gradle" name="Android-Gradle">
|
|
5
|
-
<configuration>
|
|
6
|
-
<option name="GRADLE_PROJECT_PATH" value=":" />
|
|
7
|
-
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="4.2.1" />
|
|
8
|
-
<option name="LAST_KNOWN_AGP_VERSION" value="4.2.1" />
|
|
9
|
-
</configuration>
|
|
10
|
-
</facet>
|
|
11
|
-
<facet type="android" name="Android">
|
|
12
|
-
<configuration>
|
|
13
|
-
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
|
14
|
-
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
|
15
|
-
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
|
16
|
-
<afterSyncTasks>
|
|
17
|
-
<task>generateDebugSources</task>
|
|
18
|
-
</afterSyncTasks>
|
|
19
|
-
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
|
20
|
-
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
|
21
|
-
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
|
22
|
-
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/src/debug/res;file://$MODULE_DIR$/build/generated/res/rs/debug;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
|
|
23
|
-
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/androidTest/res;file://$MODULE_DIR$/src/androidTestDebug/res;file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug;file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" />
|
|
24
|
-
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
|
25
|
-
<option name="PROJECT_TYPE" value="1" />
|
|
26
|
-
</configuration>
|
|
27
|
-
</facet>
|
|
28
|
-
</component>
|
|
29
|
-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
30
|
-
<exclude-output />
|
|
31
|
-
<content url="file://$MODULE_DIR$">
|
|
32
|
-
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
|
33
|
-
<excludeFolder url="file://$MODULE_DIR$/build" />
|
|
34
|
-
<excludeFolder url="file://$MODULE_DIR$/out" />
|
|
35
|
-
</content>
|
|
36
|
-
<orderEntry type="jdk" jdkName="Android API 31 Platform" jdkType="Android SDK" />
|
|
37
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
38
|
-
</component>
|
|
39
|
-
</module>
|
package/android/build/generated/source/buildConfig/debug/com/clevertap/react/BuildConfig.java
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Automatically generated file. DO NOT MODIFY
|
|
3
|
-
*/
|
|
4
|
-
package com.clevertap.react;
|
|
5
|
-
|
|
6
|
-
public final class BuildConfig {
|
|
7
|
-
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
-
public static final String LIBRARY_PACKAGE_NAME = "com.clevertap.react";
|
|
9
|
-
public static final String BUILD_TYPE = "debug";
|
|
10
|
-
public static final int VERSION_CODE = 90;
|
|
11
|
-
public static final String VERSION_NAME = "0.9.0";
|
|
12
|
-
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
package="com.clevertap.react"
|
|
4
|
-
android:versionCode="90"
|
|
5
|
-
android:versionName="0.9.0" >
|
|
6
|
-
|
|
7
|
-
<uses-sdk
|
|
8
|
-
android:minSdkVersion="16"
|
|
9
|
-
android:targetSdkVersion="31" />
|
|
10
|
-
|
|
11
|
-
<application>
|
|
12
|
-
</application>
|
|
13
|
-
|
|
14
|
-
</manifest>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"applicationId": "com.clevertap.react",
|
|
4
|
-
"variantType": "LIBRARY",
|
|
5
|
-
"elements": [
|
|
6
|
-
{
|
|
7
|
-
"outputType": {
|
|
8
|
-
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS"
|
|
9
|
-
},
|
|
10
|
-
"apkData": {
|
|
11
|
-
"type": "MAIN",
|
|
12
|
-
"splits": [],
|
|
13
|
-
"versionCode": 90,
|
|
14
|
-
"versionName": "0.9.0",
|
|
15
|
-
"outputFile": "android-debug.aar",
|
|
16
|
-
"fullName": "debug",
|
|
17
|
-
"baseName": "debug",
|
|
18
|
-
"dirName": ""
|
|
19
|
-
},
|
|
20
|
-
"path": "AndroidManifest.xml",
|
|
21
|
-
"properties": {
|
|
22
|
-
"packageId": "com.clevertap.react",
|
|
23
|
-
"split": ""
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
Binary file
|
package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
File without changes
|