他のアプリケーションから共有された情報を受け取りたいです。
このために、プラグイン WebIntent を使用しようとしています: https://github.com/phonegap/phonegap-plugins/tree/master/Android/WebIntent
Phonegap 2.5.0 を使用
AndroidManifest.xml 内 (共有するセクションにアプリケーションを表示するため)
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
index.html 内
document.addEventListener('deviceready', onDeviceready, true);
function onDeviceready() {
window.plugins.webintent.getUri(function(url) {
if(url !== "") {
// url is the url the intent was launched with
alert (url);
}
});
}
var url、返される値は null です。
プラグイン src/com/borismus/webintent/WebIntent.java
res/xml/config.xml 内
</plugins>
....
....
<plugin name="WebIntent" value="com.borismus.webintent.WebIntent" />
</plugins>
ありがとう!!!