在我的手机应用程序中检索我的墙贴 [英] retrieve my wall post in my native i phone application
问题描述
你好所有我想要检索我所有的墙上的帖子,我已经发布,直到现在我使用这个fql查询从我的本机iphone应用程序,以获取它,但我认为我正在制造一些错误,请指导我如何这样做以下是我的fql查询以获得墙上的帖子
hello all i want to retrieve my all the wall post that i have posted until now i am using this fql query from my native iphone application in order to fetch it but i think i am maiking some mistake please guide me how could i do that the following is my fql query to get wall post
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
NSString *fql = [NSString stringWithFormat:@"SELECT comments, likes FROM stream WHERE post_id=100000182297319"];
NSLog(@"session key is %@",_session.sessionKey);
NSLog(@"from global key is %@",[twitfacedemoAppDelegate getfacebookkey]);
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
这是我的其他delgate方法来获取墙上的帖子,但这段代码不工作
this is my other delgate method to get the wall post but this code is not working
- (void)request:(FBRequest*)request didLoad:(id)result {
@try
{
NSLog(@"result is %@",result);
if(result==nil)
{
UIAlertView *a=[[UIAlertView alloc]initWithTitle:@"Can't login" message:@"You cant login here." delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[a show];
[a release];
}
else
{
NSArray* users = result;
NSDictionary* user = [users objectAtIndex:0];
NSString* name = [[NSString alloc]initWithString:[user objectForKey:@"name"]];
NSLog(@"name is %@",name);
_label.text = [NSString stringWithFormat:@"Logged in as %@", name];
NSString *globalfacebookname;
globalfacebookname=[[NSString alloc]initWithString:name];
NSLog(@"value is %@",globalfacebookname);
NSString *fid=[user objectForKey:@"uid"];
NSLog(@"FACEBOOK ID WITH STRING DATATYP %@",fid);
[twitfacedemoAppDelegate fetchfacebookid:fid];
}
}
@catch (NSException * e)
{
NSLog(@"Problem in dialog didFailWithError:%@",e);
}
}
请指导我如何检索我的所有帖子从Facebook到我的本地iphone应用程序通过fql查询
please guide me how could i retrieve my all the post from facebook to my native iphone application through fql query
提前感谢
推荐答案
也许我被阻止了,但我尝试了这个,我总是得到一个空的NSArray。我用我的uid代替我的uidid显然用%lld,在我请求之前我已经从我的配置文件中成功地获取了我的全名(所以我必须经过身份验证)。这是我使用的确切查询:SELECT actor_id,message FROM stream WHERE source_id = 610611343 limit 50
Maybe I'm retarded but I tried this and I always get an empty NSArray back. I am substituting my source_id with my uid obviously with %lld and before I request this I am successfully getting my full name from my profile (so I must be authenticated). This is the exact query I'm using: SELECT actor_id, message FROM stream WHERE source_id = 610611343 limit 50
我必须首先请求权限吗?帮助将不胜感激,因为我已经去了几个小时,想拉出我的头发。我希望一个错误代码至少会回来 - 但它总是没有任何东西。
Do I have to request permissions first or something? Help would be greatly appreciated because I've been going for hours on this and want to pull my hair out. I wish an error code at least would come back - but its always just nothing.
这篇关于在我的手机应用程序中检索我的墙贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!