How to use GTMAppAuth in Swift

一笑奈何 提交于 2019-12-22 08:55:30

问题


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.


回答1:


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.)



来源:https://stackoverflow.com/questions/41618131/how-to-use-gtmappauth-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!