react-native-quick-actions icon indicating copy to clipboard operation
react-native-quick-actions copied to clipboard

Provide full flow support and addListener without calling DeviceEventEmitter

Open jordanbyron opened this issue 10 years ago • 3 comments

Support for:

var QuickActions = require('react-native-quick-actions');

QuickActions.addListener(function(data) {
  // Do some cool stuff
});

It would be cool if registered listener callbacks are also processed when the app is launched via the new popInitialGesture method.

jordanbyron avatar Oct 16 '15 19:10 jordanbyron

It would be cool if registered listener callbacks are also processed when the app is launched via the new popInitialGesture method.

I am not sure if handlers should be called as far as compliance with PushNotifications is considered.

As per Flow support, I can give it a go as well while implementing #7 if you don't mind ;)

PS. Thanks for converting my todos from my PR to issues!

grabbou avatar Oct 16 '15 20:10 grabbou

I am not sure if handlers should be called as far as compliance with PushNotifications is considered.

You're probably right that we shouldn't deviate too much from existing conventions. I just know from my personal usage of this component I thought it felt a bit clunky having to register the handler twice. Once for normal events and another for initial actions.

As per Flow support, I can give it a go as well while implementing #7 if you don't mind ;)

Go for it! I appreciate the help :smile:

jordanbyron avatar Oct 16 '15 21:10 jordanbyron

Yeah, but on the other hand, that's how LinkingIOS and PushNotificationsIOS all work, so I have them all in one place, which is really nice. Up to you, but I would've stayed with that approach. Otherwise, if one have handler for initial action and for event emitter - handler may get invoked twice resulting in e.g. same view presented twice etc.

grabbou avatar Oct 16 '15 21:10 grabbou