Skip to content

Commit dbfabc7

Browse files
authored
Release 7.5.0 (#566)
* Update hms consumer proguard rules * Remove info event property from CT migration (#567) * Fix CT migration app launch (#568) * Set version to 7.5.0
1 parent bb4dde2 commit dbfabc7

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

AndroidSDKCore/src/main/java/com/leanplum/Leanplum.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,9 +1676,7 @@ private static void setTrafficSourceInfoInternal(HashMap<String, Object> params)
16761676
*/
16771677
public static void track(final String event, double value, String info,
16781678
Map<String, ?> params) {
1679-
LeanplumInternal.addStartIssuedHandler(() -> {
1680-
MigrationManager.getWrapper().track(event, value, info, params);
1681-
});
1679+
LeanplumInternal.addStartIssuedHandler(() -> MigrationManager.getWrapper().track(event, value, params));
16821680
LeanplumInternal.track(event, value, info, params, null);
16831681
}
16841682

@@ -1919,14 +1917,14 @@ public static void advanceTo(final String state, String info, final Map<String,
19191917
}
19201918

19211919
if (LeanplumInternal.issuedStart()) {
1922-
MigrationManager.getWrapper().advanceTo(state, info, params);
1920+
MigrationManager.getWrapper().advanceTo(state, params);
19231921
advanceToInternal(state, validatedParams, requestParams);
19241922
} else {
19251923
LeanplumInternal.addStartIssuedHandler(new Runnable() {
19261924
@Override
19271925
public void run() {
19281926
try {
1929-
MigrationManager.getWrapper().advanceTo(state, info, params);
1927+
MigrationManager.getWrapper().advanceTo(state, params);
19301928
advanceToInternal(state, validatedParams, requestParams);
19311929
} catch (Throwable t) {
19321930
Log.exception(t);

AndroidSDKCore/src/main/java/com/leanplum/migration/MigrationConstants.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ object MigrationConstants {
3333
const val CHARGED_EVENT_PARAM = "event"
3434
const val VALUE_PARAM = "value"
3535
const val CURRENCY_CODE_PARAM = "currencyCode"
36-
const val INFO_PARAM = "info"
3736
const val GP_PURCHASE_DATA_PARAM = "googlePlayPurchaseData"
3837
const val GP_PURCHASE_DATA_SIGNATURE_PARAM = "googlePlayPurchaseDataSignature"
3938
const val IAP_ITEM_PARAM = "item"

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import com.clevertap.android.sdk.CleverTapAPI
3030
import com.clevertap.android.sdk.CleverTapInstanceConfig
3131
import com.clevertap.android.sdk.pushnotification.PushConstants
3232
import com.clevertap.android.sdk.pushnotification.PushNotificationHandler
33+
import com.leanplum.LeanplumActivityHelper
3334
import com.leanplum.callbacks.CleverTapInstanceCallback
3435
import com.leanplum.internal.Constants
3536
import com.leanplum.internal.Log
@@ -92,6 +93,12 @@ internal class CTWrapper(
9293
setLibrary("Leanplum")
9394
if (!ActivityLifecycleCallback.registered) {
9495
ActivityLifecycleCallback.register(context.applicationContext as? Application)
96+
if (!LeanplumActivityHelper.isActivityPaused() && !CleverTapAPI.isAppForeground()) {
97+
// Trigger onActivityResumed because onResume of ActivityLifecycle has already been executed
98+
// in this case. This could happen on first start with ct migration. This method will also
99+
// trigger App Launched if it was not send already.
100+
CleverTapAPI.onActivityResumed(LeanplumActivityHelper.getCurrentActivity())
101+
}
95102
}
96103
if (identityManager.isAnonymous()) {
97104
Log.d("Wrapper: identity not set for anonymous user")
@@ -103,8 +110,6 @@ internal class CTWrapper(
103110
Log.d("Wrapper: CleverTap instance created by Leanplum")
104111
}
105112
if (firstTimeStart) {
106-
// Track App Launched event, because onResume of activity has been executed before first run
107-
sendAppLaunchedEvent()
108113
// Send tokens in same session, because often a restart is needed for CT SDK to get them
109114
sendPushTokens(context)
110115
}
@@ -205,7 +210,6 @@ internal class CTWrapper(
205210
override fun track(
206211
event: String?,
207212
value: Double,
208-
info: String?,
209213
params: Map<String, Any?>?
210214
) {
211215
if (event == null) return
@@ -219,10 +223,6 @@ internal class CTWrapper(
219223

220224
properties[MigrationConstants.VALUE_PARAM] = value
221225

222-
if (info != null) {
223-
properties[MigrationConstants.INFO_PARAM] = info
224-
}
225-
226226
Log.d("Wrapper: Leanplum.track will call pushEvent with $event and $properties")
227227
cleverTapInstance?.pushEvent(event, properties)
228228
}
@@ -288,18 +288,14 @@ internal class CTWrapper(
288288
/**
289289
* LP doesn't allow iterables in params.
290290
*/
291-
override fun advanceTo(state: String?, info: String?, params: Map<String, Any?>?) {
291+
override fun advanceTo(state: String?, params: Map<String, Any?>?) {
292292
if (state == null) return;
293293

294294
val event = MigrationConstants.STATE_PREFIX + state
295295
val properties =
296296
params?.mapValues(::mapNotSupportedValues)?.toMutableMap()
297297
?: mutableMapOf()
298298

299-
if (info != null) {
300-
properties[MigrationConstants.INFO_PARAM] = info
301-
}
302-
303299
Log.d("Wrapper: Leanplum.advance will call pushEvent with $event and $properties")
304300
cleverTapInstance?.pushEvent(event, properties)
305301
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ interface IWrapper {
4444
fun track(
4545
event: String?,
4646
value: Double,
47-
info: String?,
4847
params: Map<String, Any?>?,
4948
) = Unit
5049

@@ -65,7 +64,7 @@ interface IWrapper {
6564
params: Map<String, Any?>?,
6665
) = Unit
6766

68-
fun advanceTo(state: String?, info: String?, params: Map<String, Any?>?) = Unit
67+
fun advanceTo(state: String?, params: Map<String, Any?>?) = Unit
6968

7069
fun setUserAttributes(attributes: Map<String, Any?>?) = Unit
7170

AndroidSDKHms/consumer-proguard-rules.pro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
-keep class com.leanplum.** { *; }
77
-dontwarn com.leanplum.**
88

9-
-keep class com.huawei.updatesdk.**{*;}
10-
-keep class com.huawei.hms.**{*;}
9+
-keep class com.huawei.**{*;}
10+
-keep class com.hianalytics.android.**{*;}
11+
-dontwarn com.huawei.**

sdk-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.5.0-beta2
1+
7.5.0

0 commit comments

Comments
 (0)