Skip to content

Commit 4bbe2ec

Browse files
author
“Akshay
committed
[MOB - 11292] - Process Pending Action First
SDK calls getMessages, registerDevice Apis when initializing. When push track happens, initialization also includes push track in the sequence. However, in current sequence, process pending actions which lead to push tracking was done after lifecycle handling was done where getMessages and registerDevice happens. JWT mechanism only retries the first failed call. Thus push track open would not get retried as the first failing call would be getMessages and that would be retried when JWT failure occurred. This PR will change the sequence and make sure Push related APIs are first in line so they are retried instead of getMessages. This solution is better than current one as the sequence of api calls will more align with iOS behavior and we will retain a tracking metric by retrying those instead of getMessages which anyways a lesser important API call. A true caching mechanism still doesn't not exist where all the requests are cached and retried but this definitely should unblock the customer
1 parent cc70c54 commit 4bbe2ec

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
### Fixed
7+
- SDK now retries `trackPushOpen` call when JWT is missing or expired, ensuring reliable push tracking after token acquisition.
68

79
## [3.5.12]
810

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ public static void initialize(@NonNull Context context, @NonNull String apiKey,
618618

619619
sharedInstance.retrieveEmailAndUserId();
620620

621+
IterablePushNotificationUtil.processPendingAction(context);
621622
IterableActivityMonitor.getInstance().registerLifecycleCallbacks(context);
622623
IterableActivityMonitor.getInstance().addCallback(sharedInstance.activityMonitorListener);
623624

@@ -636,7 +637,6 @@ public static void initialize(@NonNull Context context, @NonNull String apiKey,
636637
}
637638

638639
loadLastSavedConfiguration(context);
639-
IterablePushNotificationUtil.processPendingAction(context);
640640
if (DeviceInfoUtils.isFireTV(context.getPackageManager())) {
641641
try {
642642
JSONObject dataFields = new JSONObject();

0 commit comments

Comments
 (0)