Is it possible to play a sound on an iPhone with push notification while the phone is on silent mode and stand-by? On either React Native or Swift.
Related
I want to have my push notifications play a sound when the iPhone is locked, but no sound when the iphone is unlocked.
Does anyone know how to accomplish this?
As far as I know, apple rejects applications with lock notifications listeners.
check link.
I want to play a custom notification sound minimum of 10 seconds when the application is in terminated mode and the device is silent.
The scenario which is working:-
Can play custom notification sound when the application is in terminated mode.
Can play custom notification sound when the device is silent and in foreground or background.
The scenario which is not working:-
The device is in silent mode and the application is in terminated mode, I receive a push notification and it just vibrates, I want to play the same sound which I am doing in all the above other scenarios.
I want this for an emergency situation.
I have a custom sound playing on local notification, in iOS 10 when the device is locked everything works fine and the sound plays till the end. But when the device is unlocked, as soon as the notification bar hides ( in about 5 Secs.) the sound stops playing.
PS. It works fine in iOS 9, the notification bar stays on top as long as the notification sound is playing.
Is it a bug or am I missing something?
EDIT:
I've tested with either UNUserNotificationCenter and deprecated UILocalNotification. Both the same result.
I know the ways for,
1.how to playing sound and vibrating(both) while push notification comes from server to iPhone device
2.Only playing vibrate with no sound.
but I did not find any way to "play only sound and stop vibrating when new push notification comes" on device.
Please suggest me both way.
1) iPhone mode in vibrate.
2) iPhone mode in General.
My Xcode is version 7.2.
I set this dictionary in APN Tester than get sound and vibrate=>
{"aps":{"alert":"Hello from APNs Tester.","badge":"1","sound":"default"}}
But, I want only sound no vibrate.
I think this question is duplicate . but I can't get proper solution.
Thankx in advance.
I am trying to have push notifications which do not vibrate within the app, but if the app is in background mode and I get a push notification my phone still vibrates. How can I do this, thanks