mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
parent
2c57bc965c
commit
54d1a9891b
@ -124,7 +124,15 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Illegal invocation needs window context
|
// TODO: Illegal invocation needs window context
|
||||||
return get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
let value;
|
||||||
|
try {
|
||||||
|
value = get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
||||||
|
} catch (e) {
|
||||||
|
value = {
|
||||||
|
error: 'cordova_not_available'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user