cordova-plugin-safariviewcontroller icon indicating copy to clipboard operation
cordova-plugin-safariviewcontroller copied to clipboard

Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"]) is not a function.

Open nithin-peter opened this issue 5 years ago • 2 comments

Getting error as ERROR TypeError: Object(WEBPACK_IMPORTED_MODULE_1__ionic_native_core["cordova"]) is not a function. (In 'Object(WEBPACK_IMPORTED_MODULE_1__ionic_native_core["cordova"])(this, "isAvailable", { "successIndex": 1, "errorInd

while executing the following bold line

function openUrl(url, readerMode) { SafariViewController.isAvailable(function (available) { // This line causing issue if (available) { SafariViewController.show({ url: url, hidden: false, // default false. You can use this to load cookies etc in the background (see issue #1 for details). animated: false, // default true, note that 'hide' will reuse this preference (the 'Done' button will always animate though) transition: 'curl', // (this only works in iOS 9.1/9.2 and lower) unless animated is false you can choose from: curl, flip, fade, slide (default) enterReaderModeIfAvailable: readerMode, // default false tintColor: "#00ffff", // default is ios blue barColor: "#0000ff", // on iOS 10+ you can change the background color as well controlTintColor: "#ffffff" // on iOS 10+ you can override the default tintColor }, // this success handler will be invoked for the lifecycle events 'opened', 'loaded' and 'closed' function(result) { if (result.event === 'opened') { console.log('opened'); } else if (result.event === 'loaded') { console.log('loaded'); } else if (result.event === 'closed') { console.log('closed'); } }, function(msg) { console.log("KO: " + msg); }) } else { // potentially powered by InAppBrowser because that (currently) clobbers window.open window.open(url, '_blank', 'location=yes'); } }) }

ionic-angular version : 3.9.2 cordova-ios: "4.5.5",

nithin-peter avatar Jun 13 '19 16:06 nithin-peter

The problem is you using conflictive @ionic-native version. cordova don't existing in older version of @ionic-native/core. Check your package.json and upgrade your @ionic-native/core. Make sure your @ionic-native/core and @ionic-native/safari-view-controller have same version.

smilejos avatar Jun 24 '19 03:06 smilejos

For anyone else having the same issue use npm i @ionic-native/[email protected]

iChristosK avatar Jun 23 '21 12:06 iChristosK