googlearchive / android-instant-apps

Migrated:
https://github.com/android/app-bundle
Apache License 2.0
846 stars 277 forks source link

How to read info passed in postInstall Intent #54

Closed AnupamSingh0211 closed 5 years ago

AnupamSingh0211 commented 6 years ago

private val postInstallIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://install-api.instantappsample.com/")). addCategory(Intent.CATEGORY_BROWSABLE). putExtras(Bundle().apply { putString("The key to", "sending data via intent") })

Where to catch value of "the key to" In the installed app

miguelmontemayor commented 5 years ago

You can access the extra data from the post-install intent launched in your installed app.

Intent launchIntent = getIntent();
if ( launchIntent != null ) {
   userToken = launchIntent.getStringExtra(USER_PARAM);
}