Not really sure I understand you correctly, but assuming that you want to register a user in your own system without presenting a separate reg flow (?), you can do the following:
- Ask user to authorize your app (i.e. through SSO or the regular FB flow – using the latest Facebook SDK will trigger the appropriate flow). Be sure to ask for any extra permissions you'll need for your own signup.
- Once your app's been notified about the Facebook authorization, extract whatever user data you need for registration through Facebook's API (i.e. using the graph path
/me?fields=id,name,email
to get FB id, name and email). The Graph API Explorer is good for checking which fields you can get.
- Use the response from (2) to make a
POST
to your own system to create an account.
- Once your account creation request has finished, allow user to start doing whatever he's supposed to in your app (= you're all set!). And possibly save some kind of account identifier in the client (the device), should you need it later.
To make this flow seamless to the user, you should probably show a loading/progress indicator during steps 1-4.
Facebook's SDK documentation should get you going with step (1).
Some sample (Objective-C) code for step (2) and partly (3):
- (void)facebookUserAuthorized
{
[FBRequestConnection startWithGraphPath:@"me"
parameters:[NSDictionary dictionaryWithObject:@"id,name,birthday,first_name,last_name,gender,email" forKey:@"fields"]
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSDictionary *userData = (NSDictionary*)result;
[self registerUserWithEmail:[userData objectForKey:@"email"]
facebookId:[userData objectForKey:@"id"]
gender:[userData objectForKey:@"gender"]];
}];
}
- (void)registerUserWithEmail:(NSString*)email facebookId:(NSString*)facebookId gender:(NSString*)gender
{
// Send a POST to your own server with the user details
}
And I'm sure you can apply the same principle on Android. Check out Facebook's Android docs to get started.