Skip to content

Commit 3ae5e1d

Browse files
author
Pedro Pombeiro
committed
fixup! Update PNs to use data-only messaging, and only encode/decode data values. Fixes #6772
1 parent f07c4e8 commit 3ae5e1d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/status_im/chat/models/message.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
(when (and fcm-token (= status :sent))
326326
(let [payload {:from (accounts.db/current-public-key cofx)
327327
:to (get-in cofx [:db :current-chat-id])}]
328-
{:send-notification {:data-payload {:msg (js/JSON.stringify (clj->js payload))}
328+
{:send-notification {:data-payload (notifications/create-notification-payload payload)
329329
:tokens [fcm-token]}})))
330330

331331
(fx/defn update-message-status [{:keys [db]} chat-id message-id status]

src/status_im/notifications/core.cljs

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
(defn create-notification-payload
3333
[{:keys [from to] :as payload}]
3434
(if (and from to)
35-
#js {:msg (js/JSON.stringify #js {:from from
36-
:to to})}
35+
{:msg (js/JSON.stringify #js {:from from
36+
:to to})}
3737
(throw (str "Invalid push notification payload" payload))))
3838

3939
(when platform/desktop?
@@ -65,8 +65,8 @@
6565
(.. notification
6666
(setTitle title)
6767
(setBody body)
68-
(setData (create-notification-payload {:from from
69-
:to to}))
68+
(setData (clj->js (create-notification-payload {:from from
69+
:to to})))
7070
(setSound sound-name))
7171
(when platform/android?
7272
(.. notification

0 commit comments

Comments
 (0)