I know this has been asked before. However...
While until recently I thought that the only possible and accepted Alert is the text with 2 buttons I found some apps which have a different local alert.
So I assume there is an accepted way to customize the lokal Alert. Is this correct or have these apps just "slipped" into the store somehow - as I know this happened before with feature and then the app disappeared from the store suddenly.
I could not find anything about it.
Many thanks
As of iOS 5:
When a UILocalNotification is delivered while the device is locked, it appears on the lockscreen with a swipe slider to open the app.
If the notification is delivered while the device is in use, it can appear either as a banner across the top of the screen, or as an alert with two buttons.
One button is always a cancel button.
The other button opens the application. You can change the text of this button by setting the alertAction property.
You can disable this action button on the alert by setting hasAction = NO on the notification).
There are no other available ways a notification alert can arrive, unless of course the device is jailbroken. In that case, many things are possible.
Before iOS 5, only popup alert notifications were supported.
Due to the nature of iOS, it is technically not possible to deliver a notification in any other way, or customise the alert, as the notification delivery is handled by the system and the app has no access to the system UI, and so cannot display any messages by itself. And even if you did somehow manage that, Apple wouldn't allow it.
Read the UILocalNotification docs here: http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Reference/UILocalNotification_Class/Reference/Reference.html for more detailed information.
Related
I would need 3 button on a push notification alert. "YES", "NO", "REMIND LATER". Presently, I Only found only Two button VIEW & CANCEL, Where we can customize the Names of those buttons, But what about the 3rd one? Can't we have it? Can't we have another button on the push alert?
Is apple is restricting OS to do that? Then Why?
According to the APNS documentation, the only choice you have is between one and two buttons :
action-loc-key
string or null
If a string is specified, the system displays an alert with two
buttons, whose behavior is described in Table 3-1. The string is used
as a key to get a localized string in the current localization to use
for the right button’s title instead of “View”. If the value is null,
the system displays an alert with a single OK button that simply
dismisses the alert when tapped. See “Localized Formatted Strings” for
more information.
Apple seem to have strong views regarding how UIs should look like, and they don't give developers much flexibility.
I need to show the exit confirm dialog when user pressing the Home button. If yes, need to exit the application.
Is it possible to show when pressing the Home button?
This would probably cause your app to be rejected
From the Apple HIG:
Always Be Prepared to Stop
iOS apps stop when people press the Home button to open a different app or use a device feature, such as the phone. In particular, people don’t tap an app close button or select Quit from a menu. To provide a good stopping experience, an iOS app should:
Save user data as soon as possible and as often as reasonable because an exit or terminate notification can arrive at any time.
Save the current state when stopping, at the finest level of detail possible so that people don’t lose their context when they start the app again. For example, if your app displays scrolling data, save the current scroll position. To learn more about efficient ways to preserve and restore your app’s state, see “State Preservation and Restoration”.
I'm not sure you can stop the app from terminating or going into the background. You can tell it is about to go background through the app delegate applicationWilResignActive or be terminated by applicationWillTerminate.
I'd like to notify my users when something like a request failure occurs. However, I don't want to interrupt the user by using a popup style alert. I'm looking for something like when you change the volume on the device and that translucent icon pops up and fades away after a second or two. During the time the icon is showing, the user can still interact with the app as if it weren't there.
I looked in the HIG, but I couldn't find any such UI control that is native to iOS. Are there any good open source controls that do this?
There's an excellent control for a HUD-style popup called SVStatusHUD. I belive it does exactly what you're looking for:
I am writing an iPhone application. In one of my views the user will have to enter Canadian zip codes which alternate letters and numbers (e.g. V0E 5N0). I would like to have the default keyboard showing up, but additionally, I want to allow the user to be able to enter numbers without having to switch keyboards back and forth by pressing the ".?123" key, which makes the process tedious for this type of entry. Will my app violate apple guidelines if I add into my view 10 buttons with the digits to show right above the keyboard?
There are plenty of Apps that already exist on the App store with such functionality, so I don't see why your App would get rejected specifically for having a view above the keyboard. It may still get declined because of other things, but not a custom keyboard view.
Nebulous Notes - Approved and on the App store:
iSSH also has a custom keyboard with toolbar on iphone and ipad and is on the App store.
Normally incase of a zip code entry , users are provided with a UINumberKeyPad and it makes it easy for them (But in your case it would not help you). In your case, if you wish to add another UIToolbar right on top of the inputView, I would say go for it, but it is not the best practice !
This will not violate the apple guidelines, and you can implement in your view with a UIToolbar as an inputAccessoryView. Make sure to remove the Toolbar from the superView during the keyboard event resignFirstResponder.
I'm developing a Voip application.
When I press the lock button(app goes to sleep), and the server sends a request I present a local notification.
The local notification is presented as it should and The button slider text says "slide to answer". If I slide here, the app gets open.
However, if now I press again the lock button, and then unlock, the notification is still presented and the slider text has changed to "slide to unlock".
Now, when I slide to unlock, it's as if I pressed the "close" button on a regular notification bar, meaning the app won't open.
My question is why on the second time the local notification is still presented ? and if so, is there a way to track the unlock button event or the unlock slider so I can tell the server that I don't want to answer the call ?
Thanks
The notification is only a dialog (i.e., the user can interact with it directly) for a short time - until the device is locked again, either by using the button or automatically after a time-out of about 15 seconds.
After that, it turns into a notification. The user cannot interact with it directly, apart from reading the message.
Sorry, but it doesn't get any better unfortunately.