Merge remote-tracking branch 'origin/master'

This commit is contained in:
Salakar 2018-04-13 13:49:11 +01:00
commit 93b4e3e052
3 changed files with 10 additions and 5 deletions

View File

@ -39,9 +39,7 @@ allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url "https://maven.google.com"
}
google()
}
}

View File

@ -102,6 +102,7 @@ RCT_EXPORT_MODULE();
// Pass them over to the RNFirebaseMessaging handler instead
if (userInfo[@"aps"] && ((NSDictionary*)userInfo[@"aps"]).count == 1 && userInfo[@"aps"][@"content-available"]) {
[[RNFirebaseMessaging instance] didReceiveRemoteNotification:userInfo];
completionHandler(UIBackgroundFetchResultNoData);
return;
}
@ -119,6 +120,7 @@ RCT_EXPORT_MODULE();
// - foreground notifications also go through willPresentNotification
// - background notification presses also go through didReceiveNotificationResponse
// This prevents duplicate messages from hitting the JS app
completionHandler(UIBackgroundFetchResultNoData);
return;
}
@ -465,7 +467,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"];

View File

@ -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 () => {