iOS local notification - screen unlock - ios

From my app I need to play a sound while generating a local notification (something like what happens when receiving a whatsapp call for example).
When the phone is locked, the local notification appears on the lock screen and the sound is played fine. During this, if the phone is unlocked by swiping on the notification icon, the app opens and things go on nice and smooth.
However, while the notification is on, if the phone is unlocked by not swiping on the app icon, but in the normal way (by swiping on the lower portion of the screen) the notification is lost. I do not see the notification back after the screen is unlocked, nor does the sound play any longer.
Can I have some clues to make the notification appear back after screen unlock and keep the sound playing?

Related

Why will my notification sound alert not go off when go to the lock screen on my device and re-enter the app?

I put in a notification into my app that works just right when I want it to go off. However I put a custom sound to that notification thats is about 30 seconds long. When I am at the HOME SCREEN of my device, when the the notification + sound goes off, I re-enter the app and the sound goes away. But when I am at the LOCK SCREEN, the notification goes off but when I re-enter the app it does not turn off. WHY
I guess, you can check the notification agent, whether the program allows notifications in the background.

Force iOS notifications to show alert buttons without swipe or force touch

I have an iOS app which plays a long (20s) audio at some schedules. The problem is if alert style is set to BANNER ( Alert style in unlocked mode in iPhone settings) then audio plays for just about 5s and then the notification hides and audio playback terminates. How can I keep alert visible until end of audio playback?
Other people have same problem:
https://forums.developer.apple.com/message/185451#185451
Although one cannot force a banner notification to stay visible for more than 5 seconds, they can make a limited amount of actions persist in the background. For example, Whatsapp or Snapchat makes your phone keep on vibrating if you receive a call after the alert is gone. I do not know if sound can be made to persist after the banner alert disappears but I'm sure Apple Developer Support can direct you to where you need to go. There phone number is: 18006332152
Hope you find a well-trodded path! Good luck my friend.

ios play continues sound when app receive push notification

Currently i am working on app in which i want to play continues sound when app receives push notification. as i know apple allow to play custom sound of length of 30 sec here is link..
but in well known app it plays continues sound in driver side when app is in back ground and driver receives order.
and another issue is of when my app is in back ground and receives push notification Rather clicking on notification if i open app by pressing app icon it does not show me data of push. it is not possible to load data when press on app icon here is link
iOS Push notification issue
but same thing is done in well known app
With iOS 7+, use application:didReceiveRemoteNotification:fetchCompletionHandler:, which is called even if your app is in the background. iOS will even launch your app in the background if it's not already running, but if the user force quits the app, it will not be re-launched. If you enable the remote-notification background mode, you can run app code when the notification arrives. If you include the audio background mode, you could initiate a sound that continues to play while app is in background.
For second question, typically, your app should query a server for updates if it's launched directly. However, you could leverage a remote notification as above, which you'd get in most cases (except if the app were force quit).

How to stop the LocalNotificationSound when application is opening from Device Locking screen

In my application iam using UILocalNotifications, and for that notification iam setting 30 sec audio file.
Notification fired if device is UnLock state and my app is in background mode then if i click on notification bar then my app is open and notification sound is stopping. This scanario is fine.
Notification fired if device is locke state and my app is in background mode then if i drag the notification then my app is open and notification sound is not stopping. In this scanario notification sound is continuesly playing upto 30 sec.
I need to stop the notification sound when app is open.
Please help me for implementing this functionality.
Thanks in advance.
You can't, since the sound is played by iOS and not your app. Thus you have no control over it.

detect why iOS app went into background, hardware home or incoming push notification

I want my app to behave differently if the user pushes hardware home button, versus other reasons it may go into background. I think I have sorted out the main cases, except I can't tell the difference between user tapping on incoming push notification from another app and hitting the hardware home. In iOS 5, I was getting an applicationWillResignActive when the notify first appeared, and then applicationDidEnterBackground when the user tapped. In iOS 6, I cannot find any event triggered by the appearance of a banner notification from another app. The applicationWillResignActive and applicationDidEnterBackground come back to back, just as in hitting hardware home. I tried listening to UIWindowDidBecomeVisibleNotification and other UIWindow notification, but nothing is fired. Any ideas?

Resources