Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR:
Similar to magicbell/magicbell-swift#30 and magicbell/magicbell-swift#34 this PR introduces the new notification preferences response shape in the Android SDK.
Test Plan
I've tested the in the example app by calling
user.preferences.fetch()
anduser.preferences.updateChannel("liked-a-post", "email", false)
and logging the notifications preference response afterwards.I've also observed the traffic that went over the network with ProxyMan.
Patch with test code
Todo before moving this out of draft state
Skip the 'label' keys when encoding NotificationPreferenceEntity objects, asI decided against investing more time into this. The Kotlin Serialization framework is cumbersome tbh.PUT
on thenotifications_preferences
endpoint does not expect those keys. The API calls work though, as the key is gracefully ignored, but for correctness I still want to address this