我已经在git上下载了FriendlyPix proj并使用了pod安装,但出于某种原因我收到了以下错误。错误是找不到FIRAuthUI中的signInProvider和authUI方法
在Pods文件夹的左侧,安装了FirebaseUI,我在线查看了FireAuthUI文档,并且库中存在了signInProviders等属性http://cocoadocs.org/docsets/FirebaseUI/0.4.0/Classes/FIRAuthUI.html
我不确定为什么我会收到这些错误,我也有@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 :(得分:4)
我相信从0.5.x开始,方法从authUI
更改为defaultAuthUI
和signInProviders
更改为providers
:
[FIRAuth defaultAuthUI].providers = @[/* add providers */];
应该工作!