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

Add sound type support for iOS #213

Closed aurimasc closed 2 years ago

aurimasc commented 2 years ago

User requested an ability to have notification without sound: https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/202

This PR is exposing entire set of sound APIs:

Note, that critical alerts require special entitlement from Apple, while ringtone is not documented. Just exposing them in API, in general this PR concerns silent notifications and custom sound. One of existing notifications in test project was changed to have no sound. Custom sound support is tricky since our API to manipulate XCode project doesn't look complete. Basically you need to specify the file name in the api and add that file to XCode project manually (right click in the tree and select add). For now lets have it this way, we could add better support later, if anyone asks for it.

I've tried the feature myself, but one notable thing is that some features are iOS version specific (see changes to UnityNotificationManager.m), so default should be used as fallback on device with older versions (not blow up).