Notification comes in background, even notification is disabled

I am suffering from one problem is that when I am disabling push notification using below code notification comes in notification bar while the app is in the background but in the foreground, notification disabled

UAirship.shared().getPushManager().setUserNotificationsEnabled(false);

Didn't find what you were looking for?

New post

Comments

1 comment

  • Hi Syscraft Android,

    Could you clarify what you mean by when the push comes in when the app is backgrounded?

    On Android, there is no true "opt-out" of notifications, so even though a device "opts-out" through setUserNotificationsEnabled to false, the message is still delivered to the device, however it should not be shown to the user assuming you're using our default Notification Factory to display the notification to the user. You would be able to see this type of payload in the logs which looks like it was delivered, but does not show anything to the user.

    I'm also having a little trouble finding your app. Would you mind letting me know which app you were testing on?

    Comment actions Permalink
    0

Please sign in to leave a comment.