我已经在git上下载了FriendlyPix proj并使用了pod安装,但是由于某些原因,我得到了以下错误。错误是未在FIRAuthUI中找到signInProvider和authUI方法
在Pods文件夹的左侧,安装了FirebaseUI,我在线查看了FireAuthUI文档,并且http://cocoadocs.org/docsets/FirebaseUI/0.4.0/Classes/FIRAuthUI.html库中存在诸如signInProviders之类的属性。
我不确定为什么会收到这些错误,我也有@import FirebaseAuthUI;并没有做任何修改。 FIRAuthUI版本为0.5.5,xcode版本为7+和可可版本1.0.0
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
//Here The error codes occur: Error: Property 'signInProviders' not found on object of type 'id'
[FIRAuthUI authUI].signInProviders = @[[[FIRGoogleAuthUI alloc initWithClientID:[FIRApp defaultApp].options.clientID]];
//Error: No known class method for selector 'authUI'
[FIRAuthUI authUI].termsOfServiceURL = [[NSURL alloc] initWithString:@"https://firebase.google.com/terms/"];
self.authStateDidChangeHandle = [[FIRAuth auth]
addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, FIRUser *_Nullable user) {
if (user) {
[self signedIn:user];
}
}];
}
最佳答案
我相信从0.5.x开始,方法从authUI
更改为defaultAuthUI
,并且从signInProviders
更改为providers
:
[FIRAuth defaultAuthUI].providers = @[/* add providers */];
应该管用!
关于ios - FIRAuthUI FriendlyPix项目错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39527065/