Skip to content

Commit 5c39eac

Browse files
authored
Push App Launched on first wrapper run (#548)
1 parent 5eb509e commit 5c39eac

File tree

1 file changed

+9
-0
lines changed
  • AndroidSDKCore/src/main/java/com/leanplum/migration/wrapper

1 file changed

+9
-0
lines changed

AndroidSDKCore/src/main/java/com/leanplum/migration/wrapper/CTWrapper.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ internal class CTWrapper(
100100
Log.d("Wrapper: CleverTap instance created by Leanplum")
101101
}
102102
if (firstTimeStart) {
103+
// Track App Launched event, because onResume of activity has been executed before first run
104+
sendAppLaunchedEvent()
103105
// Send tokens in same session, because often a restart is needed for CT SDK to get them
104106
sendPushTokens(context)
105107
}
@@ -127,6 +129,13 @@ internal class CTWrapper(
127129
instanceCallbackList.remove(callback)
128130
}
129131

132+
@SuppressLint("RestrictedApi")
133+
private fun sendAppLaunchedEvent() {
134+
cleverTapInstance?.coreState?.analyticsManager?.pushAppLaunchedEvent()?.also {
135+
Log.d("Wrapper: app launched event sent")
136+
}
137+
}
138+
130139
private fun sendPushTokens(context: Context) {
131140
// FCM
132141
val fcmToken = SharedPreferencesUtil.getString(context,

0 commit comments

Comments
 (0)