Ich versuche einen Weg zu finden, eine URL von einer anderen App zu erhalten. Sie befinden sich beispielsweise im Browser, klicken auf Freigabe und senden den Link an eine andere App (meine App). Ich habe this cordova plugin gefunden und habe es in meine App integriert, aber ich zeige weiterhin keine URL, wenn ich es teste.URL in Ionic/Cordova empfangen
Ich erhalte eine Warnung, die sagt:
getUri url:null
Jede Hilfe wäre toll. Gerne fügen Sie mehr Code hinzu, wenn hilfreich.
app.js
:
'use strict';
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
angular.module('starter', [
'ionic',
'firebase',
'starter.services',
'starter.directives',
'starter.controllers',
'ngSanitize'
])
.run(function($rootScope, $state, $ionicPlatform, Post) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory
// bar above the keyboard for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
Dies ist webintent:
if (window.plugins && window.plugins.webintent) {
window.plugins.webintent.getUri(function(url) {
alert("getUri url:"+url);
});
}
$rootScope.$on('$stateChangeError', function(event, toState, toParams,
fromState, fromParams, error) {
$state.go(error);
});
});
})
angular.module('starter.services', []);
angular.module('starter.directives', []);
angular.module('starter.controllers', []);
AndroidManifest.xml
:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.ionicframework.wefeed949805" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="wefeed" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<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" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>
versuchen Sie die URL zu öffnen? –
Ich werde mit der URL "Sachen machen". In meiner App werde ich mit einer API interagieren, um Daten von der URL-Seite zu ziehen. Im Moment kann ich keinen Zugriff auf die URL erhalten, also wird es hilfreich sein, sie zu bekommen. – Shaun
@Shaun: Können Sie das tun? Kannst du mir sagen, welche Schritte du verfolgt hast? –