Skip to content
1 change: 1 addition & 0 deletions FirebaseAuth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 11.2.0
- [Fixed] Fixed crashes that could occur in Swift continuation blocks running in the Xcode 16
betas. (#13480)
- [Fixed] Fixed Phone Auth via Sandbox APNS tokens that broke in 11.0.0. (#13479)

# 11.1.0
- [fixed] Fixed `Swift.error` conformance for `AuthErrorCode`. (#13430)
Expand Down
9 changes: 5 additions & 4 deletions FirebaseAuth/Sources/Swift/Backend/VerifyClientRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class VerifyClientRequest: IdentityToolkitRequest, AuthRPCRequest {
if let appToken = appToken {
postBody[Self.appTokenKey] = appToken
}
postBody[Self.isSandboxKey] = isSandbox
if isSandbox {
postBody[Self.isSandboxKey] = true
}
return postBody
}

Expand All @@ -42,11 +44,10 @@ class VerifyClientRequest: IdentityToolkitRequest, AuthRPCRequest {
/// The flag that denotes if the appToken pertains to Sandbox or Production.
private(set) var isSandbox: Bool

init(withAppToken: String?,
init(withAppToken appToken: String?,
isSandbox: Bool,
requestConfiguration: AuthRequestConfiguration) {
appToken = withAppToken
self.isSandbox = isSandbox
self.appToken = appToken
self.isSandbox = isSandbox
super.init(endpoint: Self.verifyClientEndpoint, requestConfiguration: requestConfiguration)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,11 @@
}

// TODO: resolve https://github.com/firebase/firebase-ios-sdk/issues/10921
if Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt" {
// Distributed via TestFlight
return defaultAppTypeProd
}
// to support TestFlight

let path = Bundle.main.bundlePath + "embedded.mobileprovision"
guard let url = URL(string: path) else {
AuthLog.logInfo(code: "I-AUT000007", message: "\(path) does not exist")
return defaultAppTypeProd
}
let path = Bundle.main.bundlePath + "/" + "embedded.mobileprovision"
do {
let profileData = try Data(contentsOf: url)
let profileData = try NSData(contentsOfFile: path) as Data

// The "embedded.mobileprovision" sometimes contains characters with value 0, which signals
// the end of a c-string and halts the ASCII parser, or with value > 127, which violates
Expand All @@ -177,7 +170,7 @@

let scanner = Scanner(string: embeddedProfile)
if scanner.scanUpToString("<plist") != nil {
guard let plistContents = scanner.scanUpToString("</plist>"),
guard let plistContents = scanner.scanUpToString("</plist>")?.appending("</plist>"),
let data = plistContents.data(using: .utf8) else {
return defaultAppTypeProd
}
Expand All @@ -194,7 +187,8 @@
message: "Provisioning profile has specifically provisioned devices, " +
"most likely a Dev profile.")
}
guard let apsEnvironment = plistMap["Entitlements.aps-environment"] as? String else {
guard let entitlements = plistMap["Entitlements"] as? [String: Any],
let apsEnvironment = entitlements["aps-environment"] as? String else {
AuthLog.logInfo(code: "I-AUT000013",
message: "No aps-environment set. If testing on a device APNS is not " +
"correctly configured. Please recheck your provisioning profiles.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseExperimental1;
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebaseAuthSDKSampleApp.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand All @@ -817,7 +817,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseExperimental1;
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebaseAuthSDKSampleApp.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@
ReferencedContainer = "container:AuthenticationExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-FIRDebugEnabled"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Binary file modified scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg
Binary file not shown.
Binary file modified scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg
Binary file not shown.