File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 325
325
(when (and fcm-token (= status :sent ))
326
326
(let [payload {:from (accounts.db/current-public-key cofx)
327
327
: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)
329
329
:tokens [fcm-token]}})))
330
330
331
331
(fx/defn update-message-status [{:keys [db]} chat-id message-id status]
Original file line number Diff line number Diff line change 32
32
(defn create-notification-payload
33
33
[{:keys [from to] :as payload}]
34
34
(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})}
37
37
(throw (str " Invalid push notification payload" payload))))
38
38
39
39
(when platform/desktop?
65
65
(.. notification
66
66
(setTitle title)
67
67
(setBody body)
68
- (setData (create-notification-payload {:from from
69
- :to to} ))
68
+ (setData (clj->js ( create-notification-payload {:from from
69
+ :to to}) ))
70
70
(setSound sound-name))
71
71
(when platform/android?
72
72
(.. notification
You can’t perform that action at this time.
0 commit comments