Bypass Silent Switch with Local Notification - ios

I'm building an alarm app and my only issue is having the alerts bypass the mute button. Now I did my research and didn't find anything useful a lot of people say it's not possible but I know it is. A lot of alarm clock apps and even Apple's stock clock app have this feature. I'm using iOS's local notifications to push the alert to the user. When the phone is not on silent it works fine. But when the phone is on silent I get the alert and a vibration but no sound. I would like the alert sound to play even when the phone is on mute because say someone creates an alert for the morning and they want to mute their phone so they don't get alerts from other applications waking them up in the middle of the night.
If you have any suggestions please let me know I haven't found anything useful, hopefully someone can put me in the right direction. Thanks in advance!

Related

Is there a way to get iOS System alarm notifications?

I'm coding a timer app, and I've noticed a major drawback: while I can make the alarm send the user a notification when the timer is done, it can only send notifications, while the built-in Clock app triggers a fullscreen alert no matter what screen you are on, ensuring the user sees the end of the timer. Is there any way to integrate my app with iOS to allow this fullscreen alert functionality? I send a notification when the alarm finishes - is there a specific type of notification that I need to send?
Unfortunately not. You have to stay within the confines of your app. The iOS Clock app has special privileges because...well, it's made by Apple.
Is the notification not enough? I would think that would alert the user adequately.

How to create a push notification that constantly vibrates

I want to be able to send a push notification to an iOS device that constantly buzzes/makes a noise until they swipe to answer it. This is the same as what WhatsApp/Fb Messenger does when you try and video call someone. Is this possible? It looks like whatsapp continuously sends a new push notification and somehow invalidates the old one, but I can't figure that out.
AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))
Using the above line will cause the phone to vibrate - if you call this in a timed loop you can get it to vibrate for a certain amount of time.
Continuous vibration however is a common reason for app store rejection see the following - 10base-t.com/unofficial-appstore-rejection-criteria
If you are looking for a Calling functionality, please use CallKit and check the below Github libraries,
https://github.com/opentok/CallKit

How can I mute my local notifications while my iOS app is in foreground?

I am using this package: https://github.com/zo0r/react-native-push-notification to schedule local notifications in my react-native app.
I can schedule local notifications that will display when the app is killed or in the background. If the app is in the foreground the visual notification is suppressed but the notification chime sound plays. I don't want the sound to play - as it can only serve to confuse or annoy the user.
According to Apple docs "The system does not display any alerts, badge the app’s icon, or play any sounds when the app is already frontmost." I've been racking my brain and bingeing on docs but I can't figure out what I could have done to circumvent this iOS policy.
Any ideas where I should look in my code?
This lib has a property that can handle it for you. Just set playSound: false.
You can mix it with AppState to toggle the value according to the state value.
More info in docs below:
https://github.com/zo0r/react-native-push-notification#local-notifications
https://facebook.github.io/react-native/docs/appstate.html
Hope it helps

Swift - Is there a way to wake up my app at a certain time?

I'm currently trying to make an alarm clock app, and I have a problem, because I need to wake up the app if it's closed when the alarm time is up, and then do some things inside my app, before sending a notification. However, I'm not quite sure how to do this.
I've been thinking of scheduling a local notification to wake up the app, but as I understand it, the user has to interact with it for that to happen, which isn't what I want. I've been looking at background fetch, but if I'm correct, you can't explicitly tell the app when to do a background fetch. Are there any other ways of doing this?
You probably need a silent notification.
You can find a good description here.

How to add sound/vibration to remote push notification in Delphi XE6

I followed the great Sarina tutorial about showing Kinvey push notifications on my Android app.
http://blogs.embarcadero.com/sarinadupont/2014/04/16/remote-push-notifications-on-android-with-rad-studio-xe6/
Everything works awesome now, but ... I have a detail which makes the push notifications useless.
The problem is that they do not play any sound or vibrate when arriving to my phone :(
So, I never realize that they arrived.
Sarina aswered something about the solution only on iOS, but I do not know how to write ios code on Delphi or how to handle that. And in case I do it, I am leaving Android with the problem.
So, I would like to play a sound with that notification.
Does anybody know how can I play a sound/vibrate when the push notification arrives? Or at least a workaround which could help me?
Thanks!

Resources