Unity-Technologies / com.unity.mobile.notifications

Mobile Notifications Package
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@2.1/manual/index.html
Other
132 stars 42 forks source link

Rework serialization #215

Closed aurimasc closed 2 years ago

aurimasc commented 2 years ago

Change the way we save pending notifications. Users can send notification pure by using our API, or they can access the Notification.Builder and customize it using Android APIs. This PRs feeds the information about it to serialization code, so if we know notification was not customized, we use the simple serialization system, since that one is more reliable with regard to app or OS upgrades, transfer to new device etc. Of course, notifications that might have been customized have to be saved as is and we have to be ready for failures when deserializing. One other change is introduction of separate Java file for code that is only used by tests. This file is only used when running tests, not included in normal build to not bloat the app size.

The system is in general covered by automated test, so the manual testing is required for:

This rework should in general address these issues (we already handle the exceptions, but after this PR most of them will be prevented from happening in the first place): https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/211 https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/210 https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/208