最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Expo Interactive Push Notifications - Stack Overflow

programmeradmin2浏览0评论

I'm trying to send interactive push notifications with Expo. I can send normal push notifications fine, and I can even send local interactive push notifications, however I cannot send remote interactive push notifications

According to this section of the docs, you create a category, which I do:

Notifications.createCategoryAsync('daily_question', [
    {
        actionId: 'yes',
        buttonTitle: 'Yes',
    },
    {
        actionId: 'no',
        buttonTitle: 'No',
    },
]);

The working local notification then sends (with the interactive buttons) like this:

Notifications.presentLocalNotificationAsync({
    title: '...',
    body: '...',
    data: {...},
    categoryId: 'daily_question',
});

Is there a way to either:

  1. Send a remote interactive push notification as specified in this section of the docs with the _category key
  2. Send a "background" push notification and have a background task send a local interactive push notification

I'm trying to send interactive push notifications with Expo. I can send normal push notifications fine, and I can even send local interactive push notifications, however I cannot send remote interactive push notifications

According to this section of the docs, you create a category, which I do:

Notifications.createCategoryAsync('daily_question', [
    {
        actionId: 'yes',
        buttonTitle: 'Yes',
    },
    {
        actionId: 'no',
        buttonTitle: 'No',
    },
]);

The working local notification then sends (with the interactive buttons) like this:

Notifications.presentLocalNotificationAsync({
    title: '...',
    body: '...',
    data: {...},
    categoryId: 'daily_question',
});

Is there a way to either:

  1. Send a remote interactive push notification as specified in this section of the docs with the _category key
  2. Send a "background" push notification and have a background task send a local interactive push notification
Share Improve this question asked Apr 3, 2019 at 10:15 James CraigJames Craig 6,87410 gold badges48 silver badges77 bronze badges 3
  • 1 Same issue on Android. have you managed to work around this? – Sello Mkantjwa Commented Apr 20, 2019 at 20:37
  • 1 @Enijar Did you ever figure out a solution to this? – Squirrl Commented Apr 5, 2020 at 17:22
  • medium./@mvspavs/expo-notifications-171ba5ab951d – Shub Commented Oct 30, 2024 at 7:14
Add a ment  | 

2 Answers 2

Reset to default 1

Try this snack, I tried it on iOs and when I click (long enough) on the notifications, it shows custom action (button One, button two, three),

I got remote interactive push notifications working by sending the category id with the key categoryId.

发布评论

评论列表(0)

  1. 暂无评论