mirror of
https://github.com/status-im/status-react.git
synced 2025-02-17 05:16:46 +00:00
Always define request-permissions
Remove empty line Another empty line
This commit is contained in:
parent
c176d9a160
commit
14cada8373
@ -13,20 +13,22 @@
|
|||||||
|
|
||||||
(when-not platform/desktop?
|
(when-not platform/desktop?
|
||||||
|
|
||||||
(def firebase (object/get rn/react-native-firebase "default"))
|
(def firebase (object/get rn/react-native-firebase "default")))
|
||||||
|
|
||||||
;; NOTE: Only need to explicitly request permissions on iOS.
|
;; NOTE: Only need to explicitly request permissions on iOS.
|
||||||
(defn request-permissions []
|
(defn request-permissions []
|
||||||
(if platform/desktop?
|
(if platform/desktop?
|
||||||
(re-frame/dispatch [:notifications/request-notifications-granted {}])
|
(re-frame/dispatch [:notifications/request-notifications-granted {}])
|
||||||
(-> (.requestPermission (.messaging firebase))
|
(-> (.requestPermission (.messaging firebase))
|
||||||
(.then
|
(.then
|
||||||
(fn [_]
|
(fn [_]
|
||||||
(log/debug "notifications-granted")
|
(log/debug "notifications-granted")
|
||||||
(re-frame/dispatch [:notifications/request-notifications-granted {}]))
|
(re-frame/dispatch [:notifications/request-notifications-granted {}]))
|
||||||
(fn [_]
|
(fn [_]
|
||||||
(log/debug "notifications-denied")
|
(log/debug "notifications-denied")
|
||||||
(re-frame/dispatch [:notifications/request-notifications-denied {}]))))))
|
(re-frame/dispatch [:notifications/request-notifications-denied {}]))))))
|
||||||
|
|
||||||
|
(when-not platform/desktop?
|
||||||
|
|
||||||
(defn get-fcm-token []
|
(defn get-fcm-token []
|
||||||
(-> (.getToken (.messaging firebase))
|
(-> (.getToken (.messaging firebase))
|
||||||
@ -158,3 +160,4 @@
|
|||||||
(handle-push-notification {:from from
|
(handle-push-notification {:from from
|
||||||
:to to}
|
:to to}
|
||||||
cofx)))))
|
cofx)))))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user