2
0
mirror of synced 2025-02-24 12:08:11 +00:00

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 { repositories {
jcenter() jcenter()
mavenLocal() mavenLocal()
maven { google()
url "https://maven.google.com"
}
} }
} }

View File

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

View File

@ -73,6 +73,7 @@ const notifications = async () => {
.setTitle('Test title') .setTitle('Test title')
.setBody('Test body') .setBody('Test body')
.setNotificationId('displayed') .setNotificationId('displayed')
.setSound('default')
.android.addAction(action) .android.addAction(action)
.android.setChannelId('test') .android.setChannelId('test')
.android.setClickAction('action') .android.setClickAction('action')
@ -100,7 +101,7 @@ const notifications = async () => {
} }
}; };
// notifications(); notifications();
// Invitations testing // Invitations testing
const invitations = async () => { const invitations = async () => {