Hello, I've finally come to the point where I have to put some push-notifications in my app, towards the users.
The thing is I cant get a hold of how the logic should be handled. As far as I understand I should
1) prompt the user about the notification-availabiluty
2) If user accepts, put aside the device_token
3) When user logs in, save the device_token & user_id together in my database (located in a web-enviroment)
After the above steps, another user contacts the above mentioned user, in a msg (or something similar) which triggers (on the server) a push-notification. My script can find that user (whom recieveing a msg from another user) has a device_token saved. Then the server kan fetch the device_token and send a push to the user.
My thought is, what should happen when a user logs out from the App? Should the device_token be destroyed on the server? And then when the user logs in again, we should save it yet again?
Also when I dug in to all this mess, I found something called "channel", which in my ears are used to send global push, to all devices tied to my app?
How would you do this?
Thanks!