parley-messaging / ios-library

Parley iOS app library
MIT License
2 stars 2 forks source link

Remove register of device on reset. #96

Closed mat1th closed 4 months ago

mat1th commented 4 months ago

This PR does introduce the following:

alexkok commented 4 months ago

Sorry, but we cannot remove the device registration call on the reset() function. This change would result in issues with handling notifications from Parley.

Could you describe why this would be needed in your case? If we know the use case, we can maybe come with a proper solution.

mat1th commented 4 months ago

Why would it result in issues? The push token is already send with the configure, and will also be send in all those situations:

alexkok commented 4 months ago

It could cause users getting push notifications that are not intended for them anymore.

The reset() is intended, for example, when a logout of the user is happening. In that case, we need to update the device with the user to reset the token. Such that the user does not receive push notifications anymore as that user, because the user is logged out.

So, if we remove this device registration call on the reset() method. The user could logout, close the app, but Parley could still trigger push notifications as if the user was logged in, which is unwanted.

Ofcourse, this is solved if the user logins again (and then triggers any of the calls that register the device). But its not certain that these methods are being called after logging in either.

Therefore the question: In what case would a reset be needed without registering the device?

mat1th commented 4 months ago

Thank you for the explanation. We do have the following case:

This sounds like a different use case. Are you open to add a new function to reset the local user information without resetting push?