-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to add sound to notification #34
Comments
Yes this can be implemented in future. Or if you want you can also add and create PR for that :) |
This is implemented in Add custom notification sound when initializing the library as below: Android: @param soundUri - Custom Notification sound, uri should be converted to String. Default value is null, if null default notification sound will be played. For custom notification sound put notification sound in res/raw directory. See how it is used in sample app: 3708ea8 val customNotificationSound =
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + "com.mmk.kmpnotifier.sample" + "/" + R.raw.custom_notification_sound)
NotifierManager.initialize(
configuration = NotificationPlatformConfiguration.Android(
notificationIconResId = R.drawable.ic_launcher_foreground,
showPushNotification = true,
notificationChannelData = NotificationPlatformConfiguration.Android.NotificationChannelData(
soundUri = customNotificationSound.toString()
)
)
)
iOS: @param notificationSoundName - Custom notification sound name. Default value is null. If set null, default notification sound will be played. For cusotm notification sound, place the file in the Resources directory of your iOS target. Ensure the file is added to your target's "Build Phases" under "Copy Bundle Resources". See how it is used in sample app: 4b2a90d NotifierManager.initialize(
NotificationPlatformConfiguration.Ios(
showPushNotification = true,
askNotificationPermissionOnStart = true,
notificationSoundName = "custom_notification_sound.wav"
)
)
For more details please check: PR #61 |
Is there a possibility you could enhance the notifier configuration to add (local)sound to notifications?
The text was updated successfully, but these errors were encountered: