问题
FirebaseAuth uses [UIApplication sharedApplication]
in FIRAuth.m
. Since that API is not available to App Extensions, it appears that FirebaseAuth (and anything that depends on it, such as Firestore) can not be used in an App Extension.
Is there any way around this limitation?
回答1:
Update:
Firebase confirms that a fix is targeted for 5.2.x version. Track the Github issue for latest updates.
It seems as Firebase is not officially supporting extensions in iOS. I have got that info from this GitHub issue (see paulb777's answer). Maybe someone from Firebase can also confirm this here. I am very surprised that we can't use Firebase SDK when creating extensions such as a Today widget.
The only workaround I had was reverting back to an earlier version of Firebase via:
pod 'Firebase', '4.9.0'
This uses the 4.9.0 version of the Firebase SDK and doesn't create compiler errors.
来源:https://stackoverflow.com/questions/50592585/can-firebaseauth-5-0-x-be-used-in-an-ios-app-extension