Merge pull request #5721 from status-im/fix/5571-fix-blank-screen-on-new-account

Always define request-permissions
This commit is contained in:
Vitaliy Vlasov 2018-09-05 13:44:34 +03:00 committed by GitHub
commit c8e7267f3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 14 deletions

View File

@ -37,7 +37,7 @@ ExternalProject_Add(StatusGo_ep
PREFIX ${StatusGo_PREFIX} PREFIX ${StatusGo_PREFIX}
SOURCE_DIR ${StatusGo_SOURCE_DIR} SOURCE_DIR ${StatusGo_SOURCE_DIR}
GIT_REPOSITORY https://github.com/status-im/status-go.git GIT_REPOSITORY https://github.com/status-im/status-go.git
GIT_TAG develop-g19b53030 GIT_TAG v0.13.1
BUILD_BYPRODUCTS ${StatusGo_STATIC_LIB} BUILD_BYPRODUCTS ${StatusGo_STATIC_LIB}
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIGURE_SCRIPT} ${GO_ROOT_PATH} ${StatusGo_ROOT} ${StatusGo_SOURCE_DIR} CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${CONFIGURE_SCRIPT} ${GO_ROOT_PATH} ${StatusGo_ROOT} ${StatusGo_SOURCE_DIR}
BUILD_COMMAND "" BUILD_COMMAND ""

View File

@ -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)))))