Giter Site home page Giter Site logo

Comments (10)

paulb777 avatar paulb777 commented on May 30, 2024 1

Right no workaround for that. FirebaseAnalytics only works with the default app #230

from firebase-ios-sdk.

paulb777 avatar paulb777 commented on May 30, 2024 1

Sorry about the trouble here. Looking at the code in more detail, it seems that a single namespace - FIRNamespaceGoogleMobilePlatform is used for all apps.

I'll follow up with the team to clarify if this is a bug or a missing feature.

from firebase-ios-sdk.

google-oss-bot avatar google-oss-bot commented on May 30, 2024

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

from firebase-ios-sdk.

paulb777 avatar paulb777 commented on May 30, 2024

It looks like you need to use the remoteConfig(app:) API

from firebase-ios-sdk.

asetiyadi-MLB avatar asetiyadi-MLB commented on May 30, 2024

@paulb777 .. I tried using this

guard let app = FirebaseApp.app() else { return }
remoteConfig = RemoteConfig.remoteConfig(app: app)

and I am still not getting the right remote config values for the intended environment (after the runtime switch)

from firebase-ios-sdk.

paulb777 avatar paulb777 commented on May 30, 2024

Here's an example of configuring a non-default app:

https://github.com/firebase/firebase-ios-sdk/blob/auth-swift/FirebaseAuth/Tests/SampleSwift/AuthenticationExample/AppManager.swift#L40

from firebase-ios-sdk.

asetiyadi-MLB avatar asetiyadi-MLB commented on May 30, 2024

@paulb777 I did some testing using the non-default implementation. Following the sample codes however I am still not getting the remoteConfig values after switching environment.

public init(plist: Plist) {
    guard let plistPath = Bundle.module.path(forResource: plist, ofType: "plist"),
          let firebaseOptions = FirebaseOptions(contentsOfFile: plistPath)
    else {
      fatalError("πŸ’₯ Invalid GoogleService plist info")
    }

    FirebaseApp.configure(name: appName, options: firebaseOptions)

    guard let app = FirebaseApp.app(name: appName)
    else {
      fatalError()
    }
    
    Self.firebaseApp = app
    self.firestoreConfiguration = FirestoreConfiguration(app: app)
    Self.config = RemoteConfig.remoteConfig(app: app)
  }

The iOS app is pointing to the correct Firestore environment, only the remoteConfig is having the issue.

The other thing that I read from the remoteConfig(app:) API, this will cause FirebaseAnalytics to not working with non-default app. We use FirebaseAnalytics on our app. Is there no workaround for this?

from firebase-ios-sdk.

asetiyadi-MLB avatar asetiyadi-MLB commented on May 30, 2024

That is a bummer on the FirebaseAnalytics.

As for the remoteConfig itself, has it ever been proven to be working if we use remoteConfig(app:) it can support changing environment at runtime?

from firebase-ios-sdk.

paulb777 avatar paulb777 commented on May 30, 2024

Yes, it turns out that Remote Config manages all Firebase apps in a single namespace, so that the functionality does not work as it would be expected. Changing the behavior would be a large task and not something we can prioritize now. Also, it might break apps relying on the current behavior. I'll rename the issue and we can use it to track thumbs-up requests for proper multi-Firebase app support.

from firebase-ios-sdk.

asetiyadi-MLB avatar asetiyadi-MLB commented on May 30, 2024

@paulb777 Thank you for the clarification. It would be great if Firebase can support multi environments (especially for switching environment at runtime) for both Remote Config and Analytics. Sounds like this is a feature that have been requested before as well. It would be a very welcome addition.

from firebase-ios-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.