Push Notifications, Android and iOS
-
wrote on 16 Sept 2021, 10:50 last edited by
Hello!
I've developed an app showing football scores. However, I would like to send the user a notification whenever the score changes in a game.
Currently I have solved it in Android using a foreground service. It is polling the server every 10 seconds and displays a notification to the user when a new goal is identified.
However, that method is not preferred, and not supported by iOS. We need push notifications.
But how do I, in app, turn off specific notifications? The server will send notifications, and it will be shown on the phone no matter what.
Is the solution to add logic on the server to keep track of all devices and what notifications they want to be silenced?
How is this generally solved?
-
Hello!
I've developed an app showing football scores. However, I would like to send the user a notification whenever the score changes in a game.
Currently I have solved it in Android using a foreground service. It is polling the server every 10 seconds and displays a notification to the user when a new goal is identified.
However, that method is not preferred, and not supported by iOS. We need push notifications.
But how do I, in app, turn off specific notifications? The server will send notifications, and it will be shown on the phone no matter what.
Is the solution to add logic on the server to keep track of all devices and what notifications they want to be silenced?
How is this generally solved?
@adddeeee
there are many services available which inform the device about notifications (by Google and also 3rd party ones) which as you said do not require polling but rather work by publish/subscribe wise.
Qt has no integration by now as far as i know so you would need to integrate hem natively.
Mostly those are not entirely free since it requires a cloud backend to distribute push notifications. -
@adddeeee
there are many services available which inform the device about notifications (by Google and also 3rd party ones) which as you said do not require polling but rather work by publish/subscribe wise.
Qt has no integration by now as far as i know so you would need to integrate hem natively.
Mostly those are not entirely free since it requires a cloud backend to distribute push notifications.wrote on 16 Sept 2021, 12:29 last edited by@raven-worx
Thank you!Yes, I have understood it needs to be made natively.
But what would be the intended way to handle user specific settings regarding what notifications shall be enabled? Is it something our server would need to keep track on?
-
@raven-worx
Thank you!Yes, I have understood it needs to be made natively.
But what would be the intended way to handle user specific settings regarding what notifications shall be enabled? Is it something our server would need to keep track on?
@adddeeee
i think on android you need to register notification channels(?) which then can be configured by the user via the system UI. -
@adddeeee
i think on android you need to register notification channels(?) which then can be configured by the user via the system UI.wrote on 16 Sept 2021, 14:01 last edited by@raven-worx
But in the case of push notifications, is that still used?I thought push notifications were not really connected to an app, but rather to a device?
That is, through the app, a device token is registered, which will be used by the server to trigger a push notification.
Is that correctly understood?
-
Hi,
They are delivered to your device but are linked to the application.
The folks at Felgo have plugins that can help in that regard.
1/6