Git Product home page Git Product logo

cordova-plugin-safariviewcontroller's Introduction

SafariViewController Cordova Plugin

NPM version Downloads TotalDownloads Twitter Follow

0. Index

  1. Description
  2. Screenshots
  3. Installation
  4. Usage
  5. Advantages over InAppBrowser
  6. Reading Safari Data and Cookies with Cordova
  7. Changelog

1. Description

  • Use in cases where you'd otherwise use InAppBrowser
  • Use the new and powerful iOS9 viewcontroller to show webcontent in your PhoneGap app
  • Requires XCode 7 / iOS9 SDK to build
  • Requires iOS9 to use, lower versions need to fall back to InAppBrowser (example below!)
  • Chrome custom tabs are Android's parallel to SafariViewController with even more customizable UI. You can give it a try with the latest version of this plugin. See the wiki for details.

Note that I didn't decide to clobber window.open to override InAppBrowser when applicable because that would mean you could never use InAppBrowser in case you need its advanced features in one place and are happy with a simple readonly view in other cases.

2. Screenshots

As you can see from these shots: you can preload a page in reader mode or normal mode, and Safari gives you the option to use the share sheet!

Pressing 'Done' returns the user to your app as you'd expect.

           

This one has a custom tintColor (check the buttons):

On iOS 10, you can use barColor and controlTintColor as well (to make sure iOS 9 buttons are not white in the case, pass in a tintColor as well):

3. Installation

To install the plugin with the Cordova CLI from npm:

$ cordova plugin add cordova-plugin-safariviewcontroller

Note: the plugin requires Cordova Android 7.0.0 or later.

Graceful fallback to InAppBrowser

** This section is kinda obsolete by now (with iOS 12 currently being the latest version) **

Since SafariViewController is new in iOS9 you need to have a fallback for older versions (and other platforms), so if available returns false (see the snippet below) you want to open the URL in the InAppBrowser probably, so be sure to include that plugin as well:

$ cordova plugin add cordova-plugin-inappbrowser

I'm not including it as a dependency as not all folks may have this requirement.

4. Usage

Check the demo code for an easy to drop in example, otherwise copy-paste this:

function openUrl(url, readerMode) {
  SafariViewController.isAvailable(function (available) {
    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');
    }
  })
}

function dismissSafari() {
  SafariViewController.hide()
}

5. Advantages over InAppBrowser

  • InAppBrowser uses the slow UIWebView (even when you're using a WKWebView plugin!), this plugin uses the ultra fast Safari Webview.
  • This is now Apple's recommended way to use a browser in your app.
  • A nicer / cleaner UI which is consistent with Safari and all other apps using a SFSafariViewController.
  • Whereas cordova-plugin-inappbrowser is affected by ATS, this plugin is not. This means you can even load http URL's without whitelisting them.
  • Since iOS 9.2 or 9.3 you can swipe to go back to your app. Unfortunately, in favor of this Apple dropped the option to provide a custom transition (curl/flip/..) when presenting Safari.

6. Reading Safari Data and Cookies with Cordova

SFSafariViewController implements "real" Safari, meaning private data like cookies and Keychain passwords are available to the user. However, for security, this means that communication features such as javascript, CSS injection and some callbacks that are available in UIWebView are not available in SFSafariViewController.

To pass data from a web page loaded in SFSafariViewController back to your Cordova app, you can use a Custom URL Scheme such as mycoolapp://data?to=pass. You will need to install an addition plugin to handle receiving data passed via URL Scheme in your Cordova app.

Combining the URL Scheme technique with the HIDDEN option in this plugin means you can effectively read data from Safari in the background of your Cordova app. This could be useful for automatically logging in a user to your app if they already have a user token saved as a cookie in Safari.

Do this:

  1. Install the Custom URL Scheme Plugin

  2. Create a web page that reads Safari data on load and passes that data to the URL scheme:

    <html>
      <head>
        <script type="javascript">
          function GetCookieData() {
            var app = "mycoolapp"; // Your Custom URL Scheme
            var data = document.cookie; // Change to be whatever data you want to read
            window.location = app + '://?data=' + encodeURIComponent(data); // Pass data to your app
          }
        </script>
      </head>
      <body onload="GetCookieData()">
      </body>
    </html>
  3. Open the web page you created with a hidden Safari view:

    SafariViewController.show({
      url: 'http://mycoolapp.com/hidden.html',
      hidden: true,
      animated: false
    });
  4. Capture the data passed from the web page via the URL Scheme:

    function handleOpenURL(url) {
      setTimeout(function() {
        SafariViewController.hide();
        var data = decodeURIComponent(url.substr(url.indexOf('=')+1));
        console.log('Browser data received: ' + data);
      }, 0);
    }

7. Changelog

  • 2.0.0 Support AndroidX
  • 1.6.0 A few changes for Android. See these closed issues.
  • 1.5.3 Hidden tabs don't get removed on hide() (iOS). Thanks #104!
  • 1.4.3 Options weren't correctly passed to native code. Thanks #19!
  • 1.4.2 When passing a URL not starting with http/https the error callback will be invoked.
  • 1.4.1 You can now set the color of the navbar and tabbar buttons. Thanks #16!
  • 1.4.0 Added a hidden property to show.
  • 1.3.0 isAvailable plays nice with non-iOS platforms. Added a transition property to show.
  • 1.2.0 Added lifecycle events to the success handler of show, and added the animated property to show.

cordova-plugin-safariviewcontroller's People

Contributors

akofman avatar andrweisr avatar artsiom-dorakhau avatar ccorcos avatar danielstrickland avatar eddyverbruggen avatar extempl avatar georgedrummond avatar heralden avatar igormartsekha avatar johnthepink avatar jrunkel avatar larssn avatar mausibris avatar meljalil avatar novemberborn avatar ollwells avatar rubenstolk avatar setheen avatar theely avatar uifox avatar yakirn avatar youssmak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-safariviewcontroller's Issues

How does the plugin handle an immediate redirect to a custom uri scheme?

Hi I'm curious how does this handle a redirect to custom uri scheme immediately as in if you open it with foo.tld and then foo.tld redirects to com.foo.bar://? In my testing this silently fails additionally the custom uri scheme plugin receives nothing either. I'd really appreciate any insights you can share about this :)

Won't work on iOS 10.0.2

Hi, thank you for your work.

I'm trying to open links using your plugin but it won't work on iOS. Debugging it wouldn't show any error.

I installed the plugin, and I'm using your exact example, but it won't open anything on an iPad Pro with iOS 10.0.2.

SafariViewController appears blank

I have a call to SafariViewController.show({hidden:false, animated:true, url:"https://facebook.com") wrapped in a call to SafariViewController.isAvailable(), as the docs suggest. The SVC slides into view as expected, but it is completely blank and unusable. The "opened" event is fired (since it's just at the bottom of show) but "loaded" is not.
However, if I put up a window.alert() or setTimeout(>0) before calling show(), everything works as expected!
I've added lots of NSLog()s to SafariViewController.m and everything looks fine: it isn't hidden, and we get to the bottom of the ObjC show method without issue. The delegate methods are never called.

This is on my iPhone 5S running iOS 9.3.5. Cordova 5.3.3, iOS engine 4.3.1. Plugins:

com.shoety.cordova.plugin.inappbrowserxwalk 0.3.3 "InAppBrowser Crosswalk"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-crosswalk-webview 1.5.0 "Crosswalk WebView Engine"
cordova-plugin-customurlscheme 4.1.5 "Custom URL scheme"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-inappbrowser 1.3.0 "InAppBrowser"
cordova-plugin-restrict-keyboard 1.0 "Restrict Keyboard"
cordova-plugin-safariviewcontroller 1.4.6 "SafariViewController"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.2.2 "Whitelist"
cordova-universal-links-plugin 1.1.2 "Universal Links Plugin"
de.appplant.cordova.plugin.local-notification 0.8.5-dev "LocalNotification"
io.hpd.cordova.gimbal2 1.0.1 "Gimbal2"
phonegap-plugin-push 1.5.3 "PushPlugin"

Issue with foreign characters

This may be an edge case, but perhaps worth considering for multilingual apps.

I occasionally have URLs to open that have unencoded Chinese characters in them, which when calling URLWithString will yield null. Passing this kind of URL to SafariViewController in this call -

[[SFSafariViewController alloc] initWithURL:url entersReaderIfAvailable:readerMode];

will cause an unhanded exception, and send no error message back to Cordova.

A possible solution might be this:

NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];

I'm not sure about side effects, so we might consider this as an additional option that we can pass in the JavaScript SafariViewController.show() method call. At the very least we might consider a null check on the NSURL *url variable

[phonegap] [console.error] Error: Can't find variable: SafariViewController

Hello, I'm a bit embarrassed this question is not an issue of the plugin, but an issue I don't know how to use it. I installed the plugin, but calling the openUrl() function throws this error:

Error: Can't find variable: SafariViewController

Furthermore, my IDE (WebStorm 8) shows me this tip:

Unresolved variable or type SafariViewController require() call is missing less... (⌘F1)
Checks that all modules are referenced through "require()".
Suggests inserting the "require()" call.
Works only in files in the scope of "Node.js Core" JavaScript library.

Running Versions:

cordova 6.0
phonegap 6.0
AngularJS 1.4
Node.js 4.2.4

*NOT an Ionic FW project.

Rename to neutral naming

Since this supports Chrome as well as Safari, shouldn't this be renamed to something more neutral? Like cordova-plugin-systembrowserview or cordova-plugin-shared-browser?

Retrieving web page meta data

Hi Eddy, first of all many thanks for this plugin.

In my cordova app I'm currently using the InAppBrowser to retrieve meta tags for URLs shared with my app, which works but it takes ages for the InAppBrowser to retrieve the data which is not great for the user. I'm hoping I can replace it with your SafariViewController but I can't currently see of a way of loading a page then gaining access to the loaded dom to retreive the metadata.

Your "Reading Safari Data and Cookies with Cordova" example suggests using a custom url scheme but if I'm loading external web pages, there's no way that I can see of injecting code to pages that aren't mine to send back the metadata.

Just wondering if you had any suggestions for possible solutions that I might be missing?

Access to plugins

Dear all,

I'm really interested in using your plugin, but I would like to know, if I can access other Cordova plugins from Safariviwcontroller, i.e. Filesystem or Camera?

Thanks and best regards

Hide not working

Calling SafariViewController Hide method doesn't close the SafariViewController sometimes, i.e Sometimes the browser is closed, but mostly on cold start the browser doesn't get closed.
Have observed this issue on iOS 10.

Also we always get success block for hide in both the use cases

Wrapper App?

I want to create a wrapper app for a mobile responsive website (via url)

With the InAppBrowser I've seen something as simple as the below.

Can I do the same with the SafariViewController??

`
var app = {
// Application Constructor
initialize: function() {
document.addEventListener("deviceready", function(){
var browser = cordova.InAppBrowser.open('https://mysite.com','_system','location=no,zoom=no,hidden=yes,toolbar=no');

	  browser.addEventListener("loadstop", function(){
	    browser.show();
	  });
	}, false);
},

`

Getting back url of opened view

Hi, having issues with oauth2: when you open a new window with an oauth link it will redirect you with GET params. How can we catch that 'get' params?
InAppBrowsers gets the reference of window and can controll it's redirects:
var ref = window.open(urlWithParams, '_blank', 'location=no,clearcache=yes,clearsessioncache=yes');
ref.addEventListener('loadstart', function(event) {
if (event.url.indexOf(CONFIG.redirectUri) === 0) {
...

OK (done in French) Hitbox too small

I don't know if it's editable but I find that I often need to try 3-4 times before closing it. In contrary, in Feedly (which uses Safari View Controller), I never stumbled upon this (with the same fingers).

build failed in android

Hi, the build failed with following exception in android by adding chrome-tabs @yakirn

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.

    Could not resolve all dependencies for configuration ':_debugCompile'.
    Could not find com.android.support:customtabs:23.2.0.
    Searched in the following locations:
    https://repo1.maven.org/maven2/com/android/support/customtabs/23.2.0/customtabs-23.2.0.pom
    https://repo1.maven.org/maven2/com/android/support/customtabs/23.2.0/customtabs-23.2.0.jar
    file:/Users/ezazwar/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/23.2.0/customtabs-23.2.0.pom
    file:/Users/ezazwar/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/23.2.0/customtabs-23.2.0.jar
    file:/Users/ezazwar/Library/Android/sdk/extras/google/m2repository/com/android/support/customtabs/23.2.0/customtabs-23.2.0.pom
    file:/Users/ezazwar/Library/Android/sdk/extras/google/m2repository/com/android/support/customtabs/23.2.0/customtabs-23.2.0.jar
    Required by:
    :android:unspecified

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Option to hide the address bar

Great plugin! I need an option to hide the address bar (if possible) like you can with the cordova-plugin-inappbrowser plugin. It will make things less confusing for users of my app.

I would also like the ability to change the "Done" button label and an option that will insert a title string in the center of the title bar if the address bar is hidden.

Thank you

Question: Is it possible to get cookie information out of this plugin?

I am looking for a client side fingerprinting cookie process for deeplinking into my app.

These guys say it's possible with iOS 9's Safari View Controller:

http://stackoverflow.com/questions/15955798/ios-app-store-pass-parameters-in-store-download-link

"Then when the user opens your app, open up an invisible Safari View Controller in the background while you show a spinner. As soon as you can inspect the cookie and see the last link clicked, you can stop the spinner--it should be a very fast operation."

Is this possible using this plugin?

Incompatible with PhoneGap Build?

Hi Eddy,

I would love to use your plugin, but I can't get it to work with build.phonegap.com.

I'm getting the error: "Error - The following 3rd-party plugin is causing the build to fail and may need to be updated to a newer version: cordova-plugin-safariviewcontroller".

I'll keep a watch here in case anything comes up that might help me.

Thanks!

Chrome tabs issue with changing default browser

Hi!

First of all, great work on this plugin. Works almost perfectly, just running into a small issue.

The issue I'm running into is that changing the default browser seems to render this plugin ineffective. As I understand it, Chrome Tabs are supposed to be a feature that a non-Chrome browser (i.e. Firefox) can use just as effectively as if it were running in Chrome.

However, with this plugin, when I change my default browser to something like Firefox, the isAvailable method call is returning false, primarily because I'm not sure it's enumerating the possible package names/browsers correctly in these lines of the Android source code of this plugin.

I've created a test repo and to get it working and show the issue I've provided some reproduction steps:

  1. cordova platform add android
  2. cordova run android

This will get the project working on device. Next, simply use the app and click Open browser tab button. This will work great, pulling up the chrome tab implementation and working exactly as I'd hope.

However, now if we change the default browser (Settings -> Apps -> Settings Icon -> Default Apps -> Browser App -> Firefox or Opera or whatever), kill the Cordova app, and re-launch it, the issue will manifest itself.

The isAvailable method call will now return false, when I would expect it to defer to the Firefox implementation of custom tabs, or at least fallback to Chrome. Also note that while I'd love to defer to the in-app-browser implementation (as a fallback as you recommend), I don't believe I can fallback to that as Google OAuth requests can no longer use a WebView UI.

I'm open to attempting to fix the issue myself with a PR/fork, but I just wanted to run it by you to see if you had any ideas and to give me a sanity check!

Thank you!

Cross Site Scripting Ideas

My current login process involves Google OAuth redirecting to a server route that redirects with a cookie. So the client JavaScript never touches the token and everything is very secure. However with the approach you outlined, I would have to pass the token directly through a custom url scheme myapp://password and this opens us up to XSS potential.

Any ideas how we could avoid this? Perhaps the Cordova browser could share session cookies with Safari?

Crash with custom-url-scheme on android

I am trying to replace InAppBrowser with SafariViewController in oAuth flow involving a web server. See #34.

The redirect_uri on the web server (which is whitelisted with the oAuth provider) returns:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Security-Policy" content="default-src 'none';script-src 'unsafe-inline';">
</head>
<body>
    <script>window.location.assign('com.example.app://token' + window.location.hash);</script>
</body>
</html>

then the handleOpenURL event handler parses the oAuth token in the hash.

This works perfectly in iOS but in android SafariViewController crashes on the above page before hitting handleOpenURL.

I know the custom url scheme is properly configured because I can hit handleOpenUrl from a link in a page opened in Chrome.

if I replace:

<script>window.location.assign('com.example.app://token' + window.location.hash);</script>

with

<script>window.location.assign('http://www.google.com');</script>

the redirection works just fine so SafariViewController simply does not like 'com.example.app://' on Android only, not iOS.

Any suggestions to have SafariViewController (Chrome Tabs) accept a custom scheme made with https://github.com/EddyVerbruggen/Custom-URL-scheme on Android ?

Project can be found at https://github.com/kidoju/Kidoju-Mobile.

I am using:

  • Phonegap 6.3.0
  • Android Platform 5.2.1
  • Latest versions of all plugins
    (latest versions on Phonegap build as of today)

I am testing on a Nexus 7 with Android 5.1.1 and Chrome 54.0.2840.85.

Not loading URL occasionally, phone restart needed to make it work again

It happened to me once that SafariViewController did not load any URLs even I had restarted my app and the external Safari browser. I also received reports of the same issue from some of my users. The only way to solve this issue eventually was to restart the phone.

My iOS version is the latest at 9.2.1 and it's the same for those users who reported the issue. Has it happened to anyone?

Won't open unless app view is re-rendered

I am getting an error in which the site will not show unless I double-tap to the multi-tasking view and go back to the app.

Also in the console this message appears:
THREAD WARNING: ['SafariViewController'] took '10.643066' ms. Plugin should use a background thread.

iOS version: 10.1
Other plugins:

com.telerik.plugins.nativepagetransitions 0.6.5 "Native Page Transitions"
cordova-hot-code-push-plugin 1.4.0 "Hot Code Push Plugin"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-crosswalk-webview 1.8.0 "Crosswalk WebView Engine"
cordova-plugin-customurlscheme 4.2.0 "Custom URL scheme"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-safariviewcontroller 1.4.6 "SafariViewController"
cordova-plugin-whitelist 1.2.2 "Whitelist"

Allow plugin to work with Android

Sounds crazy but it would be nice for the plug-in to work on Android by simply reverting to the default android browser. That way we don't have to do it programmatically.

Change statusbar text color to dark

I changed the color of the statusbar in my app to white with the cordova-plugin-statusbar plugin. When the Stafari View Controller is opened, the statusbar keeps white and is therefore not readable. It would be great if you could check the statusbar color and adjust it if necessary.

Thanks for your plugin!

My workaround:

// Success callback
function(result) {
  if(result.event === 'opened') {
    // Dark text for light background
    StatusBar.styleDefault();
  } else if(result.event === 'closed') {
    // Light text for dark background
    StatusBar.styleLightContent();
  }
}

Hide/Disable address bar, safari icon

Hi,

Is there any way to hide safari icon to prevent user to open url in native safari browser? Also, can we hide address bar content. I don't want user to know the url.

-Thanks

Using camera inside the Safari view

I would like to use the camera from inside the safari view. What I'm trying to achieve is to send a picture from an field. When I'm tapping it, I'm prompted to either use the camera or browse a file from the device (which is great).

Thing is, if I try to take a picture directly, the camera app opens, but stays completely black. I'm not asked for the permission to use the camera. It's working on the old inappbrowser.

Is there a trick to make it work ? Maybe a special authorization or something like that to add to my application ?

I'd like to be able to use this plugin for all my in app browsing needs, since it's vastly superior to inappbrowser.

Thanks 😄

Update example : isAvailable takes two functions as in-parameters

Hi,

As far as I can see the example in the 4.Usage section is not correct.
It will work on iOS9 devices, but the fallback will not work.

The example should be updated so that it provides two functions ref the interface defined in SafariViewController.js:

isAvailable: function (onSuccess, onError) {
exec(onSuccess, onError, "SafariViewController", "isAvailable", []);
},

PS huge thanks for providing this plugin!

Close event callback

Hello Eddy,

first of all I want to thank you for all the effort you put in your cordova plugins. They are all working like a charm :)

I have just a simple feature request. Could you please implement a close callback to the safari view controller, so when a user clicks the "Done" button, I can listen to this event and execute custom code. That would be great!

Thank you,

Bernd

SafariViewController in iOS 10

Just an FYI really that as of iOS 10 safariviewcontroller cannot be hidden:

From https://developer.apple.com/app-store/review/guidelines/:

SafariViewContoller must be used to visibly present information to users; the controller may not be hidden or obscured by other views or layers. Additionally, an app may not use SafariViewController to track users without their knowledge and consent.

Trying to do so just results in nothing happening. :(

SafariViewController not available in JS environment

I'm now using this plugin and it works... But to make it work, I have to "hack" a little, because SafariViewController is not available once my app is loaded. So here's the little hack, and if someone has an explanation or a clue as why it doesn't work as expected, please do tell me!

    <script> // <!--

var openInSafariView = function (url) {
   cordova.exec(
    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);},
    'SafariViewController', 'show', [{
          url: url,
          hidden: false,
          animated: false,
          transition: 'curl',
          enterReaderModeIfAvailable: false
        }])
}
function init() {
 cordova.exec(
    function(result){if(result) { cordova.openInSafariView = openInSafariView } },
    function(msg){console.log('SafariViewController not available. ' + msg)},
    'SafariViewController',
    'isAvailable',
    []
 )
}
document.addEventListener('deviceready', function(e) { init() }, true)

//  -->
      </script>

Compile error on SDKs before iOS10

The directive

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0

does not work as intended on XCode 7, as __IPHONE_10_0 is not defined (yet) and therefore evaluates to 0.

Please use numeric version identifier (i.e.: 100000) instead.

Status of Android support?

Hi,
To my (good!) surprise, I figured out today that there is experimental (?) work done to have this work too on Android by using the equivalent Chrome Custom tabs features. I first saw the code and then a quick description in the wiki section.
Couldn't this be referred too directly in the main README page? Is there a plan to update this plugin to rename it to make it more agnostic of the underlying platform (something like "NativeInAppBrowser")?
In any case, this is (again) great work! You got a new star :) Thanks for this.
Claude

Provide way to style bottom toolbar

This is really cool. I was wondering if it is possible to allow the user to style the bottom toolbar? Or would something like that not be possible?

i.e: here

image

For example, I'm currently using this: https://github.com/initialxy/cordova-plugin-themeablebrowser but would love to use this instead though the missing feature would be providing a way to style the bottom toolbar with my own images and also provide a hook in order to get callbacks to button presses via javascript. Would something like this be possible via the SafariViewController?

safariviewcontroller as default window.open handler

Is it possible to make something like:

window.open = SafariViewController.open

To open link all the time through SafariViewController?
I embed google maps in my app. And it has link inside <iframe> that opens big view of map. Since cordova run app inside small browser in appears that the link, user clicks, opens in the app and not in default browser, or app.

Possibility to add referrer info

Great plug-in. Working well.
Would it be possible to eventually specify a referral so that website would know that a specific app is driving traffic to them?
Thanks

Color

Can we change the color of ui?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.