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.
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.
On Sat, Sep 15, 2012 at 8:15 AM, Navid Rezaei <navid.r...@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.
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
On Sun, Sep 16, 2012 at 11:48 PM, Rinku Yadav
<ri...@handsintechnology.com>wrote:
> 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.r...@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.
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.