firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Logic error detecting TestFlight in FIRAuthAPNSTokenManager.m

Open paulb777 opened this issue 2 years ago • 1 comments

Description

Since there will always be a bundlePath, path.length will always be non-zero and the if will never be true

  NSString *path = [[[NSBundle mainBundle] bundlePath]
                    stringByAppendingPathComponent:@"embedded.mobileprovision"];
  if ([GULAppEnvironmentUtil isAppStoreReceiptSandbox] && !path.length) {
    // Distributed via TestFlight
    return defaultAppTypeProd;
  }

https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseAuth/Sources/SystemService/FIRAuthAPNSTokenManager.m#L154

This stackoverflow post may be useful.

Reproducing the issue

I haven't reproduced, but discovered via code inspection. This code hasn't changed in years.

Firebase SDK Version

10.6.0

Xcode Version

14.2

Installation Method

CocoaPods

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

paulb777 avatar Mar 09 '23 15:03 paulb777

Could wrap the associated logic with #if DEBUG to prevent local builds from being treated as testflight builds.

ncooke3 avatar Aug 27 '24 17:08 ncooke3

Closing for staleness. Please comment or create a new issue referring to this one for reconsideration.

paulb777 avatar Aug 29 '25 23:08 paulb777