Skip to content

Commit 25c29f5

Browse files
authored
Make App Distribution compatible with swizzling-disabled implementations (#10418)
* Revert "Include subheaders in script output (#10212)" This reverts commit 11313da. * make app distro swizzling compatible * add changelog * fix build
1 parent d1594ce commit 25c29f5

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

FirebaseAppDistribution/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
- [added] Added a public `application(_:openURL:options:)` method so users
3+
with swizzling disabled can still use App Distribution (#10418).
4+
15
# 10.1.0
26
- [fixed] Fixed inconsistent sign in prompts in single scene apps (#8096).
37

FirebaseAppDistribution/Sources/FIRAppDistribution.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,13 @@ - (BOOL)isCodeHashIdentical:(NSString *)codeHash {
336336

337337
return codeHash && [codeHash isEqualToString:[machO codeHash]];
338338
}
339+
340+
#pragma mark - Swizzling disabled
341+
342+
- (BOOL)application:(UIApplication *)application
343+
openURL:(NSURL *)url
344+
options:(NSDictionary<NSString *, id> *)options {
345+
return [self.uiService application:application openURL:url options:options];
346+
}
347+
339348
@end

FirebaseAppDistribution/Sources/FIRAppDistributionUIService.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ - (BOOL)application:(UIApplication *)application
179179
if (self.registrationFlowCompletion) {
180180
FIRFADDebugLog(@"Continuing registration flow: %@", [self registrationFlowCompletion]);
181181
[self resetUIState];
182-
if (@available(iOS 9.0, *)) {
183-
[self logRegistrationCompletion:nil authType:[SFSafariViewController description]];
184-
}
182+
[self logRegistrationCompletion:nil authType:[SFSafariViewController description]];
185183
self.registrationFlowCompletion(nil);
186184
}
187185
return NO;

FirebaseAppDistribution/Sources/Public/FirebaseAppDistribution/FIRAppDistribution.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
@class FIRAppDistributionRelease;
16+
@class UIApplication;
1617
#import <Foundation/Foundation.h>
1718

1819
NS_ASSUME_NONNULL_BEGIN
@@ -55,6 +56,14 @@ NS_SWIFT_NAME(AppDistribution)
5556
*/
5657
- (void)signOutTester;
5758

59+
/**
60+
* Handle an App Distribution URL, for example a link to download a new pre-release version.
61+
* Call this method in your app delegate's `openURL` implementation if swizzling is disabled.
62+
*/
63+
- (BOOL)application:(UIApplication *)application
64+
openURL:(NSURL *)url
65+
options:(NSDictionary<NSString *, id> *)options;
66+
5867
/**
5968
* Accesses the singleton App Distribution instance.
6069
*

0 commit comments

Comments
 (0)