I've integrated login via Google+ on my iphone app, all works perfect, but I want to login in ios app with Parse.com ,
already used this method but didn't work
[PFUser becomeInBackground:@"session-token-here" block:^(PFUser *user, NSError *error) {
if (error) {
// The token could not be validated.
} else {
// The current user is now set to user.
}
}];
when I send access token in this then got error.
invalid session error. error code =101. 2.refreshToken
Please any one can help me for login with google plus on parse.com in ios
In my last project, I did this and it's working fine .. If the user is already registered, then it will login; otherwise it initiates the signup process.
It's working fine. Thanks ..
The becomeInBackground method requires a sessionToken you can get from a ParseCloud Application. After a while looking for an example of Parse+Google I created a Github project you can find here: https://github.com/danielCarlosCE/parse-googlelogin
I get an accessToken from google
Send it to my ParseCloud function
Get a sessionToken as response and use it in the become method
The ParseCloud project you can find here https://github.com/danielCarlosCE/parsecloud-googlelogin
In the main.js, you need to change this var with your clientID information from Google
First parameter (session token) that you pass to
+becomeInBackground:block:
is Parse session token, not Google+ / Facebook / Twitter.This method is intended to be used with your own custom flow, where you get the session token differently than by providing username/password, e.g. via CloudCode + SMS auth.
You can implement Google+ sign in using something like this: