Skip to content

Commit fee6a96

Browse files
doc++
1 parent 03a7eac commit fee6a96

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
SafariViewController Cordova Plugin
22
===================================
3-
by Eddy Verbruggen - [@eddyverbruggen](https://twitter.com/eddyverbruggen)
3+
4+
[![NPM version][npm-image]][npm-url]
5+
[![Downloads][downloads-image]][npm-url]
6+
[![TotalDownloads][total-downloads-image]][npm-url]
7+
[![Twitter Follow][twitter-image]][twitter-url]
8+
9+
[npm-image]:http://img.shields.io/npm/v/cordova-plugin-safariviewcontroller.svg
10+
[npm-url]:https://npmjs.org/package/cordova-plugin-safariviewcontroller
11+
[downloads-image]:http://img.shields.io/npm/dm/cordova-plugin-safariviewcontroller.svg
12+
[total-downloads-image]:http://img.shields.io/npm/dt/cordova-plugin-safariviewcontroller.svg?label=total%20downloads
13+
[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me
14+
[twitter-url]:https://twitter.com/eddyverbruggen
415

516
## 0. Index
617

@@ -53,6 +64,8 @@ $ cordova plugin add cordova-plugin-safariviewcontroller
5364
```
5465

5566
### Graceful fallback to InAppBrowser
67+
** This section is kinda obsolete by now (with iOS 12 currently being the latest version) **
68+
5669
Since SafariViewController is new in iOS9 you need to have a fallback for older versions (and other platforms),
5770
so if `available` returns false (see the snippet below) you want to open the URL in the InAppBrowser probably,
5871
so be sure to include that plugin as well:
@@ -61,7 +74,7 @@ so be sure to include that plugin as well:
6174
$ cordova plugin add cordova-plugin-inappbrowser
6275
```
6376

64-
I'm not including it as a depency as not all folks may have this requirement.
77+
I'm not including it as a dependency as not all folks may have this requirement.
6578

6679
## 4. Usage
6780
Check the [demo code](demo/index.html) for an easy to drop in example, otherwise copy-paste this:
@@ -125,7 +138,7 @@ Do this:
125138
1. Install the [Custom URL Scheme Plugin](https://github.com/EddyVerbruggen/Custom-URL-scheme)
126139
2. Create a web page that reads Safari data on load and passes that data to the URL scheme:
127140

128-
```javascript
141+
```html
129142
<html>
130143
<head>
131144
<script type="javascript">
@@ -143,7 +156,7 @@ Do this:
143156

144157
3. Open the web page you created with a hidden Safari view:
145158

146-
```javascript
159+
```js
147160
SafariViewController.show({
148161
url: 'http://mycoolapp.com/hidden.html',
149162
hidden: true,
@@ -153,7 +166,7 @@ Do this:
153166

154167
4. Capture the data passed from the web page via the URL Scheme:
155168

156-
```javascript
169+
```js
157170
function handleOpenURL(url) {
158171
setTimeout(function() {
159172
SafariViewController.hide();
@@ -165,6 +178,7 @@ Do this:
165178

166179

167180
## 7. Changelog
181+
* 1.6.0 A few changes for Android. See [these closed issues](https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller/milestone/7?closed=1).
168182
* 1.5.3 Hidden tabs don't get removed on `hide()` (iOS). Thanks #104!
169183
* 1.4.3 Options weren't correctly passed to native code. Thanks #19!
170184
* 1.4.2 When passing a URL not starting with http/https the error callback will be invoked.

0 commit comments

Comments
 (0)