【发布时间】:2017-04-26 12:25:00
【问题描述】:
首先请不要将此问题视为重复问题。所有其他问题都是老问题,我已经尝试了大多数问题的解决方案,但都没有奏效。
我正在开发一个 Android 应用,并且我添加了我的应用以共享 Android 菜单。我想添加功能,因此如果用户在共享列表中单击我的应用程序,例如在 Chrome 浏览器或 Google Drive 应用程序中,我的应用程序将从该应用程序接收数据,例如在 Chrome 中,它将是 URL。
我尝试使用不同的插件并阅读了许多关于如何在我的应用中使用意图的帖子。不幸的是,它们都不起作用。 我试过了:
- Sending url to ionic android app via webintents from another app - 这个看起来很有前途
- https://www.npmjs.com/package/phonegap-webintent
- https://github.com/napolitano/cordova-plugin-intent - 这个看起来也很有前途
- https://github.com/okwei2000/webintent
- https://github.com/stample/cordova-sharingreceptor
有人搞定这个吗? 我的 AndroidManifest.xml 如下 - 关于意图的部分:
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
在我的 config.xml 我有:
<preference name="AndroidLaunchMode" value="singleTask" />
而且我没有得到我期望的数据。
当我使用 https://github.com/napolitano/cordova-plugin-intent 插件时,我得到了意图,但缺少 clipItems 元素并且插件无用。
我做错了什么?
任何帮助表示赞赏。
【问题讨论】:
标签: android cordova android-intent