0

Ich versuche this plugin zu einer PhoneGap-Anwendung hinzuzufügen.Wie installiert man cordova/phonegap plugins auf PhoneGap Developer App

benutzen ich diesen Befehl ein:

$ cordova plugin add cordova-media-with-compression 

Und ich kann das Plugin korrekt hinzugefügt in der Liste des Plug-in laufen sehen:

$ phonegap plugin list 

Aber wenn ich den PhoneGap Entwicklern App (auf dem iPhone) ist das Plugin nicht verfügbar.

Ich bin mit diesen Code, um die Liste der installierten Plugins zur Laufzeit zu erhalten:

document.addEventListener("deviceready", function() { 

    var pluginList = cordova.require("cordova/plugin_list").metadata; 
    console.log(JSON.stringify(pluginList)); 

}); 

Der obige Code gibt zwei verschiedene Arten von Plug-ins, wenn ich die Anwendung von einem Browser ausgeführt oder von die PhoneGap Entwickler-App. Von Browser ich diese:

{ 
    "cordova-media-with-compression": "2.1.0", 
    "cordova-plugin-battery-status": "1.1.2", 
    "cordova-plugin-camera": "2.1.1", 
    "cordova-plugin-compat": "1.1.0", 
    "cordova-plugin-console": "1.0.4", 
    "cordova-plugin-contacts": "2.0.1", 
    "cordova-plugin-device": "1.1.3", 
    "cordova-plugin-device-motion": "1.2.2", 
    "cordova-plugin-device-orientation": "1.0.4", 
    "cordova-plugin-dialogs": "1.2.1", 
    "cordova-plugin-file": "4.3.0", 
    "cordova-plugin-file-transfer": "1.5.1", 
    "cordova-plugin-geolocation": "2.1.0", 
    "cordova-plugin-globalization": "1.0.4", 
    "cordova-plugin-inappbrowser": "1.3.0", 
    "cordova-plugin-network-information": "1.2.1", 
    "cordova-plugin-splashscreen": "3.2.2", 
    "cordova-plugin-statusbar": "2.1.3", 
    "cordova-plugin-vibration": "2.1.2", 
    "cordova-plugin-whitelist": "1.2.2" 
} 

Und von der PhoneGap Entwickler App ich dieses:

{ 
    "com.wikitude.phonegap.WikitudePlugin": "5.3.0", 
    "cordova-plugin-battery-status": "1.2.0", 
    "cordova-plugin-ble-central": "1.1.2", 
    "cordova-plugin-camera": "2.3.0", 
    "cordova-plugin-compat": "1.0.0", 
    "cordova-plugin-console": "1.0.4", 
    "cordova-plugin-contacts": "2.2.0", 
    "cordova-plugin-device": "1.1.3", 
    "cordova-plugin-device-motion": "1.2.2", 
    "cordova-plugin-device-orientation": "1.0.4", 
    "cordova-plugin-dialogs": "1.3.0", 
    "cordova-plugin-file": "4.3.0", 
    "cordova-plugin-file-transfer": "1.6.0", 
    "cordova-plugin-geolocation": "2.4.1-dev", 
    "cordova-plugin-globalization": "1.0.4", 
    "cordova-plugin-inappbrowser": "1.5.0", 
    "cordova-plugin-insomnia": "4.2.0", 
    "cordova-plugin-media": "2.4.0", 
    "cordova-plugin-media-capture": "1.4.0", 
    "cordova-plugin-network-information": "1.3.0", 
    "cordova-plugin-splashscreen": "4.0.0", 
    "cordova-plugin-statusbar": "2.2.0", 
    "cordova-plugin-whitelist": "1.3.0", 
    "cordova-plugin-x-socialsharing": "5.1.3", 
    "phonegap-plugin-barcodescanner": "6.0.3", 
    "phonegap-plugin-contentsync": "1.2.5", 
    "phonegap-plugin-mobile-accessibility": "1.0.4", 
    "phonegap-plugin-push": "1.8.3" 
} 

Wie Sie in der ersten Liste sehen kann, gibt es das Plugin cordova-media-with-compression während in die zweite Liste gibt es nicht.

Warum sind die beiden Plugins nicht gleich? Wie kann ich neue installierte Plugins auch in der PhoneGap Developer App bekommen?

Antwort

1

Ich fand heraus, dass die Phonegap Entwickler App mit einer Reihe von Plugins aus dem Kasten heraus kommen und es ist nicht möglich, andere externe Plugins hinzuzufügen: http://docs.phonegap.com/references/developer-app/troubleshoot-faq/

Wenn Sie ein Plugin verwenden in Ihr Projekt, das nicht in dieser Liste angezeigt wird, funktioniert nicht mit der PhoneGap Developer App. Sie können jedoch your own custom build of the PhoneGap Developer app lokal erstellen und alle anderen Plugins dort einschließen.

Der offizielle Vorschlag ist, eine benutzerdefinierte Build des Entwicklers App zu erstellen.

Dies sind einige Diskussionen über Github zu diesem Thema:

https://github.com/phonegap/phonegap-app-developer/issues/247 https://github.com/phonegap/phonegap-app-developer/issues/209

Verwandte Themen