jordanbyron / react-native-quick-actions

A react-native interface for Touch 3D home screen quick actions
MIT License
1.06k stars 95 forks source link

Handling action when App is killed #33

Closed ArtemKosiakevych closed 7 years ago

ArtemKosiakevych commented 7 years ago

If app in background ShortcutAction called, but when app is killed tap on force touch item just launching app, but not calling the action.

My code

  DeviceEventEmitter.addListener(
      'quickActionShortcut', this.handleShortcutAction.bind(this)
    );

  handleShortcutAction(data){
    console.log('action')
  }
jordanbyron commented 7 years ago

You're looking for this section of the README:

To get any actions sent when the app is cold-launched using the following code:

var QuickActions = require('react-native-quick-actions');
var action = QuickActions.popInitialAction();
if (action) {
  doSomethingWithTheAction(action); // e.g. LinkingIOS.openURL(..)
}