Cody Harness
Cody Harness

Reputation: 1147

How to use GTMAppAuth in Swift

I do not know how to code in Objective-C and have to get an app working with the G Suite SDK so that I can get information about members of the groups. The problem is that in September Google changed how auth requests work, so this tutorial no longer works. I know I need to switch over to using GTMAppAuth, but it's all Objective-C.

Upvotes: 4

Views: 3320

Answers (1)

MasonYeh
MasonYeh

Reputation: 73

I am currently working on YouTube Data API and trying to implement functions in Swift. The following is what I did:

  1. Install GTMAppAuth using Cocoapods.
  2. Add bridging header and import necessary headers.
  3. The above 2 steps didn't result in a successful compilation, since xcode can't find the headers. I manually add header search path in build settings.

After doing these steps, I can access those Objective-C class & methods from Swift classes.

For the "how to use GTMAppAuth" part, I found an example here (though I haven't test it) https://github.com/Alder85/AppAuthSwift

Maybe you can also find some hints here.

(Sorry for that this is just my experience and may not be a complete answer. I am new here in the stackoverflow and have too little reputations to post a comment.)

Upvotes: 2

Related Questions