Skip to content

Sign in alert shown inconsistently when triggered in viewDidAppear #8096

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

Closed
lfkellogg opened this issue May 17, 2021 · 2 comments
Closed

Sign in alert shown inconsistently when triggered in viewDidAppear #8096

lfkellogg opened this issue May 17, 2021 · 2 comments

Comments

@lfkellogg
Copy link
Contributor

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.4
  • Firebase SDK version: 8.0.0
  • Installation method: CocoaPods
  • Firebase Component: App Distribution
  • iOS version: 13+

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

  1. Create a new Project, choose the "App" template, then set Interface to Storyboard
  2. Follow the docs to set up the SDK in the "Basic" configuration, calling checkForUpdate from viewDidAppear
  3. Run the app on a device running iOS 13+
  4. [Optional] If the "Enable new build alerts" alert is shown on launch, kill the app from the app switcher and re-launch it

Expected behavior: on first launch and on subsequent launches before signing in, the SDK should show the "Enable new build alerts" alert.

Actual behavior: It is inconsistent. Often the alert will show up on first launch, but not on subsequent launches. Sometimes not even on first launch.

Relevant Code:

Debugging the SDK locally, the issue appears to be with this line:

if (connectedScene.activationState == UISceneActivationStateForegroundActive) {

Sometimes, the scene has not become active by the time viewDidAppear is called. In that case we do not find a foreground scene here, and the alert cannot be shown. This is illustrated by a workaround where checkForUpdate is triggered from the SceneDelegate's sceneDidBecomeActive instead.

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Dec 11, 2021
a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Jan 14, 2022
a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Jan 22, 2022
a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Jan 22, 2022
a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Jan 22, 2022
a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Jan 29, 2022
a-25 added a commit to a-25/firebase-ios-sdk that referenced this issue Jan 29, 2022
tejasd added a commit that referenced this issue Sep 28, 2022
tejasd added a commit that referenced this issue Sep 29, 2022
#10288)

* Simple fix for #8096

* Update FirebaseAppDistribution/CHANGELOG.md

Co-authored-by: Nick Cooke <[email protected]>

Co-authored-by: Nick Cooke <[email protected]>
@tejasd
Copy link
Contributor

tejasd commented Nov 1, 2022

This has been fixed for single scene apps in Firebase SDK version: 10.1.0

@tejasd tejasd closed this as completed Nov 1, 2022
@firebase firebase locked and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants