public static boolean showInstallPrompt (Activity activity, Intent postInstallIntent, int requestCode, String referrer)
implementation 'com.google.android.gms:play-services-instantapps:16.0.1'
// Prompt for pre-registrationInstantApps.showInstallPrompt(activity, postInstallIntent, requestId, referrerId)
// Cookie data is a simple byte array. val cookieData: ByteArray = byteArrayOf() // Use PackageManagerCompat to access Cookie API val packageManager = InstantApps.getPackageManagerCompat(applicationContext) // Ensure that the cookie data will fit within the store before setting // the value. if (cookieData.length <= packageManager.getInstantAppCookieMaxSize()) { packageManager.setInstantAppCookie(cookieData) }
// Use PackageManagerCompat to access Cookie API. val packageManager = InstantApps.getPackageManagerCompat(this) val cookieData = packageManager.getInstantAppCookie() // Clear the cookie data once it has been read to clear it. packageManager.setInstantAppCookie(null)