Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 8040b7b

Browse files
Merge pull request #1516 from tkrevh/patch-1
Apple Sign-In sometimes fails on iOS
2 parents ca3b11e + 76c25c1 commit 8040b7b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/firebase.ios.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,9 @@ firebase.login = arg => {
947947
appleIDRequest.nonce = sha256Nonce;
948948

949949
const authorizationController = ASAuthorizationController.alloc().initWithAuthorizationRequests([appleIDRequest]);
950-
951-
authorizationController.delegate = ASAuthorizationControllerDelegateImpl.createWithOwnerAndResolveReject(
952-
new WeakRef(this), resolve, reject);
950+
const delegate = ASAuthorizationControllerDelegateImpl.createWithOwnerAndResolveReject(new WeakRef(this), resolve, reject);
951+
CFRetain(delegate);
952+
authorizationController.delegate = delegate;
953953

954954
authorizationController.presentationContextProvider = ASAuthorizationControllerPresentationContextProvidingImpl.createWithOwnerAndCallback(
955955
new WeakRef(this));
@@ -2475,6 +2475,7 @@ class ASAuthorizationControllerDelegateImpl extends NSObject /* implements ASAut
24752475
user: toLoginResult(authResult.user)
24762476
});
24772477
this.resolve(toLoginResult(authResult && authResult.user, authResult && authResult.additionalUserInfo));
2478+
CFRelease(this);
24782479
}
24792480
});
24802481
}

0 commit comments

Comments
 (0)