0
votes

I am retrieving data from firebase database.

When I debug the code from simulator it gives all the data from that node but when i debug the code from device it neither goes to success block nor error block. Nothing happens.

Code I have written is given below.

FIRDatabase.database().reference().child("registeredUserEmail").observeSingleEventOfType(.Value, withBlock: { (snapshot) in
        debugPrint(snapshot.value)
        if snapshot.hasChild(email.escapeEmail()) {
            debugPrint("false")
            completion(false)
        }
        else {
            debugPrint("true")
            completion(true)
        }
    }) { (error) in
        debugPrint("error in isEmailFree - " + error.localizedDescription)
        completion(false)
    }

Here are the console logs when app first time launches

2016-06-07 11:36:30.471[4067:1092564] Configuring the default app. 2016-06-07 11:36:30.530[4067:] Firebase Analytics v.3200000 started 2016-06-07 11:36:30.532 Artup[4067:] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 2016-06-07 11:36:30.576[4067:1092564] Firebase Crash Reporting: Successfully enabled 2016-06-07 11:36:30.590: FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO 2016-06-07 11:36:30.659 Artup[4067:] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist Config not fetched Error Error Domain=com.google.remoteconfig.ErrorDomain Code=8002 "(null)" UserInfo={error_throttled_end_time_seconds=1465279698.4105051} 2016-06-07 11:36:31.450 Artup[4067:] Firebase Analytics enabled

2
what are your console logsShubhank
In the above code none of the message are printed. Console log is clear.sant05
some other logs of firebase might be there in the log.Shubhank
Hey @Shubhank I have edited the question.Please check out the console logs when app first time launchessant05
is the method in which you are calling this even being called ?Shubhank

2 Answers

0
votes

From other Firebase products on iOS and from the UserInfo bit, I think the request is being throttled. Firebase remote config will throttle your requests — I can't speak for the database, however. I don't see anything in the Firebase documentation about this but it seems likely the cause of this error.

1
votes

From the error logs it looks like the error is coming directly from a RemoteConfig fetch. Is this being instrumented somewhere in your app delegate?

Right at the end of of your log the following part is of interest. {error_throttled_end_time_seconds=1465279698.4105051}. This time translates to Jun 7, 2016, 4:08 PM. Now at first this looks like a throttling expiry of 4.5 hours but this is unlikely. This is time is most likely in UTC and you would have to adjust this to your local timezone of your logging 2016-06-07 11:36:30.471

A 30 mins throttling sound about right. Unfortunately, I cannot find documentation around the strict rules around throttling.