firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Remote Config Fetch fails on iOS

Open BaluNaik opened this issue 4 years ago • 6 comments

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository file a GitHub issue.
    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one of the above categories, reach out to Firebase Support.
  • Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.1 (13A1030d)
  • Firebase SDK version: 8.13.0
  • Installation method: CocoaPods (select one)
  • Firebase Component: Remote Config
  • Target platform(s): iOS

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Use of any of the Swift RemoteConfig fetch methods

Now always returns an error in the completionHandler, and does NOT apply the Remote-Configs from the Firebase Server.

This is a print out of the error object of the completionHandler

Failed to get installations token. Error : Error Domain=com.firebase.installations Code=0 "Underlying error: اتصال البيانات غير مسموح به حاليًا." UserInfo={NSLocalizedFailureReason=Underlying error: اتصال البيانات غير مسموح به حاليًا., NSUnderlyingError=0x280b9ea90 {Error Domain=NSURLErrorDomain Code=-1020 "اتصال البيانات غير مسموح به حاليًا." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x280b9fde0 {Error Domain=kCFErrorDomainCFNetwork Code=-1020 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <26E9BE02-FF19-45A0-BE9D-DAC77E5E9F80>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <26E9BE02-FF19-45A0-BE9D-DAC77E5E9F80>.<1>" ), NSLocalizedDescription=اتصال البيانات غير مسموح به حاليًا., NSErrorFailingURLStringKey=https://firebaseinstallations.googleapis.com/v1/projects/xxxxxxx-xxxxx-prod/installations/eLG8mxJwhjg/authTokens:generate, NSErrorFailingU

Relevant Code:

        let remoteConfig : RemoteConfig = RemoteConfig.remoteConfig()
        let settings = RemoteConfigSettings()
        settings.minimumFetchInterval = 900
        settings.fetchTimeout = 10
        remoteConfig.configSettings = settings

        remoteConfig.fetchAndActivate(completionHandler: { status, error in
            if status == .error {
                NMSCrashlyticsLogger.sharedInstance.logNonFatalError(info: ["RemoteConfig": error?.localizedDescription ?? "No error available."])
            }
        })

BaluNaik avatar Apr 20 '22 10:04 BaluNaik

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Apr 20 '22 10:04 google-oss-bot

This issue is affecting firebase-remote-config version 7.11.0 as well.

arshedg avatar Apr 20 '22 17:04 arshedg

Translating اتصال البيانات غير مسموح به حاليًا." shows "Data connection is not currently allowed".

Please check the connection on the test device.

paulb777 avatar Apr 20 '22 17:04 paulb777

RemoteConfig.remoteConfig().activate(completion: { change , error in
                    if let error = error {
                        print("Remote config ERROR ACTIVATE : \(error.localizedDescription) ")
                        listner?.onError(error: error)
                        return;
                    }
                    print("Remote config change : \(change)")
                    listner?.onSuccess(change: change)
                })

The completion handler is getting called only once (may be once per cache interval). Earlier completion used to get called irrespective of cache interval.

arshedg avatar Apr 20 '22 17:04 arshedg

Translating اتصال البيانات غير مسموح به حاليًا." shows "Data connection is not currently allowed".

Please check the connection on the test device.

@paulb777 Thanks for response. Let me check and get back on this.

BaluNaik avatar Apr 21 '22 11:04 BaluNaik

@paulb777 it seems a network glitch on app launch and its failing to load remote config. Now adding an additional condition to check? network is available or not along with status check. For now closing this and we will monitor our app in next release.

BaluNaik avatar Apr 25 '22 10:04 BaluNaik