Custom notification when app in background or close - ios

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

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

Notification should stay

I have my application developed on iOS 8 . I have implemented push notification in my application. In iOS 8 clicking on notification automatically clears that particular notification. But my requirement is notification should stay until clear manually. Please give suggestion how to achieve this.
This is a system behavior. You can not prevent this to happen.
If you need something to be always visible from the notification center, consider to create a Notification Center Widget.

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.

Localnotification with background mode, Without click on notification open an UIAlertView

When my app is notify by local notification then without click on notification i want to open an UIAlertView. Is this possible for IOS?
I am attaching screenshot for detail understanding.
With iOS8 you can display actions for the user to choose from in the form of buttons. These buttons can launch your app in the background to perform some task or they can launch your app into the foreground as you can do with the notifications available in older versions of iOS.
You can't, however, display a UITextField for the user to enter data.

How to change the application state to foreground when it is in background

I want to programmatically invoke my running application which is currently in background state.
I know it can be done by local notification but is there any other way, any suggestion would be helpful.
Well YES in a way. You can simply implement push notifications for your app wherein there will be a notification displayed from the top of your device . On clicking this notification, the app will open accordingly. This is done by default. I hope this is what you were asking. Otherwise, there is NO other way to get your app from the background to the foreground state without clicking the icon of the app.
No, there is not a such a way.
As far as my knowledge directly we can't change app state from background to foreground programmatically. There are no other methods available other than Notifications.

Resources