Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Play sound in local notification only if soundName is specified
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 #13734 Differential Revision: D5144848 Pulled By: shergin fbshipit-source-id: dc990b2673305a01cfd868fcdedcf27c461d0a34
- Loading branch information