ios - Sending APN from node server to device -


i have express app configured send notification designated device token , able send , receive notifications.

my issue is, manually sending notifications device server entering device token. can fetch token firebase db that's connected app.

how send token of individual device each event db changes made. dont have specific user assigned in database(or not able figure out how can express app keep track of user). there way can manage fetch particular user, token , send desired notification. contents of notification present in db document of user.

can put observer/listener. or there other way. new apns.

p.s : using node-apn npm apns connectivity.

i hope clear. thanks!

you need following:

1). new table “device” store device token of users along following:

userid devicetype (should enum [“android”, “ios”]) deviceid (string, id) 

2). 2 api’s mobile app side:

register specific mobile device - mobile app send “userid” , “deviceid” after login in app. server check if record same “userid” , “deviceid” exists or not , if not has create 1 in “device table”

deregister specific mobile device - mobile app send “deviceid” free on logout app. ( done because 2 different users can login mobile app on same device ) back-end delete record same device id.

ultimately when event send push user, retrieve device token table , send push token.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -