D
D
DSmith2021-02-18 16:34:11
iOS
DSmith, 2021-02-18 16:34:11

How to send push with sound on IOS?

There is an application written for android and ios in react native.
Notifications are set up via Firebase (react-native-firebase).
Notifications come, but there is no sound on IOS, there is sound on android.
When sending, added options for apns -> payload -> aps : "sound" => "default"
If you look at the permission settings for this application on the phone, then there is no switch in notifications - sounds that other applications have.
Tell me where to look for the error? Do I need to somehow request the rights to notifications with sound or something else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yakov, 2021-02-27
@yakovmanshin

Yes, permission to sound in push notifications must be requested explicitly. Only after that such an item will appear in the settings and, in fact, sounds will start playing.
Notice the element .soundinside the array passed to options:

let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
    
}

You can read more in the documentation (the code above is taken from it).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question