react-native-quick-actions/index.android.js
Jordan Byron 3bafd1a18b Add Android support
Squashed commit of the following:

commit 87797504049b0260264353cd1d271d0466c4cba2
Author: Jordan Byron <jordan.byron@gmail.com>
Date:   Sat May 6 11:31:48 2017 -0400

    Update README

commit f3790fd692ec2a1c7e05ea0c734cb3a738df0b0b
Author: Minru Huang <minru.huang@drivetribe.com>
Date:   Wed May 3 10:19:51 2017 +0100

    add comments in README about android launchMode differences.

commit 7d582acc53279241f46e976798000a47da0601ca
Author: Minru Huang <minru.huang@drivetribe.com>
Date:   Wed Mar 29 17:32:39 2017 +0100

    review comments

commit fbced4cdb99aededbbaa1b362ceabd03e7418208
Author: Minru Huang <minru.huang@drivetribe.com>
Date:   Fri Mar 24 12:28:21 2017 +0000

    change popInitialAction function to return a promise, to be consistent with android.

commit 50cf6eabf4235048c832f31e4f40dd6778a1a554
Author: Andrew Jack <andrew.jack@drivetribe.com>
Date:   Fri Mar 24 09:36:20 2017 +0000

    Clean up

commit f66d880e47747dab0e6c7349a62868f002b05e24
Author: Minru Huang <minru.huang@drivetribe.com>
Date:   Fri Mar 24 09:24:32 2017 +0000

    revert package change

commit 9c5548c5aa24047961c9ab53d05c3a0b71b37679
Author: Minru Huang <minru.huang@drivetribe.com>
Date:   Fri Mar 24 08:51:40 2017 +0000

    add android implementation.
2017-05-06 11:32:08 -04:00

36 lines
864 B
JavaScript

var ReactAppShortcuts = require('react-native').NativeModules.ReactAppShortcuts;
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 ReactAppShortcuts.popInitialAction();
},
/**
* Adds shortcut items to application
*/
setShortcutItems: function(items) {
ReactAppShortcuts.setShortcutItems(items);
},
/**
* Clears all previously set dynamic icons
*/
clearShortcutItems: function() {
ReactAppShortcuts.clearShortcutItems();
},
/**
* Check if quick actions are supported
*/
isSupported: function(callback) {
ReactAppShortcuts.isSupported(callback);
}
};