@capacitor/app-launcher
AppLauncher API 允许您的应用检查某个应用是否可以打开并打开它。
在 iOS 上,您只能通过已知的 URL 方案打开应用。
在 Android 上,您可以通过已知的 URL 方案或使用其公开的包名来打开应用。
注意: 在 Android 11 及更高版本上,您必须在 AndroidManifest.xml 的 queries 标签中添加要查询的应用包名或 URL 方案。
示例:
<queries>
<package android:name="com.twitter.android" />
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="twitter"/>
</intent>
</queries>
安装
npm install @capacitor/app-launcher
npx cap sync