Re: Authentication for Google Calendar API

100 views
Skip to first unread message

Rinku Yadav

unread,
Sep 17, 2012, 1:48:22 AM9/17/12
to gtm-o...@googlegroups.com
Hi,


  I have  the idea how to i sync the event into google calender, I have done this with help EventKit framework and EventKitUi framework. You have to just use the EKEventStore class and just select the calender type and email address of gmail account no need of password.


Thanks.

On Sat, Sep 15, 2012 at 8:15 AM, Navid Rezaei <navid...@gmail.com> wrote:
I am developing an app for iPhone and it basically needs to connect to a Google Calendar API and download some events in the Calendar.

All the authentication examples that I have seen from 'GTM OAuth 2' require a window for the user to enter his/her user & pass to authenticate the access to his/her Google Calendar. However, my target is a specific Calendar, which I know its user name and password. I wonder if there is a way to hardcode the user and pass in my Objective-C code?

I used to directly write the username and password using the previous GData Calendar API, but it seems that it does not work anymore and I get error 403 for authentication.

I appreciate it if you let me know of your suggestions.

Navid Rezaei

unread,
Sep 17, 2012, 11:44:18 AM9/17/12
to gtm-o...@googlegroups.com
Hi Rinku,

Thank you for your answer. I wonder if this solution works only for syncing the native iOS calendar app with the Google calendar or I may use the fetched data in my custom built calendar as well?

Cheers,
Navid

Greg Robbins

unread,
Sep 17, 2012, 7:13:41 PM9/17/12
to gtm-o...@googlegroups.com
You can save the OAuth 2 refresh token (or more simply the GTMOAuth2Authorization object's persistenceResponseString which encapsulates the refresh token) and use that in the client app to authorize the requests. 

Refresh tokens are valid until revoked, but you might also want a way to provide an updated persistenceResponseString to the app, in case the refresh token needs to be replaced.

Reply all
Reply to author
Forward
0 new messages