Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to expose component from installed app to be visible to instant app?

From the developer document of Instant Apps

Installed apps can make themselves available to interact with instant through explicit intents.

And later, it is mentioned that instant apps cannot

Discover the list of installed apps on the device, unless the installed apps have made themselves discoverable to instant apps.

But I can't find the details about how to expose the component of an installed app or any part of an app, for that matter, to be visible (and accessible) by instant app. And any limitation on that? (supported component types and etc.)

like image 474
Oasis Feng Avatar asked Jul 23 '17 17:07

Oasis Feng


People also ask

Which permissions are available to an instant app?

Instant-app enabled app bundles can only use few app permissions, such as ACCESS_COARSE_LOCATION , ACCESS_FINE_LOCATION , ACCESS_NETWORK_STATE , CAMERA , INSTANT_APP_FOREGROUND_SERVICE [only in Android 8.0 (API level 26) and higher], INTERNET , READ_PHONE_NUMBER , RECORD_AUDIO , VIBRATE , and WAKE_LOCK .

How do permission work in Google Play Instant?

An app will send a notification to ask for permission to use features on your phone, which you can Allow or Deny. You can also change permissions for a single app or by permission type in your phone's Settings.


1 Answers

At last, I figured out the syntax:

For Android O+, you can specify android:visibleToInstantApps="true" to the component.

For lower version of Android, add this meta-data to your <application> (not working for components):

<meta-data android:name="instantapps.clients.allowed" android:value="true" />

More Info can be found here 3.15. Instant Apps

like image 55
Oasis Feng Avatar answered Oct 19 '22 12:10

Oasis Feng