Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

SDK 51.2.1.5 makes FirebaseAuth.service.isSignedIn() return false randomly on iOS only

Open myflashlab opened this issue 5 months ago • 6 comments

Hi! This one was a very tricky one but I finally managed to narrow down the test environment and here are the results:. Needs @marchbold and @ajwfrost attention at the same time

I explain as short as possible, in my app, I am using FirebaseAuth and users login using their gmail account. After a successful login, I kill the app and open it again. I call FirebaseAuth.service.isSignedIn() to see if user is already logged in or not. It's been working fine for years but simply by switching to AIR SDK 51.2.1.5, that firebase method returns false "randomly".

I have to kill the app 3 or 4 times and by chance it returns true. again I kill the app and when running again, it takes a few tries to return true...

At first I thought maybe it was because of some firebase servers not working ok temporarily, or maybe my internet connection was not stable or something, but then I decided to do a very exact testing to be sure.

There is something going on in the new AIR SDK that makes isSignedIn return random, unexpected results. And this is only happening on iOS. the Android version with the latest SDK, works as expected.

@marchbold let me know if you can duplicate this problem or you might need more info?

myflashlab avatar Jun 10 '25 23:06 myflashlab

Hi @myflashlab

I don't suppose you know whether it was working with something like 51.2.1.1? Or when it was last working? Presumably you've isolated it to the AIR SDK change rather than there being any updates in the ANEs or similar?

There's one thing we've just found with some testing of Steam apps that might be linked here: dropping in 51.1.3.10 to a Steam application (that was originally using 51.1.1.4) worked fine, but when we put 51.2.1.5 into it, there was a failure within an ANE which complained about running a Steam API without initialisation having completed.

So there may be some difference here in how ANEs are working which is causing a problem to this. Can I check, you say this affects iOS and not Android - are there other platforms that you've tried? Presumably the Android ANE is using a Java interface so this could be an issue in the C API...

Probably the best first step is for us to work out what's changed and why this Steam ANE is suddenly failing, to see if that then makes a difference..

thanks

Andrew

ajwfrost avatar Jun 11 '25 07:06 ajwfrost

Hmmm... maybe I need to take that back, today I can't cause any bad behaviour in the Steam ANE, and we're tracing out all the calls made to create ANEs and to call them, and we're seeing this being identical between the versions. Odd...

@marchbold is there any way you can reproduce this or add some logging that might help determine what's changed that causes this issue?

thanks

ajwfrost avatar Jun 11 '25 07:06 ajwfrost

Correct, I started testing with 51.2.1.5 and don't know the earlier ones. To be exact, switching back to 51.1.3.10 is the last good thing. And yes, the test is isolated to SDK change only. ANEs are not changing and they are on the latest available version.

myflashlab avatar Jun 11 '25 08:06 myflashlab

Thanks for the details. We've since worked out what caused the issue we were seeing in the Steam ANE so that's not actually anything to do with differences in AIR, so that can be discounted. Which means, I'm not at all sure what might be causing a problem with this, so it would be good if we were to have a way to reproduce it..

thanks

ajwfrost avatar Jun 11 '25 12:06 ajwfrost

@myflashlab Could you elaborate on the process you are using at startup? Also which versions of iOS are you encountering this issue on? Are you using the iOS SDK to package your app or using the default included in AIR?

I'm struggling to guess how this might be related to AIR, but potentially could be related to the iOS SDK version the app is packaged against.

marchbold avatar Jun 11 '25 22:06 marchbold

@marchbold Here is my build script:

#!/bin/sh
clear
export PATH=$PATH:$1

adt -package -target ipa-app-store \
-storetype PKCS12 \
-keystore $3/$5 \
-storepass $6 \
-provisioning-profile $3/$7 \
$2/App.ipa \
$2/Main-app.xml \
-extdir ../ane \
-platformsdk /Users/hadi/Documents/AIR_SDK/iPhoneOS18.2.sdk \
-C $2 Main.swf \
-C $4 Assets.car \
-C $8 worker.swf \
-C $4 LaunchScreen.storyboardc \
-C $4/iOS_icons icons \
-C $4 img \
-C $4 GoogleService-Info.plist \
-C $9 .

Have been using iPhoneOS18.2.sdk downloaded from here. for both builds. And have been testing on iOS 18.5

And working with Firebase is pretty standard like this:

Core.init();

var success:Boolean = Firebase.service.initialiseApp();
if (success)
{
	// inital setup for crashlytics, notifications, remoteconfigs, etc and then:
	
	// An early call to see if user is logged in or not so UI elements would be set correctly.
	firebaseAuthStateChanged();
	
	// Through the whole app, I will only listen to this event to know what to do in UI when auth changes
	FirebaseAuth.service.addEventListener(FirebaseAuthEvent.AUTHSTATE_CHANGED, firebaseAuthStateChanged);
}

public function firebaseAuthStateChanged(e:FirebaseAuthEvent=null):void
{
	var isSignedIn:Boolean = auth.isSignedIn();
}

myflashlab avatar Jun 12 '25 06:06 myflashlab

Update: I didn't have hope to see any difference but updated to 51.2.1.6 to see if anything has changed. unfortunately the same is happening. can't use this SDK for production yet. @marchbold have you been able to replicate this issue? What do you need from me to be able to see the issue?

myflashlab avatar Jul 02 '25 14:07 myflashlab

We haven't been able to replicate this issue, but we are working on the next major update to Firebase and will get this released soon, hopefully this will resolve the issue for you.

marchbold avatar Jul 03 '25 00:07 marchbold

We haven't been able to replicate this issue, but we are working on the next major update to Firebase and will get this released soon, hopefully this will resolve the issue for you.

Great news !!! We heavily use your Firebase ANE (And have collaborated years ago with @myflashlab as platinum partner in their one too!!) if you need help testing performance or something we'll be happy to help ;)

Dextercitox avatar Jul 03 '25 10:07 Dextercitox

Ok, have not been updating AIR SDK and ANEs for a while because of this issue, but today I updated the project to 51.2.2.4 without touching the ANEs and the issue is fixed. I'm closing this ticket and start updating the ANEs now :)

Update: ok, I get that back. it is still happening in 51.2.2.4 but just a little bit less number of times. I'll try to see what happens after updating the ANEs with the latest release and will open a new ticket if required.

Update 2: updating to the latest ANEs solved the issue. All good now. Thanks.

myflashlab avatar Sep 07 '25 13:09 myflashlab