Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent reconfiguration causing exception #419

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Prevent reconfiguration causing exception #419

merged 1 commit into from
Jun 8, 2020

Conversation

warby613
Copy link

@warby613 warby613 commented Jun 2, 2020

We ran into a problem with a configuration using the firebasex and firebase-analytics plugins together. The latter was performing [FIRApp configure] during the [self application:application... super call at the top of this function, which caused an exception when FIRApp was configured again by this plugin. This exception bypassed the remainder of the code block and prevented our app from receiving push notification data when the terminated (not just backgrounded) iOS app was opened by tapping a notification.

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation changes
  • Other... Please describe:

PR Checklist

For bug fixes / features, please check if your PR fulfills the following requirements:

  • Testing has been carried out for the changes have been added
  • Regression testing has been carried out for existing functionality
  • Docs have been added / updated

What is the purpose of this PR?

Reconfiguration of FIRApp causes an exception in appWasConfiguredTwice. Another plugin (firebase-analytics) was configuring FIRapp already, so this simply makes configuration conditional on ![FIRApp defaultApp].

Does this PR introduce a breaking change?

  • Yes
  • No

What testing has been done on the changes in the PR?

Without this change, the exception is raised and data from a tapped push notification received when the app is terminated does not reach our code. With the change, all notifications work as expected.

What testing has been done on existing functionality?

Our app works as expected now.

Other information

Sorry, I forgot to make a branch and just made the change directly in the master of my fork. Let me know if that's a problem and I can resubmit. It's really a one-line logic change with some whitespace implications. Thanks for all your great work!

We ran into a problem with a configuration using both the firebasex and firebase-analytics plugins. The latter was doing "[FIRApp configure]" during the "[self application:application..." super call at the top of this function, which caused an exception when FIRApp was configured again by this plugin. The exception bypassed the remainder of the code block and prevented our app from receiving push notification data.
@tzappia
Copy link

tzappia commented Jun 2, 2020

I wonder if there's a similar issue on Android? The plugin calls FirebaseApp.initializeApp() however the documentation says it should be used In the event that an app requires access to another Firebase project in addition to the default project. and For a vast majority of apps, FirebaseInitProvider will handle the initialization of Firebase for the default project that it's configured to work with.

https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants