Local Notifications not displaying in iOS 6 - ios

I am getting local notifications on time but they are just creating sound. I have disabled the "Do Not Disturb" option and set the Notification alert style as "Alert".
Is there any solution to this problem?

When the application is not active (in foreground), the OS will display an alert, play a sound and/or create a badge. When the application is active, there are no such thing happening. Instead, it'll call the application:didReceiveLocalNotification: method on your app delegate, in which you will have to create your own alert, play your own sound, etc.
Reference: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html

Related

Can I disable a particular local notification banner when app is in foreground?

My application is currently set up to display local and push notifications even when in the foreground. There is one specific local notification I would like to disable when in the foreground, but keep enabled when the app is not active or in the background. Is there a way to accomplish this?
When app in foreground iOS will not show notification banner/alert by default on its own, you must have written code or used a third party frameworks to show some banner on App, just put a break point in that code to not to show the specific notification
https://github.com/nhdang103/HDNotificationView

Swift UILocalNotification: Is it possible to fire an event when Notification is displayed?

So I know the didReceiveLocalNotification event is fired when a user selects an action on a Local Notification.
But, is an event fired prior to that when the notification is displayed as a banner or alert when the app is not active? And can that be accessed to do some background code?
I am looking for an answer in Swift if you can help.
No, local notifications do not and cannot awake the app when firing and the application is not active. The user must tap the notification, or perform a developer defined action on it before the app hears anything.
If you need your app to wake up, you need to use a remote notification with content available flag set.

Questions about Local notifications in iOS

I'm working on a project on iOS 7, 8 that use a lot of notifications (Remote, Local). I have some questions about Local Notification.
I'm using Local Notification to schedule an alarm or a count-down. As I know, the use of NSTimer is not really a good choice since it has only up to 10' in background & if the app process is killed it doesn't work anymore. Local Notification is managed by iOS but I have to accept its alert when the app is not in foreground. There's nothing like silent local notification (local notification without alert, sound or badge and app still knows about it although it's in background). Am I right ?
Let's assume that there're some simple local notifications in Notification Center, scheduled by our app. Normally when I touch on a notification to see it in my app, the others remain present until we interact with them. In some cases that I haven't figured out, all other notifications are removed from the Notification Center. Does anyone encounter this & understand why ?
I find the interactive notification feature in iOS very limited. I want to change the title of a defined UIMutableUserNotificationAction button & add an image for it, like I can do with UIButton. So the question is : Is it possible to customize the UI of an action button ?
Thanks for your help !
Unfortunately there is no correspondence in silent notification using local notifications.
The number of the visible notification in the notification center is a user decision, the user in Settings can decide to set a different number or decide to do not show them in notification center as well. As for the first point no. The third point is not clear, you can set the image you want for a remote just put in the payload the right name, local notifications use the app icon.
There is no silent notification for Local Notification. The user has to click to the notification to open your App.
I suppose that the associated application has deleted those notifications programmatically. Else, those notifications must stay in the notification center.
You cannot add image to action buttons but just the titles.
I tried more than two weeks to do the same. I had to show notification after 2 hrs even if the use doesn't click the notification. But the repetition facility is well handled in objective C. I could have created multiple local notification but it will also violates the total number of 64 notifications. Apple needs to improved the same.

stop playing sound push notification

Tried to find this already but can't find any questions which are asking quite the same thing.
Basically I have set up my push notifications, everything works fine and they are received both when the app is open and closed.
I recieve push, sound begins play. For some reason i need to cancel sound without active app.
Skype have this feature. When app is suspended, incoming call start to play sound by push. After call cancelation sound stops.
UPD:
Is there a way to cancel the sound like Skype?
When Skype app is suspended iPhone receives PUSH for incoming call. Sound begins playing. When call cancel at other side iPhone stops play sound by second push. Anyone knows how this feature works?
You specify a bitmask of notification types when you register for notifications. If you don't want a sound to be played when notifications come in, remove UIRemoteNotificationTypeSound from that bitmask
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge)];
I think they're using invisible push to trigger a local notification. Local notification may be cancelled, so they then cancel it when needed.

Custom notification when app in background or close

Is it possible to create an notification when my app in background all close.
What I mean:
If my app goes to background at some point at time I want to get notification with alert view on main screen in iPhone.
Alert view have to contain my custom description text.
Is it possible? and if this is possible that wich verion iOS should provide this option.
Thanks!
Yes, you can use a local notification.
https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html
Local notifications were introduced in iOS 4.0

Resources