Copy to Clipboard with javascript for phonegap

前端 未结 2 675
臣服心动
臣服心动 2021-01-02 09:50

i am developing an app using javascript/mobile-jquery interface for the phonegap platform. Now I have seen so many examples on the web trying to copy to clipboard and unfor

2条回答
  •  我在风中等你
    2021-01-02 10:17

    First up: that IE option will not work on Android as PhoneGap uses Webkit (think: Safari and/or Chrome).

    Anyway...

    That file you're looking for (in the "/res/xml/" subdirectory of your project's directory) is called

    config.xml
    

    In there, you have to tell phonegap to load the plugin at compile time like this...

    
    

    If you don't do that, phonegap will simply not include the plugin at compile time, resulting in the fact that your plugin won't work (since it doesn't exist in the compiled apk).

    I haven't used the ClipboardManagerPlugin yet, but according to the docs it should go somewhat like this:

    
    

    Please note that you should check the PhoneGap version you're using and if the plugin is compatible with it. Just in case you're not aware of it: not all plugins have been updated to work with PhoneGap 3.x yet. To quote the readme at Github (https://build.phonegap.com/docs/plugins-using): "Unless explicitly stated, most of these plugins will not work with Cordova/PhoneGap 3.x.x out of the box. They will need updating before they can be used via the plugin add interface."

提交回复
热议问题