Fork me on GitHub
#cljsrn
<
2016-12-06
>
vikeri07:12:53

@jorda0mega We’re just winging https://github.com/vikeri/re-navigate at the moment. Very simple setup. But ex-navigation seems promising for a more complete solution.

seantempesta07:12:50

@jorda0mega: I’m having pretty good luck with react-router-native. I like the url->route mapping mentality.

seantempesta07:12:38

pretty easy to keep it in sync with re-frame too:

(defn routes []
  (let [app-db-current-route (subscribe [:current-route])]
    (r/create-class
      {:component-did-mount
       (fn []
         (ocall nativeHistory "listen" #(let [routing-location (oget (ocall nativeHistory "getCurrentLocation") "pathname")]
                                          (debug "ROUTING UPDATE:" routing-location)
                                          (dispatch [:change-route routing-location]))))

       :reagent-render
       (fn []
         (let [current-route @app-db-current-route
               routing-location (aget (ocall nativeHistory "getCurrentLocation") "pathname")]
           (debug "ROUTING RENDER:" current-route routing-location)

           ;; If the app-db route is different than the router, change it so they are the same
           (when (not= current-route routing-location)
             (ocall InteractionManager "runAfterInteractions" #(.replace nativeHistory current-route)))

           ;; App Routing
           [:> Router {:history    nativeHistory
                       :addressBar true}
            [:> Route {:path "/login"
                       :component (r/reactify-component login/core)
                       :onSwipeBack #()
                       :onSwipeForward #()
                       :transition “vertical-card-stack”}]
…

mac09:12:34

Any tips for how to input/store a user specific API key?

vikeri10:12:41

@mac Could you be more specific?

mac10:12:28

@vikeri My app is using the meetup api and I need for the user to input an API key and store (preferably securely) in the app. Is there a relevant Android/iOS API for input/storage of such info? like a key ring or something similar.

vikeri10:12:21

I see, not sure. I know the DB Realm can do encryption. Another alternative is to encrypt the data before putting it in the AsyncStorage using a KDF if you have a password for opening the app. Or possibly use Settings (quite safe, but not if the device is rooted): https://facebook.github.io/react-native/docs/settings.html

mac10:12:56

@vikeri Thanks, Settings looks like what I need.

vikeri10:12:45

:thumbsup:

tiensonqin11:12:15

@jorda0mega I've setup a minimal cljs-ex-navigation example several days before. https://github.com/exponent-contrib/cljs-ex-navigation

mac13:12:25

I cannot relate it to any recent changes and I think figwheel must have been stopped for a while. Reverting to previous commits that worked now throws the same error.

tiensonqin13:12:35

@mac Is react-native packager still running? You can also press Debug JS Remotely, For debugging figwheel-bridge.js, you can set debugEnabled to true on L2.

mac13:12:01

@tiensonqin I get "Unable to connect to remote debugger". Excuse my ignorance but what is L2?

mac13:12:03

@tiensonqin "React Native JS code runs inside this Chrome tab...." - I am now getting an error saying that ...goog/base.js' failed to load.

tiensonqin13:12:20

What’s in your target dir?

tiensonqin13:12:28

Is goog/base.js there?

tiensonqin13:12:00

If not, maybe you need to run lein figwheel first.

mac13:12:39

@tiensonqin That did the trick. I have no idea how I ended in this state.

tiensonqin13:12:03

@mac glad it works.