Fork me on GitHub

Hi, I’m implementing Apple Sign In in React Native using this library: And there’s a handler for the onPress event of the Apple Sign-In button given like so: However, when I convert this to clojurescript like so: I’m getting the following error: How can I fix this error?


this looks like the clj->js call is coercing the EMAIL and other special values into invalid things. writing out the JS data structure by hand is probably the smartest thing to do


I also tried doing this: But that gives: “RNAppleAuth.AppleAutRequestOptions ‘requestedScopes’ must be an array value if provided.” And removing ‘requestedScopes’ gives a “Promise error”.


I think you were close with this solution


you need to add a #js in front of the the [ bracket in

[(.. appleAuth -Scope -Email)
                                                       (.. appleAuth -Scope -FULL_NAME)]


right now it's sending a CLJS vector, when it expects a js array. a way you create one is via #js []


@U4YGF4NGM I tried this:

(.performRequest appleAuth
                                   #js {:requestedOperation (.. appleAuth -Operation -LOGIN)
                                        :requestedScopes #js [(.. appleAuth -Scope -Email)
                                                              (.. appleAuth -Scope -FULL_NAME)]})
But that still gives me NSMutableDictionary cannot be converted to ASAutorizationAppleIDRequest


not without more info


in the earlier form of this I think that the full error message was relevant


JSON value '{
    nonceEnabled = 1;
    requestedOperation = 1;
    requestedScopes =     (
}' of type NSMutableDictionary cannot be converted to ASAuthorizationAppleIDRequest *
you see requestScopes = ( "<null>" which isn't a valid member of the enum on the iOS side


my best guess is you're still passing something incorrect to it


hello, does anyone know if there a way to detect the compiler version (or closure version) and branch code depending on that? i'm trying to work out how to cope with the in a backwards compatible way, namely decide whether to use goog.debug.Logger.Level.SEVERE or goog.Logger.Level.SEVERE


without knowing the cljs/closure compiler specifics, I’d assume (exists? goog.Logger) could be one way to find out if you are on the newer version


That is probably more robust than reading the version anyway.


ah perfect, thank you i didn't know about exists? . it looks to be exactly what i want


Take a look in figwheel-core repo. I believe bhauman just solved the problem your looking at. Could be insightful

👍 3

Interesting, he used the clojurescript version (which is available, it turns out). But presumably, although unlikely, the Google closure version can differ from the default one if someone excludes the dep and uses their own version. Here's the code in figwheel-core for anyone interested


have a rum component that displays 3 strings from a collection of strings. in my on-click for the component,

{:on-click (fn [_] (do
				(reset! names-wedge  (take 3 (shuffle names-quiz-terms)))))}
this will cause an infinite loop where the reset! happens over and over again. can i prevent such loops from happening? I run into this behavior sometimes, could someone help clarify how to prevent this or what's going on?


do you have any other resets to names-wedge? this doesn't seem like it should cause an infinite loop.


Thank you that was it ! 😃


there was a (reset!) in the body of the component ... just hanging out