react native的通知套件 jpush-react-native算是對岸最常用的,要怎麼知道已經點擊了通知?

通常我們這樣使用:

import JPush from "jpush-react-native"
//...

  JPush.init({
    appKey: JPUSH_APP_KEY,
    channel: "developer-default",
    production: 1,
  })

  const notificationListener = (result) => {
    if (result.notificationEventType === "notificationOpened") {
      // notificationOpened代表使用者點下去了通知框框
    }
  }
  JPush.addNotificationListener(notificationListener)
0
1 回復

發表評論

想要加入討論嗎?
請盡情發表您的想法!

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。