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

扶醉桌前 提交于 2019-12-30 06:05:20

问题


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.)


回答1:


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



来源:https://stackoverflow.com/questions/45267816/how-to-expose-component-from-installed-app-to-be-visible-to-instant-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!