forked from jordanbyron/react-native-quick-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ios.js
40 lines (36 loc) · 1.03 KB
/
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
var RNQuickActionManager = require('react-native').NativeModules.RNQuickActionManager;
var _initialAction = RNQuickActionManager && RNQuickActionManager.initialAction;
module.exports = {
/**
* An initial action will be available if the app was cold-launched
* from an action.
*
* The first caller of `popInitialAction` will get the initial
* action object, or `null`. Subsequent invocations will return null.
*/
popInitialAction: function() {
return new Promise((resolve) => {
var initialAction = _initialAction;
_initialAction = null;
resolve(initialAction);
})
},
/**
* Adds shortcut items to application
*/
setShortcutItems: function(items) {
RNQuickActionManager.setShortcutItems(items);
},
/**
* Clears all previously set dynamic icons
*/
clearShortcutItems: function() {
RNQuickActionManager.clearShortcutItems();
},
/**
* Check if quick actions are supported
*/
isSupported: function(callback) {
RNQuickActionManager.isSupported(callback);
}
};