[notifications] Fix sound on iOS 10+ #974
This commit is contained in:
parent
c14e60017e
commit
fe44ca90b1
@ -465,7 +465,11 @@ RCT_EXPORT_METHOD(jsInitialised:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
|
||||
content.userInfo = notification[@"data"];
|
||||
}
|
||||
if (notification[@"sound"]) {
|
||||
content.sound = notification[@"sound"];
|
||||
if ([@"default" isEqualToString:notification[@"sound"]]) {
|
||||
content.sound = [UNNotificationSound defaultSound];
|
||||
} else {
|
||||
content.sound = [UNNotificationSound soundNamed:notification[@"sound"]];
|
||||
}
|
||||
}
|
||||
if (notification[@"subtitle"]) {
|
||||
content.subtitle = notification[@"subtitle"];
|
||||
|
@ -73,6 +73,7 @@ const notifications = async () => {
|
||||
.setTitle('Test title')
|
||||
.setBody('Test body')
|
||||
.setNotificationId('displayed')
|
||||
.setSound('default')
|
||||
.android.addAction(action)
|
||||
.android.setChannelId('test')
|
||||
.android.setClickAction('action')
|
||||
@ -100,7 +101,7 @@ const notifications = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// notifications();
|
||||
notifications();
|
||||
|
||||
// Invitations testing
|
||||
const invitations = async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user