-
Notifications
You must be signed in to change notification settings - Fork 110
/
index.ios.js
40 lines (33 loc) · 841 Bytes
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @providesModule SafariViewManager
* @flow
*/
'use strict';
var NativeModules = require('react-native').NativeModules;
var NativeSafariViewManager = NativeModules.SafariViewManager;
/**
* High-level docs for the SafariViewManager iOS API can be written here.
*/
var SafariViewManager = {
show: function(options) {
return new Promise(function(resolve, reject) {
NativeSafariViewManager.show(options, function(error) {
if (error) {
return reject(error);
}
resolve(true);
});
});
},
isAvailable: function() {
return new Promise(function(resolve, reject) {
NativeSafariViewManager.isAvailable(function(error) {
if (error) {
return reject(error);
}
resolve(true);
});
});
}
};
module.exports = SafariViewManager;