This is a migrated thread and some comments may be shown as answers.

Loading custom cordova plugin

1 Answer 28 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ángel
Top achievements
Rank 1
Ángel asked on 21 Mar 2016, 04:20 PM

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

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 24 Mar 2016, 09:40 AM
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.

 
Tags
General Discussion
Asked by
Ángel
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or