GIDAuthentication is missing fetcherAuthorizer method

354 views
Skip to first unread message

Johan Nordberg

unread,
Jul 18, 2017, 5:06:13 PM7/18/17
to Google APIs Client Library for Objective-C
I've updated a project that uses Firebase, GoogleSignIn and GoogleApiClientForRest/Youtube to the latest version and now the fetchAuthorizer method is missing. My code used to look like this and worked well:

let user = GIDSignIn.sharedInstance().currentUser

let auth = user!.authentication

let authorizer = auth!.fetcherAuthorizer()


But now I get an error on the last line where I try to access fetcherAuthorizer. "GIDAuthentication has no member fetchAuthorizer"


My podfile look like this:


platform :ios, "9.0"

use_frameworks!

target "xxxx" do
pod 'GoogleSignIn'
pod 'GoogleAPIClientForREST/YouTube'
pod 'Firebase/Core', '~> 4'
pod 'Firebase/Messaging', '~> 4'
end

I have imported GTLRYoutube.h in my bridging header:

#import <GoogleAPIClientForRest/GTLRYouTube.h>

Can someone help me?

Thomas Van Lenten

unread,
Jul 26, 2017, 1:36:45 PM7/26/17
to Google APIs Client Library for Objective-C
The issue is the use of a bridging header.  Sadly, bridging headers will strip all properties, methods, etc. that reference an "incomplete" type.  Incomplete is caused simply be things being forward declared (@class Foo, @protocol DoSomething).  To have the properties exposed, you have to manually import the header that define the forward declared types:

Try adding:
  #import <GTMSessionFetcher/GTMSessionFetcher.h>
  #import <GTMSessionFetcher/GTMSessionFetcherService.h>

That should fix the problem.  When you hit this sorta issue in ObjC, it can kick out an error about the type of the property being incomplete, but with a bridging header it just drops them leaving it in this confusing state when you try to access them.

TVL
Reply all
Reply to author
Forward
0 new messages