QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
397 stars 358 forks source link

Unsubscribe from remote notifications #1306

Closed maughray closed 1 year ago

maughray commented 2 years ago

I have an unusual problem with remote notifications. Consider the next situation:

  1. Log in and subscribe to remote notifications via QBRequest.createSubscription
  2. Close application and set current day as tomorrow. (e.g today is 01.01.2022, but in settings is set 02.01.2022)
  3. Open application and you're logged out because of invalid date (QBRequest.logIn returns an error) So, you currently are logged out but notifications from messages continue to come.

There are some solutions for this situations, but none of the works. First solution is to simply unregister from remote notifications by calling UIApplication.shared.unregisterForRemoteNotifications(), but my application continue to receive them. UIApplication.shared.isRegisteredForRemoteNotifications returns true. In addition, unregistering from remote notifications can suspend your app from receiving them for a while.

Second solution is to create a Notification extension and block notifications, but they must contain mutable-content in order to be processed by this Notification Extension. Application is currently in production mode and this parameter is missing, so it is also a bad solution.

Any ideas how to prevent receiving notifications when you're logged out?

Thanks.

ghost commented 2 years ago

@maughray Hello,

This is Nikolay from QuickBlox support.

Unfortunately, the SDK does not work correctly in the situation when the incorrect date is set.

According to our developers, you need to set the correct date on the device. We do not recommend using the incorrect date.

To our regret, there are no workarounds.