Use asihttprequest to send data to (Sina Weibo) and Sina API oauth

Source: Internet
Author: User
Tags oauth

Use asihttprequest to send data to Sina Weibo
Oauth_sina Weibo o oauth.zip Sina API certification, you only need to change the key. H, and change the appkey and appsecret in it to the appkey you applied for on Sina.

Import the real machine to start authentication (WiFi is required), run the app, and enter the Sina website asking you to enter your Weibo account and password for authentication. After the authentication is complete, write down oauthconsumerkey and koauthconsumersecret

Attachment 2: testpost_sinaweibo.zip: A test demo I wrote, sdk3.0 test OK

You only need to change the macro definitions koauthconsumerkey and koauthconsumersecret in the weibodata. h header file to the koauthconsumerkey and koauthconsumersecret you recorded above.

Modify weibodata. M's-(void) getuserinformation function. If you have not logged in to the account, enter your, account, and password.

-(Void) getuserinformation {
Nsuserdefaults * userinformation = [nsuserdefaultsstandarduserdefaults];
Username = [userinformation valueforkey: @ "username"];
Password = [userinformation valueforkey: @ "userpwd"];
If ([usernamelength] <1 & [passwordlength] <1)
{
// You can check it out ..
Username = @"";
Password = @"";
}
}

PS: Thanks to QD, I helped solve some problems. (Send the image, path, [Request setdata: imagedata forkey: @ "pic"];) @ "pic" I always use @ "picture" and @ "photo" to test again .... I did not expect @ "pic" .. I am all sweaty ..
[url = job. php? Action = download & Aid = 17969] oauth_sina Weibo oauth.zip [/url]
[url = job. php? Action = download & Aid = 17970] testpost_sinaweibo.zip [/url]

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.