#import
#import "SinaWeb/SinaWeibo/SinaWeibo.h"
#import "SinaWeb/SinaWeibo/SinaWeiboRequest.h"
@interface WeiBoViewController :UIViewController<</span>SinaWeiboDelegate,SinaWeiboRequestDelegate
{
@property (strong, nonatomic) UIButton *shareButton;
@property (strong, nonatomic) UITextView *textView;
@property (strong, nonatomic) UIView *shareView;
@property (strong, nonatomic) UIActivityIndicatorView *indicator;
@property (readonly, nonatomic) SinaWeibo *sinaWeibo;
- (void) addButton;
- (void) addShareView;
- (void) share:(UIButton*) sender;
- (void) removeShare:(UIButton*) sender;
- (void) sendShare:(UIButton*) sender;
- (void) exitShare:(UIButton*) sender;
@end
#import "WeiBoViewController.h"
#define kAppKey
#define kAppSecret
#define kAppRedirectURL
@interface WeiBoViewController ()
@end
@implementation WeiBoViewController
@synthesize shareButton = _shareButton;
@synthesize textView = _textView;
@synthesize shareView = _shareView;
@synthesize indicator = _indicator;
@synthesize sinaWeibo = _sinaWeibo;
- (SinaWeibo*)sinaWeibo
{
}
- (void)viewDidLoad
{
}
- (void) addButton
{
}
//分享按钮响应方法
- (void) share:(UIButton*) sender
{
//
//图片和连接 和文字
}
//登陆成功后回调方法
- (void) sinaweiboDidLogIn:(SinaWeibo *)sinaweibo
{
//可以在此选在授权成功后直接发送
}
//取消按钮回调方法
- (void) removeShare:(UIButton*) sender
{
}
//发送按钮回调方法
- (void) sendShare:(UIButton*) sender
{
}
//退出登陆回调方法
- (void) exitShare:(UIButton*) sender
{
}
//请求完成回调该方法
- (void)request:(SinaWeiboRequest *)request didFinishLoadingWithResu
{
}
//请求失败回调该方法
- (void)request:(SinaWeiboRequest *)request didFailWithError:(NSError *)error
{
}
- (void)viewDidUnload
{
}
- (BOOL)shouldAutorotateToInterf
{
}
@end
效果你也可以去http://code4app.com/ios/SinaWeibo-Share/50d973306803fad965000000
个人信息获得
@interface
BOOL
//请求失败回调方法
- (void)request:(SinaWeiboRequest
}
//请求成功回调方法
- (void)request:(SinaWeiboRequest
}
返回字段说明
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
id | int64 | 用户UID |
idstr | string | 字符串型的用户UID |
screen_name | string | 用户昵称 |
name | string | 友好显示名称 |
province | int | 用户所在省级ID |
city | int | 用户所在城市ID |
location | string | 用户所在地 |
description | string | 用户个人描述 |
url | string | 用户博客地址 |
profile_image_url | string | 用户头像地址,50×50像素 |
profile_url | string | 用户的微博统一URL地址 |
domain | string | 用户的个性化域名 |
weihao | string | 用户的微号 |
gender | string | 性别,m:男、f:女、n:未知 |
followers_count | int | 粉丝数 |
friends_count | int | 关注数 |
statuses_count | int | 微博数 |
favourites_count | int | 收藏数 |
created_at | string | 用户创建(注册)时间 |
following | boolean | 暂未支持 |
allow_all_act_msg | boolean | 是否允许所有人给我发私信,true:是,false:否 |
geo_enabled | boolean | 是否允许标识用户的地理位置,true:是,false:否 |
verified | boolean | 是否是微博认证用户,即加V用户,true:是,false:否 |
verified_type | int | 暂未支持 |
remark | string | 用户备注信息,只有在查询用户关系时才返回此字段 |
status | object | 用户的最近一条微博信息字段 |
allow_all_comment | boolean | 是否允许所有人对我的微博进行评论,true:是,false:否 |
avatar_large | string | 用户大头像地址 |
verified_reason | string | 认证原因 |
follow_me | boolean | 该用户是否关注当前登录用户,true:是,false:否 |
online_status | int | 用户的在线状态,0:不在线、1:在线 |
bi_followers_count | int | 用户的互粉数 |
lang | string | 用户当前的语言版本,zh-cn:简体中文,zh-tw:繁体中文,en:英语 |