Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding text field in Remote Notification, iOS 8

i want to add facility in my iOS application that user can reply to the my message directly from the push notification. Like iMessage app is doing it in iOS 8. I am able to add buttons to push notification but did not found any guide on how to add text field. Any Help Please. Thanks in advance.

------------------------------------------------------------------------------------------

I know how to add action(buttons) but how to add a text field or text view for input

enter image description here

like image 380
Iqbal Khan Avatar asked Sep 10 '25 19:09

Iqbal Khan


1 Answers

At the time of asking, this was not possible using the provided API. UIUserNotificationAction objects only represented additional buttons you can add, but you cannot input text directly. For now, you should add a "Reply" button, and on tap, opens the app with the keyboard visible so users can reply.

With iOS 9 SDK, this is possible by setting UIUserNotificationActionBehaviorTextInput as the behavior of the notification action. Make sure to read the documentation for more information.

See this answer for an example how to achieve this in Swift.

like image 100
Léo Natan Avatar answered Sep 12 '25 20:09

Léo Natan