iOS Facebook Integration Like Instagram -


i have app setup atm using email , password login, i'm wondering how can add facebook connection between user's account , facebook instagram. automatically login facebook everytime? know click facebook when you're uploading new pic , posts fb @ same time.

i believe instagram uses facebook sdk ios recommend using facebook open graph api. it's easier use , extremely straight forward on calls photos, posts, likes, etc.

here's need do:

1.) import social.framework , accounts.framework

2.) allocate acaccountstore

3.) create acaccounttype of acaccounttypeidentifierfacebook acaccountstore

4.) create ios facebook id key on developer.facebook.com

5.) create nsmutabledictionary initial account permissions , audience types , pass requestaccesstoaccountswithtype: so:

nsarray *permissions = @[@"read_stream"]; nsmutabledictionary *dict = [[nsmutabledictionary alloc]initwithobjectsandkeys:@"123456789",acfacebookappidkey,permissions,acfacebookpermissionskey,acfacebookaudiencefriends,acfacebookaudiencekey, nil]; [accountstore requestaccesstoaccountswithtype:facebookaccounttype options:dict completion:^(bool granted, nserror *error) {     //check permission granted , errors , ask more permissions or whatever requests want     } 

6.) once have necessary permissions have perform slrequest calls , retrieve data in completion handler. check out various permission strings , facebook dev site , you'll go. hope helps!


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -