Search code examples
iphoneiosobjective-cuilocalnotificationlocalnotification

How to hide the close button and close action in alert view to display only "Open app" button


I have implemented UIlocalNotification method using the link

Adding Local Notifications With iOS 4

in my app my requirement is that

in notification alert we need to have only "Show me" button which opens the app by default,

we need to force the user to open the app when notification , So there must no close button in the notification alert.

only one button that too Show me must opent the app

how?


Solution

  • If you do not want to show the alert action button you can disable it by setting the hasAction property to NO.
    Note that without the action button there is no option for the user to launch the application from the alert.
    (If you do not want to see the alert at all you should set alertBody to nil.)

    EDIT:

    • You can not remove cancel button.
    • You have only option to remove action button not cancel button and As it is defined in implementation file of UILocalNotification so u can not override it.