how to display 2 different buttons instead of the notification close and view button in iphone
i am creating an alarm app by making of use of local notification.when i select a particular time from my date picker and click on the save button my notification gets set at that particular time.This has been done and i get the notification at proper time that i have set.but the problem is when my app is not running i get notification with 2 bu开发者_运维技巧ttons i.e one for close and other for view details .when i click on close button my notification close and when the view details button is clicked it takes me to my app.But actually i dont't need this. i want in place of close button snooze button should be present and in place of view button stop button should appear. i.e when my alarm notification is fired i want that in place of close and view button stop and snooze button should appear.When i click on stop button alarm should get stopped and when the snooze button is clicked the alarm is delayed for 5 mins.Please help me in solving my problem.Thanks
The alert displayed by a push/local notification has either one (OK) button, or two buttons - the left button is always "Close" and the right button is either "View" or a string (for action-loc-key
) you supply in the dictionary for the alert
key of your payload.
The functionality you require isn't available using the notification alerts directly. Maybe your app could "snooze" by default (i.e. when the close button is pressed - so unless the app is started the alarm plays again after 5 minutes). If the user presses the View button (maybe re-titled "Cancel Alarm") the app starts and the alarm is cancelled.
See The Notification Payload in http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
精彩评论