Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Android SDK 6.1.1: App version is 0 when using custom package name #47

Description

@Dir9119

We have one app (let it be com.example.app) for both Amazon and Google stores, but to have separate analytics for them on Tune website, we pass different package names in calls to Tune.init (as described here: https://tune.docs.branch.io/sdk/creating-unique-package-names/#code-platform-android): com.example.app for Google store and com.example.appamazon for Amazon. Before SDK version 6.0.0 everything worked fine, but now all analytics from Amazon version of the app are displayed with "app_version" = 0.

After investigating your code, it seems that the problem is in this line: https://github.com/BranchMetrics/sdk-release/blob/master/sdk-android/TuneMarketingConsoleSDK/src/main/java/com/tune/TuneParameters.java#L150
SDK versions prior to 6.0.0 used real package name (Context.getPackageName) to query the system about app's version, but now custom package name is used. In our case, Google store version of the app works fine, because its custom package name is the same as the real package name (com.example.app), but on Amazon the system cannot find a package named com.example.appamazon and thus appVersion is set to 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions