Adding text field in Remote Notification, iOS 8

后端 未结 3 1452
忘了有多久
忘了有多久 2020-12-07 17:14

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

3条回答
  •  一整个雨季
    2020-12-07 17:30

    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.

提交回复
热议问题