question

Techadmin avatar image
Techadmin asked

How can I unsubscribe a client from Push Notifications?

Hello all,

I want to give the user to disable the notifications if they feel like to. Is there any way to do it from the client, without going to device settings and doing it from there? (iOS and Android)

Thank you

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

In normal circumstance, the push notification is an iOS/Android development issue which is beyond our scope. If you are receiving your own notification( not system level notification), you can set flags at onMessageReceived function so that users can manually enable and disable notifications. The client is still receiving notifications at background while the flags prevent it from showing up at player’s device. If the Notification is from GCM/FCM, you need to unsubscribe to restrict your notification, for example,

FirebaseMessaging.getInstance().unsubscribeFromTopic("YourTopic");

For more details, please see https://firebase.google.com/docs/cloud-messaging/android/receive

In terms of PlayFab endpoint solution, if you have created scheduled Tasks, such as daily news, to send ‘notifications’ to player accounts, we recommend you to use Player Segments. You can categorize players and set a couple of rules to trigger Cloud Scripts. Please see Player Segmentation here. Additionally, please also check the answers about push notification that Brendan provided in this thread.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.