新浪微博 iOS SDK获得用户信息
2014-04-14 11:12
218 查看
代码
- (void)getUserInfo { NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:2]; [params setObject:self.wbtoken forKey:@"access_token"]; [params setObject:self.uid forKey:@"uid"]; NSLog(@"params:%@", params); WBHttpRequest * asiRequest = [WBHttpRequest requestWithURL:@"https://api.weibo.com/2/users/show.json" httpMethod:@"GET" params:params delegate:self withTag:@"getUserInfo"]; }
响应函数
- (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result { NSError *error; NSData *data = [result dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; if (json == nil) { NSLog(@"json parse failed \r\n"); return; } self.screenname = [json objectForKey:@"screen_name"]; self.picture = [json objectForKey:@"profile_image_url"]; NSLog(self.screenname); NSLog(self.picture); m_observer->NotifyAvatarsReceived(avatarData); NSString *title = nil; UIAlertView *alert = nil; title = @"收到网络回调"; alert = [[UIAlertView alloc] initWithTitle:title message:[NSString stringWithFormat:@"%@",result] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [alert show]; [alert release]; }
相关文章推荐
- 新浪微博iOS SDK 授权和获取用户信息
- iOS 开发 如何获得用户当前位置(通过经纬度获得城市、省份等信息)
- PHP获得微信用户的OpenID,然后再通过OpenID和access_token查询用户信息
- 微信内,第三方网站获得用户信息
- 新浪微博iOS版SDK“宝玉XP”框…
- 【分享】100万条新浪微博用户的个人标签信息
- PHP 模拟登陆MSN并获得用户信息
- iOS应用程序安全(2)-获得iOS应用程序的类信息
- ios安全攻防(二)后台daemon非法窃取用户iTunesstore信息
- 如何使用iOS Keychain存储用户敏感信息
- 新浪微博iOS版SDK“宝玉XP”框架学习笔记
- Android调用新浪微博显示用户信息
- 三、ArcGIS Runtime SDK for iOS 100.2.1教程系列之图层图例信息获取
- 无责任Windows Azure SDK .NET开发入门篇三[使用Azure AD 管理用户信息--3.3 Details用户详细信息]
- iOS利用时间戳获得两个字符串时间差,并闪动提示用户剩余时间
- 【读书笔记】iOS-反溃网络信息改善用户体验
- 如何使用iOS Keychain存储用户敏感信息
- IOS第四天-新浪微博 -存储优化OAuth授权账号信息,下拉刷新,字典转模型
- Android实现新浪微博和QQ登陆并获取用户的信息
- 微信小程序-获得用户openid、昵称等信息的方式