Unity-Technologies / com.unity.mobile.notifications

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

Android add support for big picture style #235

Closed aurimasc closed 1 year ago

aurimasc commented 1 year ago

https://jira.unity3d.com/browse/MNB-18 https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/194

Add support for BigPicture style notifications. It's a predefined notification style where main thing in notification is an image.

Main thing: we add new APIs that expose to users this Android API: https://developer.android.com/reference/android/app/Notification.BigPictureStyle#bigLargeIcon(android.graphics.Bitmap) The availability of individual properties depend on Android version, see Android docs for that.

Because just being able to show an image from apps resources feel too limited fur such kind of app, I made it to support local files and URIs (for the later we only support what Android does and it's do it your self thing when it comes to actually serving images). The URIs support have been also added for small and large icons of the standard notification support.

To facilitate testing a separate test project created just for that. Serving content from app is not so trivial and it was easiest to use AndroidX library for that, which I did not want to put in main test project, as we also use it for running tests.

Testing required:

Notes: