reactnative-plugin-appice 1.7.44 → 1.7.46
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/android/.gradle/8.5/checksums/checksums.lock +0 -0
- package/android/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/appice/react/AppIceReactPluginModule.java +1 -0
- package/android/src/main/java/com/appice/react/CampaignCampsReceiver.java +16 -2
- package/android/src/main/java/com/appice/react/EnumConstants.java +5 -0
- package/android/src/main/java/com/appice/react/StringConstants.java +1 -0
- package/index.js +1 -0
- package/ios/AppICEReactEvent.m +17 -1
- package/ios/AppIceReactPlugin.h +2 -0
- package/ios/AppIceReactPlugin.m +20 -0
- package/ios/AppIceReactPlugin.xcworkspace/xcuserdata/artherajesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
- package/reactnative-plugin-appice.podspec +1 -1
- package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
- package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
- /package/{example/android/.gradle/7.3.3 → android/.gradle/8.5/dependencies-accessors}/gc.properties +0 -0
- /package/{example/android/.gradle/7.3.3 → android/.gradle/8.5}/fileChanges/last-build.bin +0 -0
- /package/{example/android/.gradle/vcs-1 → android/.gradle/8.5}/gc.properties +0 -0
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/android/build.gradle
CHANGED
|
@@ -97,7 +97,7 @@ dependencies {
|
|
|
97
97
|
annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.3.1"
|
|
98
98
|
|
|
99
99
|
//appice
|
|
100
|
-
implementation "appice.io.android:sdk:2.6.
|
|
100
|
+
implementation "appice.io.android:sdk:2.6.44"
|
|
101
101
|
|
|
102
102
|
//glide
|
|
103
103
|
implementation "com.github.bumptech.glide:glide:4.11.0"
|
|
@@ -952,6 +952,7 @@ public class AppIceReactPluginModule extends ReactContextBaseJavaModule {
|
|
|
952
952
|
constants.put(EnumConstants.APPICE_PUSH_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_PUSH_NOTIFICATION_CLICKED.getValue());
|
|
953
953
|
constants.put(EnumConstants.APPICE_PUSH_NOTIFICATION_ACTION_BUTTON_CLICKED.getConstants(), EnumConstants.APPICE_PUSH_NOTIFICATION_ACTION_BUTTON_CLICKED.getValue());
|
|
954
954
|
constants.put(EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getValue());
|
|
955
|
+
constants.put(EnumConstants.APPICE_HTML_INAPP_NOTIFICATION_CLICKED.getConstants(), EnumConstants.APPICE_HTML_INAPP_NOTIFICATION_CLICKED.getValue());
|
|
955
956
|
constants.put(EnumConstants.FIRST_SEEN.getConstants(), EnumConstants.FIRST_SEEN.getValue());
|
|
956
957
|
constants.put(EnumConstants.LAST_SEEN.getConstants(), EnumConstants.LAST_SEEN.getValue());
|
|
957
958
|
constants.put(EnumConstants.TOP_N_PRODUCTS_VIEWED.getConstants(), EnumConstants.TOP_N_PRODUCTS_VIEWED.getValue());
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package com.appice.react;
|
|
2
2
|
|
|
3
|
+
import static com.appice.react.AppICEUtils.printLog;
|
|
4
|
+
|
|
3
5
|
import android.content.BroadcastReceiver;
|
|
4
6
|
import android.content.Context;
|
|
5
7
|
import android.content.Intent;
|
|
@@ -10,6 +12,8 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
10
12
|
|
|
11
13
|
import org.json.JSONObject;
|
|
12
14
|
|
|
15
|
+
import semusi.context.utility.Utility;
|
|
16
|
+
|
|
13
17
|
public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
14
18
|
private static final String TAG = "CampaignCampsReceiver";
|
|
15
19
|
public CampaignCampsReceiver(){
|
|
@@ -20,7 +24,7 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
|
20
24
|
try {
|
|
21
25
|
sendCallback(intent.getExtras(), context);
|
|
22
26
|
} catch (Exception e) {
|
|
23
|
-
|
|
27
|
+
printLog(TAG,e.getMessage());
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -29,8 +33,11 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
|
29
33
|
|
|
30
34
|
String cdata = extra.getString("cdata");
|
|
31
35
|
String ai_content = extra.getString("ai_content");
|
|
36
|
+
String campaignStr = extra.getString("campaign");
|
|
32
37
|
boolean category = extra.getBoolean("ai_inapp");
|
|
38
|
+
boolean isHTMLInApp = extra.getBoolean("html_ai_inapp");
|
|
33
39
|
|
|
40
|
+
printLog("inapp flow test |","sendCallback |ai_content "+ai_content+"| category "+category);
|
|
34
41
|
if (category) {
|
|
35
42
|
if (cdata != null && cdata.length() > 0) {
|
|
36
43
|
WritableMap params = Arguments.createMap();
|
|
@@ -38,6 +45,13 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
|
38
45
|
AppIceReactPluginModule.sendEvent(EnumConstants.APPICE_INAPP_NOTIFICATION_CLICKED.getValue(), params);
|
|
39
46
|
}
|
|
40
47
|
}
|
|
48
|
+
if (isHTMLInApp){
|
|
49
|
+
if (Utility.isValidObject(campaignStr)) {
|
|
50
|
+
WritableMap params = Arguments.createMap();
|
|
51
|
+
params.putString(EnumConstants.APPICE_HTML_INAPP_NOTIFICATION_CLICKED.getValue(), campaignStr);
|
|
52
|
+
AppIceReactPluginModule.sendEvent(EnumConstants.APPICE_HTML_INAPP_NOTIFICATION_CLICKED.getValue(), params);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
41
55
|
|
|
42
56
|
if (ai_content != null && ai_content.length()>0){
|
|
43
57
|
JSONObject pushContent = new JSONObject(ai_content);
|
|
@@ -50,7 +64,7 @@ public class CampaignCampsReceiver extends BroadcastReceiver {
|
|
|
50
64
|
}
|
|
51
65
|
}
|
|
52
66
|
} catch (Exception e) {
|
|
53
|
-
|
|
67
|
+
printLog(TAG,e.getMessage());
|
|
54
68
|
}
|
|
55
69
|
}
|
|
56
70
|
}
|
|
@@ -37,6 +37,7 @@ public enum EnumConstants {
|
|
|
37
37
|
//IN-APP
|
|
38
38
|
//============================
|
|
39
39
|
APPICE_INAPP_NOTIFICATION_CLICKED("AppICEInAppClicked"),
|
|
40
|
+
APPICE_HTML_INAPP_NOTIFICATION_CLICKED("AppICEHTMLInAppClicked"),
|
|
40
41
|
|
|
41
42
|
//============================
|
|
42
43
|
//INBOX
|
|
@@ -166,6 +167,10 @@ public enum EnumConstants {
|
|
|
166
167
|
return StringConstants.APPICE_INAPP_NOTIFICATION_CLICKED;
|
|
167
168
|
}
|
|
168
169
|
|
|
170
|
+
case APPICE_HTML_INAPP_NOTIFICATION_CLICKED:{
|
|
171
|
+
return StringConstants.APPICE_HTML_INAPP_NOTIFICATION_CLICKED;
|
|
172
|
+
}
|
|
173
|
+
|
|
169
174
|
case INBOX_MESSAGE:{
|
|
170
175
|
return StringConstants.INBOX_MESSAGE;
|
|
171
176
|
}
|
|
@@ -10,6 +10,7 @@ public interface StringConstants{
|
|
|
10
10
|
String APPICE_PUSH_NOTIFICATION_CLICKED = "AppICEPushNotificationClicked";
|
|
11
11
|
String APPICE_PUSH_NOTIFICATION_ACTION_BUTTON_CLICKED = "AppICEPushNotificationActionButtonClicked";
|
|
12
12
|
String APPICE_INAPP_NOTIFICATION_CLICKED = "AppICEInAppClicked";
|
|
13
|
+
String APPICE_HTML_INAPP_NOTIFICATION_CLICKED = "AppICEHTMLInAppClicked";
|
|
13
14
|
String INBOX_MESSAGE = "message";
|
|
14
15
|
String INBOX_TITLE = "title";
|
|
15
16
|
String INBOX_MESSAGE_STATUS = "messageStatus";
|
package/index.js
CHANGED
package/ios/AppICEReactEvent.m
CHANGED
|
@@ -36,7 +36,7 @@ RCT_EXPORT_MODULE();
|
|
|
36
36
|
|
|
37
37
|
- (NSArray<NSString *> *)supportedEvents
|
|
38
38
|
{
|
|
39
|
-
return @[kAppICEPushNotificationClicked, kAppICEInAppClicked, kAppICEPushNotificationActionButtonClicked];
|
|
39
|
+
return @[kAppICEPushNotificationClicked, kAppICEInAppClicked, kAppICEPushNotificationActionButtonClicked,kAppICEHTMLInAppClicked];
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
|
|
@@ -57,6 +57,11 @@ RCT_EXPORT_MODULE();
|
|
|
57
57
|
name:kAppICEPushNotificationActionButtonClicked
|
|
58
58
|
object:nil];
|
|
59
59
|
|
|
60
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
61
|
+
selector:@selector(InAppHTMLCallback:)
|
|
62
|
+
name:kAppICEHTMLInAppClicked
|
|
63
|
+
object:nil];
|
|
64
|
+
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
- (void)stopObserving {
|
|
@@ -86,6 +91,17 @@ RCT_EXPORT_MODULE();
|
|
|
86
91
|
[self sendEventWithName:kAppICEInAppClicked body:eventDict];
|
|
87
92
|
}
|
|
88
93
|
|
|
94
|
+
//InAppHTMLCallback
|
|
95
|
+
-(void)InAppHTMLCallback:(NSNotification *)event{
|
|
96
|
+
RCTLog(@"from InAppHTMLCallback %@",event);
|
|
97
|
+
NSError * err;
|
|
98
|
+
NSData * jsonUserInfo = [NSJSONSerialization dataWithJSONObject:event.userInfo options:0 error:&err];
|
|
99
|
+
NSMutableDictionary * eventDict = [[NSMutableDictionary alloc]init];
|
|
100
|
+
[eventDict setObject:[[NSString alloc] initWithData:jsonUserInfo encoding:NSUTF8StringEncoding] forKey:kAppICEHTMLInAppClicked];
|
|
101
|
+
RCTLog(@"eventDict %@",eventDict);
|
|
102
|
+
[self sendEventWithName:kAppICEHTMLInAppClicked body:eventDict];
|
|
103
|
+
}
|
|
104
|
+
|
|
89
105
|
- (void)didReceiveHandlePush:(NSNotification *)event {
|
|
90
106
|
// Forward the handlePush event (which contains campaign data) to JS
|
|
91
107
|
[self sendEventWithName:kAppICEPushNotificationActionButtonClicked body:event.userInfo];
|
package/ios/AppIceReactPlugin.h
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
static NSString *const kAppICEPushNotificationClicked = @"AppICEPushNotificationClicked";
|
|
4
4
|
static NSString *const kAppICEInAppClicked = @"AppICEInAppClicked";
|
|
5
5
|
static NSString *const kAppICEPushNotificationActionButtonClicked = @"AppICEPushNotificationActionButtonClicked";
|
|
6
|
+
static NSString *const kAppICEHTMLInAppClicked = @"AppICEHTMLInAppClicked";
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
static NSString *const kn = @"APPICE_USER_NAME";
|
|
8
10
|
static NSString *const kem = @"APPICE_USER_EMAIL";
|
package/ios/AppIceReactPlugin.m
CHANGED
|
@@ -40,6 +40,7 @@ RCT_EXPORT_MODULE()
|
|
|
40
40
|
kAppICEPushNotificationClicked : kAppICEPushNotificationClicked,
|
|
41
41
|
kAppICEInAppClicked : kAppICEInAppClicked,
|
|
42
42
|
kAppICEPushNotificationActionButtonClicked : kAppICEPushNotificationActionButtonClicked,
|
|
43
|
+
kAppICEHTMLInAppClicked:kAppICEHTMLInAppClicked,
|
|
43
44
|
kn : NAME,
|
|
44
45
|
kem : EMAIL,
|
|
45
46
|
kph : PHONE,
|
|
@@ -122,6 +123,7 @@ RCT_EXPORT_METHOD(startContext:(NSString *)appID
|
|
|
122
123
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kappICEToken];
|
|
123
124
|
}
|
|
124
125
|
[self setClickCallback];
|
|
126
|
+
[self setHTMLInAppClickListener];
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
/**
|
|
@@ -291,6 +293,24 @@ RCT_EXPORT_METHOD(inAppClicked:(NSDictionary*)userInfo)
|
|
|
291
293
|
}];
|
|
292
294
|
|
|
293
295
|
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
|
|
299
|
+
Registers a listener for HTML In-App campaign click events.
|
|
300
|
+
This method listens for HTML In-App click actions from the AppICE SDK.
|
|
301
|
+
|
|
302
|
+
* Convert campaign object into dictionary format
|
|
303
|
+
* Post notification with campaign data
|
|
304
|
+
|
|
305
|
+
*/
|
|
306
|
+
- (void)setHTMLInAppClickListener
|
|
307
|
+
{
|
|
308
|
+
[[appICE sharedInstance] handleHTMLInAppClickListener:^(Campaign * _Nullable campaign) {
|
|
309
|
+
NSDictionary *cData = campaign ? [campaign toDictionary] : @{};
|
|
310
|
+
RCTLog(@"***** HTML INapp click *** %@", cData);
|
|
311
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:kAppICEHTMLInAppClicked object:nil userInfo:cData];
|
|
312
|
+
}];
|
|
313
|
+
}
|
|
294
314
|
RCT_EXPORT_METHOD(setInternalId:(NSString*) internalId)
|
|
295
315
|
{
|
|
296
316
|
[[appICE sharedInstance] setInternalId:internalId];
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
/package/{example/android/.gradle/7.3.3 → android/.gradle/8.5/dependencies-accessors}/gc.properties
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|