react-native-batch-push icon indicating copy to clipboard operation
react-native-batch-push copied to clipboard

UserID and Fetch Notifications

Open matthieupinte opened this issue 8 years ago • 4 comments

Hi,

I wanted to know how can I get received notifications "payload"... cause I need these data when I'm opening my app from that notification.

You implement a fetchNewNotifications method, does it fit my need ?

Because I got a problem with it :

BatchPush.fetchNewNotifications('theUserId', 'authKey')

How can I get the theUserId ? Even if I use a custom one, as email for exemple, I need to wait that user is connected before get the "device" notifications... can't update the status of my app waiting for these credentials.

Hope you can help me ;)

matthieupinte avatar Jan 22 '18 10:01 matthieupinte

Hello @matthieupinte, fetchNewNotifications will also return the payload if you sent one.

theUserId is the user provided in BatchPush.loginUser.

If you would like to fetch the notifications of the device rather than those of the user, it's not yet possible with this module. But the Batch SDK can do it, so if you're willing to send a PR, you're very welcome :)

Minishlink avatar Jan 26 '18 16:01 Minishlink

Thanks @Minishlink when I have time, will try to ;)

matthieupinte avatar Feb 02 '18 09:02 matthieupinte

Excuse me, i have a question, maybe silly one ;) What is authKey in fetchNewNotifications method?

rahimasgari avatar Jan 16 '19 11:01 rahimasgari

Hi @rahimasgari, please have a look at the Batch.com documentation here: https://batch.com/doc/ios/inbox.html#_custom-user-id-mode. Authentication Key is required if you use the Inbox feature at the user-level (using the Custom User ID) instead of the install-level.

guenard avatar Jan 16 '19 14:01 guenard