[SDK 39] Interactive notifications don't seem to work

On SDK 39 we got support for interactive notifications for the new notification API.

I’ve implemented it like so:


  Notifications.setNotificationCategoryAsync("chat", [
    {
      actionId: "replyToMessage",
      identifier: "replyToMessage",
      buttonTitle: i18n.t("general.reply"),
      textInput: {
        submitButtonTitle: i18n.t("general.reply")
      },
      isDestructive: false,
      isAuthenticationRequired: false,
      options: {
        opensAppToForeground: false
      }
    }])

and on Android I managed to get it working, albeit using _category instead of categoryIdentifier as the docs suggest. On iOS it just straight up doesn’t work, no matter what I try. So either this is broken or I’m doing something wrong.

This is the request being sent:

{
    "to": "ExponentPushToken[************]",
    "title":"hello",
    "body": "world",
    "categoryId": "chat",
    "categoryIdentifier": "chat",
    "_category": "chat"
}

Hi

“_category”

Helped, But it is working only in foreground, when app is in background it is not showing the interactive buttons.

Was wondering whether expo has to update the documentation and an example would be great

For Ios what is the solution?

I don’t know what the solution for iOS is. That’s why I made this post. I didn’t notice the foreground/background discrepancy but I’ll check. For now this feature is no-go for us as the documentation is clearly wrong and doesn’t seem to work properly.

I am also not getting interactive notifications at all on iOS Expo SDK 39

I’ve opened a Github issue here: [SDK 39] iOS interactive notifications don't work · Issue #10467 · expo/expo · GitHub so go over there to raise more awareness

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.