Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ SafariViewController Cordova Plugin
[![TotalDownloads][total-downloads-image]][npm-url]
[![Twitter Follow][twitter-image]][twitter-url]

[npm-image]:http://img.shields.io/npm/v/cordova-plugin-safariviewcontroller.svg
[npm-url]:https://npmjs.org/package/cordova-plugin-safariviewcontroller
[downloads-image]:http://img.shields.io/npm/dm/cordova-plugin-safariviewcontroller.svg
[total-downloads-image]:http://img.shields.io/npm/dt/cordova-plugin-safariviewcontroller.svg?label=total%20downloads
[npm-image]:http://img.shields.io/npm/v/@gdevelop/cordova-plugin-safariviewcontroller.svg
[npm-url]:https://npmjs.org/package/@gdevelop/cordova-plugin-safariviewcontroller
[downloads-image]:http://img.shields.io/npm/dm/@gdevelop/cordova-plugin-safariviewcontroller.svg
[total-downloads-image]:http://img.shields.io/npm/dt/@gdevelop/cordova-plugin-safariviewcontroller.svg?label=total%20downloads
[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me
[twitter-url]:https://twitter.com/eddyverbruggen

> Note: this is a fork of https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller while waiting for it to be updated. If needed, this will be cleaned and published as a npm module maintained by the GDevelop team.

## 0. Index

1. [Description](#1-description)
Expand All @@ -28,7 +30,7 @@ SafariViewController Cordova Plugin
* 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](https://developer.chrome.com/multidevice/android/customtabs) 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](https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller/wiki) for details.
* [Chrome custom tabs](https://developer.chrome.com/multidevice/android/customtabs) 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](https://github.com/GDevelopApp/cordova-plugin-safariviewcontroller/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
Expand Down Expand Up @@ -60,24 +62,9 @@ On iOS 10, you can use `barColor` and `controlTintColor` as well
To install the plugin with the Cordova CLI from npm:

```
$ cordova plugin add cordova-plugin-safariviewcontroller
$ cordova plugin add @gdevelop/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](demo/index.html) for an easy to drop in example, otherwise copy-paste this:

Expand Down Expand Up @@ -180,8 +167,10 @@ Do this:


## 7. Changelog

* 2.1.0 Support for latest Java version
* 2.0.0 Support AndroidX
* 1.6.0 A few changes for Android. See [these closed issues](https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller/milestone/7?closed=1).
* 1.6.0 A few changes for Android. See [these closed issues](https://github.com/GDevelopApp/cordova-plugin-safariviewcontroller/milestone/7?closed=1).
* 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.
Expand Down
8 changes: 0 additions & 8 deletions build/android/SafariViewController-java18.gradle

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "cordova-plugin-safariviewcontroller",
"version": "2.0.0",
"name": "@gdevelop/cordova-plugin-safariviewcontroller",
"version": "2.1.0",
"description": "Forget InAppBrowser for iOS - this is way better for displaying read-only web content in your PhoneGap app.",
"cordova": {
"id": "cordova-plugin-safariviewcontroller",
"id": "@gdevelop/cordova-plugin-safariviewcontroller",
"platforms": [
"ios"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller.git"
"url": "git+https://github.com/GDevelopApp/cordova-plugin-safariviewcontroller.git"
},
"keywords": [
"InAppBrowser",
Expand All @@ -31,7 +31,7 @@
"author": "Eddy Verbruggen <[email protected]> (https://github.com/EddyVerbruggen)",
"license": "MIT",
"bugs": {
"url": "https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller/issues"
"url": "https://github.com/GDevelopApp/cordova-plugin-safariviewcontroller/issues"
},
"homepage": "https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller#readme"
"homepage": "https://github.com/GDevelopApp/cordova-plugin-safariviewcontroller#readme"
}
5 changes: 2 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<plugin
id="cordova-plugin-safariviewcontroller"
version="2.0.0"
id="@gdevelop/cordova-plugin-safariviewcontroller"
version="2.1.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0">

<name>SafariViewController</name>
Expand Down Expand Up @@ -44,7 +44,6 @@
<param name="onload" value="true" />
</feature>
</config-file>
<framework src="build/android/SafariViewController-java18.gradle" custom="true" type="gradleReference" />
<framework src="androidx.browser:browser:1.3.0" />

<source-file src="src/android/ChromeCustomTabPlugin.java" target-dir="src/com/customtabplugin" />
Expand Down