Use sharesdk to log on to facebook, sharesdkfacebook

Source: Internet
Author: User

Use sharesdk to log on to facebook, sharesdkfacebook
Use sharesdk for facebook login by Wu xueying
Using sharesdk to log on to facebook (you can also directly use Facebook-sdk-ios, but using sharesdk is relatively simple) is troublesome for Chinese apps to join facebook because vpn should be configured, after configuring the vpn, the network speed is slow.
1. Download sharesdk :( only download part of facebook, otherwise the package size will be large) http://sharesdk.mob.com/Download
2. Add the sdk to the project and add the dependent library SystemConfiguration. frameworkQuartzCore. frameworkCoreTelephony. frameworklibicucore. dyliblibz.1.2.5.dylibSecurity. framework
3. reference the registration code (register your own appkey) [ShareSDKregisterApp: @ "5577ff992136"]; [ShareSDKconnectFacebookWithAppKey: @ "107704292745179" appSecret: @ "secret"];
4. Returned webpage call-(BOOL) application :( UIApplication *) application
HandleOpenURL :( NSURL *) url
{
Return [ShareSDKhandleOpenURL: url
WxDelegate: self];
}

-(BOOL) application :( UIApplication *) application
OpenURL :( NSURL *) url
SourceApplication :( NSString *) sourceApplication
Annotation :( id) annotation
{
Return [ShareSDKhandleOpenURL: url
SourceApplication: sourceApplication
Annotation: annotation
WxDelegate: self];}
5. Add a facebook key
6. call-(IBAction) facebookLogin :( id) sender {[ShareSDKgetUserInfoWithType: ShareTypeFacebook autexceptions: nil result: ^ (BOOL result, id <ISSPlatformUser> userInfo, id <ICMErrorInfo> error) {NSLog (@ "% @", [userInfosourceData]); if (result ){}
}];}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.