@@ -102,6 +102,7 @@ public class Leanplum {
102102 private static RegisterDeviceFinishedCallback registerDeviceFinishedHandler ;
103103 private static LeanplumDeviceIdMode deviceIdMode = LeanplumDeviceIdMode .MD5_MAC_ADDRESS ;
104104 private static String customDeviceId ;
105+ private static String customAppVersion = null ;
105106 private static boolean userSpecifiedDeviceId ;
106107 private static boolean initializedMessageTemplates = false ;
107108 private static boolean locationCollectionEnabled = true ;
@@ -281,6 +282,16 @@ public static boolean isScreenTrackingEnabled() {
281282 return LeanplumInternal .getIsScreenTrackingEnabled ();
282283 }
283284
285+ /**
286+ * By default, Leanplum reports the version of your app using
287+ * getPackageManager().getPackageInfo, which can be used for reporting and targeting
288+ * on the Leanplum dashboard. If you wish to use any other string as the version,
289+ * you can call this before your call to Leanplum.start()
290+ */
291+ public static void setAppVersion (String appVersion ) {
292+ customAppVersion = appVersion ;
293+ }
294+
284295 /**
285296 * Sets the type of device ID to use. Default: {@link LeanplumDeviceIdMode#MD5_MAC_ADDRESS}
286297 */
@@ -634,6 +645,9 @@ private static void startHelper(
634645
635646 // Setup parameters.
636647 String versionName = Util .getVersionName ();
648+ if (customAppVersion != null ) {
649+ versionName = customAppVersion ;
650+ }
637651 if (versionName == null ) {
638652 versionName = "" ;
639653 }
0 commit comments