reactnative-plugin-appice 1.7.42 → 1.7.43
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/src/main/java/com/appice/react/AppICEUtils.java +46 -3
- package/android/src/main/java/com/appice/react/AppIceReactPluginModule.java +3 -0
- package/example/package.json +1 -1
- package/ios/AppIceReactPlugin.xcworkspace/xcuserdata/artherajesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
|
@@ -22,19 +22,19 @@ import java.util.ArrayList;
|
|
|
22
22
|
import java.util.Deque;
|
|
23
23
|
import java.util.HashMap;
|
|
24
24
|
import java.util.Iterator;
|
|
25
|
-
import java.util.List;
|
|
26
25
|
import java.util.Map;
|
|
27
26
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
28
27
|
|
|
29
28
|
import org.json.JSONArray;
|
|
30
29
|
import org.json.JSONObject;
|
|
31
30
|
|
|
31
|
+
import semusi.activitysdk.ContextSdk;
|
|
32
32
|
import semusi.context.ui.appInbox.AppICEInboxMessage;
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
import semusi.context.utility.Utility;
|
|
35
35
|
import semusi.model.campaign.Campaign;
|
|
36
|
-
import semusi.model.campaign.TransactionalCampaign;
|
|
37
36
|
import semusi.model.user.User;
|
|
37
|
+
import semusi.ruleengine.pushmanager.NotificationClickHandler;
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
public class AppICEUtils {
|
|
@@ -512,4 +512,47 @@ public class AppICEUtils {
|
|
|
512
512
|
}
|
|
513
513
|
return false;
|
|
514
514
|
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Handles app link actions triggered from a notification click.
|
|
518
|
+
*
|
|
519
|
+
* Flow:
|
|
520
|
+
* 1. Extracts NotificationClickHandler from the incoming Intent.
|
|
521
|
+
* 2. Retrieves the payload associated with the notification.
|
|
522
|
+
* 3. Validates the payload before processing.
|
|
523
|
+
* 4. If valid:
|
|
524
|
+
* - Triggers deep link handling via ContextSdk.handleOpenLinkUrl().
|
|
525
|
+
* - Logs the click event via ContextSdk.pushNotificationClicked().
|
|
526
|
+
* - Clears the intent to prevent duplicate processing.
|
|
527
|
+
*
|
|
528
|
+
* Edge Cases Handled:
|
|
529
|
+
* - Null intent
|
|
530
|
+
* - Missing or invalid NotificationClickHandler
|
|
531
|
+
* - Empty or invalid payload
|
|
532
|
+
* - Any unexpected runtime exception
|
|
533
|
+
*
|
|
534
|
+
* @param intent Incoming intent containing notification click data
|
|
535
|
+
* @param context Application context used for handling actions
|
|
536
|
+
*/
|
|
537
|
+
public static void handleAppLink(Intent intent, Context context) {
|
|
538
|
+
try {
|
|
539
|
+
if (intent != null){
|
|
540
|
+
NotificationClickHandler clickHandler = NotificationClickHandler.fromIntent(intent);
|
|
541
|
+
if (clickHandler != null) {
|
|
542
|
+
String payload = clickHandler.getPayload();
|
|
543
|
+
Utility.loginfo("handleAppLink payload "+payload);
|
|
544
|
+
if (Utility.isValidObject(payload)) {
|
|
545
|
+
ContextSdk.handleOpenLinkUrl(payload, context);
|
|
546
|
+
ContextSdk.pushNotificationClicked(payload, context);
|
|
547
|
+
clickHandler.deleteIntent(intent);
|
|
548
|
+
} else
|
|
549
|
+
Utility.loginfo("payload is not valid");
|
|
550
|
+
}
|
|
551
|
+
}else
|
|
552
|
+
Utility.loginfo("intent is null ");
|
|
553
|
+
} catch (Throwable e) {
|
|
554
|
+
Utility.loginfo("exception in null ");
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
515
558
|
}
|
|
@@ -20,7 +20,9 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
|
20
20
|
import com.facebook.react.bridge.ReactMethod;
|
|
21
21
|
import com.facebook.react.bridge.ReadableMap;
|
|
22
22
|
|
|
23
|
+
|
|
23
24
|
import android.os.Handler;
|
|
25
|
+
|
|
24
26
|
import semusi.activitysdk.Api;
|
|
25
27
|
import semusi.activitysdk.ContextSdk;
|
|
26
28
|
import semusi.activitysdk.IAppICEDeviceRegisterCallback;
|
|
@@ -863,6 +865,7 @@ public class AppIceReactPluginModule extends ReactContextBaseJavaModule {
|
|
|
863
865
|
@ReactMethod
|
|
864
866
|
public void scheduleTransactionalCampaign(String transactionalStringPayload){
|
|
865
867
|
Context context = getReactApplicationContext();
|
|
868
|
+
printLog("AppIceReactPluginModule", "scheduleTransactionalCampaign, payload = "+transactionalStringPayload );
|
|
866
869
|
TransactionalCampaign transactionalCampaign = TransactionalCampaign.toTransactionalCampaign(transactionalStringPayload);
|
|
867
870
|
ContextSdk.scheduleCampaign(transactionalCampaign, context);
|
|
868
871
|
}
|
package/example/package.json
CHANGED
|
Binary file
|