mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 09:35:48 +00:00
9fae268e5b
Summary: Currently it's not possible to create a silent local notification (which is useful for badge updates) with PushNotificationIOS. This commit solves the problem - when **soundName** param is not specified in **PushNotificationIOS.scheduleLocalNotification** method, a silent notification will be created. Local notification without sound: ``` let fireDate = new Date(); fireDate = fireDate.setSeconds(fireDate.getSeconds() + 15); //fire in 15 seconds PushNotificationIOS.scheduleLocalNotification({ fireDate: fireDate, alertBody: "I'm silent!" }); ``` Local notification with sound: ``` let fireDate = new Date(); fireDate = fireDate.setSeconds(fireDate.getSeconds() + 15); //fire in 15 seconds PushNotificationIOS.scheduleLocalNotification({ fireDate: fireDate, alertBody: "I'm with sound!", soundName: "Any sound" }); ``` Closes https://github.com/facebook/react-native/pull/13734 Differential Revision: D5144848 Pulled By: shergin fbshipit-source-id: dc990b2673305a01cfd868fcdedcf27c461d0a34