in auth-lib/src/main/java/com/spotify/sdk/android/auth/AuthorizationClient.java [337:365]
public static void openDownloadSpotifyActivity(Activity contextActivity, String campaign) {
Uri.Builder uriBuilder = new Uri.Builder();
if (isAvailable(contextActivity, new Intent(Intent.ACTION_VIEW, Uri.parse(MARKET_VIEW_PATH)))) {
uriBuilder.scheme(MARKET_SCHEME)
.appendPath(MARKET_PATH);
} else {
uriBuilder.scheme(PLAY_STORE_SCHEME)
.authority(PLAY_STORE_AUTHORITY)
.appendEncodedPath(PLAY_STORE_PATH);
}
uriBuilder.appendQueryParameter(PlayStoreParams.ID, SPOTIFY_ID);
Uri.Builder referrerBuilder = new Uri.Builder();
referrerBuilder.appendQueryParameter(PlayStoreParams.UTM_SOURCE, SPOTIFY_SDK)
.appendQueryParameter(PlayStoreParams.UTM_MEDIUM, ANDROID_SDK);
if (TextUtils.isEmpty(campaign)) {
referrerBuilder.appendQueryParameter(PlayStoreParams.UTM_CAMPAIGN, DEFAULT_CAMPAIGN);
} else {
referrerBuilder.appendQueryParameter(PlayStoreParams.UTM_CAMPAIGN, campaign);
}
uriBuilder.appendQueryParameter(PlayStoreParams.REFERRER, referrerBuilder.build().getEncodedQuery());
contextActivity.startActivity(new Intent(Intent.ACTION_VIEW, uriBuilder.build()));
}