UNPKG

cordova-plugin-ortoo-safariviewcontroller

Version:

Forget InAppBrowser for iOS - this is way better for displaying read-only web content in your PhoneGap app.

23 lines (22 loc) 781 B
var exec = require("cordova/exec"); module.exports = { isAvailable: function (callback) { var errorHandler = function errorHandler(error) { // An error has occurred while trying to access the // SafariViewController native implementation, most likely because // we are on an unsupported platform. callback(false); }; exec(callback, errorHandler, "SafariViewController", "isAvailable", []); }, show: function (options, onSuccess, onError) { var opts = options || {}; if (!opts.hasOwnProperty('animated')) { opts.animated = true; } exec(onSuccess, onError, "SafariViewController", "show", [options]); }, hide: function (onSuccess, onError) { exec(onSuccess, onError, "SafariViewController", "hide", []); } };