0

The problem is following: we have an application with two backends - dev and prod. Each one contains different set of users. A developer can switch between them with some known to him actions in app on the fly. So for fcm we created two projects - one for dev environment and another for prod environment. On iOS we can switch between as following:

if([FIRApp defaultApp] != nil){

    [[FIRMessaging messaging] disconnect];
    [[FIRApp defaultApp]deleteApp:^(BOOL success){

        FIROptions* firebaseOptions = [[FIROptions alloc] initWithContentsOfFile:firebaseConfigPath];
        [FIRApp configureWithOptions:firebaseOptions];

    }];

}
else{

    FIROptions* firebaseOptions = [[FIROptions alloc] initWithContentsOfFile:firebaseConfigPath];
    [FIRApp configureWithOptions:firebaseOptions];

}

firebaseConfigPath is chosen for corresponding environment.

How to implement the same on Android? Thanks

AL.
  • 36,815
  • 10
  • 142
  • 281
  • Hmm. Are you possibly pertaining to having different flavors? See these posts -- http://stackoverflow.com/q/30772201/4625829, http://stackoverflow.com/q/37463092/4625829, http://stackoverflow.com/q/38132763/4625829 – AL. Jan 19 '17 at 06:32
  • Will be those flavors inside one apk? And how to switch between them programmatically? – Bio Babay Jan 19 '17 at 07:03

0 Answers0