func listInboxMessages() {
let gmailService = GTLRGmailService.init()
let listQuery = GTLRGmailQuery_UsersMessagesList.query(withUserId: "me")
listQuery.labelIds = ["INBOX"]
// let authorizer = GIDSignIn.sharedInstance()?.currentUser?.authentication?.fetcherAuthorizer()
// gmailService.authorizer = authorizer
gmailService.executeQuery(listQuery) { (ticket, response, error) in
if response != nil {
print("Response: ")
print(response)
} else {
print("Error: ")
print(error)
}
}
But the commented lines comes from GoogleSign In. Which is not present in my project. Withouth them I
"Expected OAuth 2 access token, login cookie or other valid authentication credential"
How can I obtain the messages list (gmail) with my token? I'm also trying to study the official documentation or "https://github.com/google/google-api-objectivec-client-for-rest" but I can't find something helpful