Loading custom cordova plugin

2 posts, 0 answers
  1. Ángel
    Ángel avatar
    1 posts
    Member since:
    Feb 2016

    Posted 21 Mar Link to this post

    Hello,

    I am trying to use the cordova screenshot plugin, but I can't make it work.

    I have imported the plugin using Telerik documentation, but when I try to execute the following script:

        navigator.screenshot.save(function (error, res) {
            if (error) {
                alert(error);
            } else {
                alert('ok', res.filePath);
            }
        }, 'jpg', 50, 'myScreenShot');

    I get an error because navigator.sreenshot is undefined, so I guess that I didn't import the plugin correctly.

    Is there a way to check if a custom plugin is correctly imported and loaded?

    Thanks in advance,

    Ángel

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Mar Link to this post

    Hello Ángel,

    Do you test deploying the app on a device or do you try it in the Simulator or the AppBuilder companion app?
    There are some limitations you should keep in mind when working with custom plugins in the simulator or the companion app, for example most verified/custom plugins are actually not supported there. All details on the supported plugins are listed in the articles on:
    Limitations of the Companion Apps.
    Limitations of the Device Simulator.

    Also, although the object is in the global scope, please note it will not be available until after the deviceready event fires.

    Let me know if this still helps or should we investigate the case further.

    Regards,
    Dimitrina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top