I want to implement Push Notification for an App (both iOS and Android) and need clarifications on the following scenarios.
I understand how the Push Notification works in general and the limitations. I did read the docs but that just got me confused and didnt answer all my questions.
How are the following scenarios handled in iOS and Android:
An iOS push notification is a message that pops up on an Apple device such as an iPhone. Before receiving push notifications from an app, iOS device users must explicitly give permission. Once a user opts-in, mobile app publishers can send push notifications to the users' mobile devices.
Go to Settings and tap Notifications. Select an app under Notification Style. Under Alerts, choose the alert style that you want. If you turn on Allow Notifications, choose when you want the notifications delivered—immediately or in the scheduled notification summary.
I would answer some of your questions, specific to android thought. Don't know about iPhone, If its of similar kind or not.
Is it user specific?
It depends on the individual servers implementation.
Do we store device type?
Yes we can.
Can we differentiate the IDs of iPhone and android?
Yes, android Device IDs are longer in length than iPhone's.
Can we cancel an already sent notification?
No, it is a one way communication channel as far as I know.
When the device is turned off:
Answer: IOS/Android Server (Not your Server) will handled when to send the Push Notification. It checks that device is reachable or not. We can define that how many times IOS/Android Server should try to send Push Notification.
When the device is not connected to 3G or Wifi networks
Answer: Nothing related to 2G/3G/Wi-Fi. Device should be connected to Internet via any network.
When the device has crashed and need restart
Answer: IOS/Android Server checks that device is reachable or not.
When the App is in foreground
Answer: Nothing related to app in foreground.
When the App is in the background
Answer: Nothing related to app in background.
When user is currently using the App
Answer: Nothing related to app being used currently.
When my app is closed (not opened / launched)
Answer: Nothing related to app is closed.
When a push notification is user specific and both users share the same device and app. Example: If a husband and wife share same device and use a bank App with Push notification.
Answer: It depends on how you have implemented on YOUR Server. You will be managing Device Id for each user. So it's upto your implementation logic to send to same device for multiple users.
Can you send User specific notification if device is shared by multiple users?
Answer: It depends on how you have implemented on YOUR Server. You will be managing Device Id for each user. So it's upto your implementation logic.
When user has installed App on multiple devices
Answer: It depends on how you have implemented on YOUR Server.
Can you send a notification to all devices registered by a user at once?
Answer: Yes again as per your implementation logic.
Do you store the device type (iOS or Android) with the registrationID in the User table or is there a way to differentiate the type of device by inspecting the token or registrationID?
Answer: Yes you need to store the device type, to identify to which Server (IOS/Android), you need to send request for Push Notification.
Can you cancel a previously sent notification which is not read yet and send a new one?
Answer: No you cannot cancel the request.
Is it still true that Android Push Notifications does not work on Kindle Fire and will need to implement Amazon Device Messaging
Answer: Need to google it around.
Anything else that I need to think of or plan? I am aware of handling un-registering and feedback service
Answer: Need to google it around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With