Skip to content

Commit

Permalink
persisting and fetching lastTimeInAppDismissed from OneSignalPrefs
Browse files Browse the repository at this point in the history
This allows this trigger to be respected when the app is quit and relaunched
  • Loading branch information
emawby committed Apr 6, 2022
1 parent b530585 commit 5a6c472
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ protected OSInAppMessageController(OneSignalDbHelper dbHelper, OSTaskController
if (tempClickedMessageIdsSet != null)
clickedClickIds.addAll(tempClickedMessageIdsSet);

Date tempLastTimeInAppDismissed = inAppMessageRepository.getLastTimeInAppDismissed();
if (tempLastTimeInAppDismissed != null) {
lastTimeInAppDismissed = tempLastTimeInAppDismissed;
}

initRedisplayData();
}

Expand Down Expand Up @@ -742,6 +747,7 @@ public void run() {
super.run();

inAppMessageRepository.saveInAppMessage(message);
inAppMessageRepository.saveLastTimeInAppDismissed(lastTimeInAppDismissed);
}
};
runRunnableOnThread(saveIAMOnDBRunnable, OS_IAM_DB_ACCESS);
Expand Down

0 comments on commit 5a6c472

Please sign in to comment.