2013-05-21 116 views
0

我想使用这个API在我的iPhone应用程序,使应用程序将发布一个通知用户: https://developers.facebook.com/docs/concepts/notifications/ 我实现了它在我的应用程序: 能得到正确的权限:FB_Permission_manage_notifications 但无法打电话工作: 任何想法? (我得到这个回应:{“数据”:[],“摘要”:[]}。应用程序通知API

NSDictionary * params = @{ @"access_token" : [[FBSession activeSession] accessToken], @"template" : @"this is a test", @"href" : @"www.blabla.com"}; 
    NSLog(@"%@",params); 
    NSURL *url = [NSURL URLWithString:@"https://graph.facebook.com/766042719/notifications"]; 
    AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url]; 


    [httpClient getPath:@"" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { 

     NSString* mystring = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; 
     NSLog(@"%@",mystring); 
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 
     NSLog(@"%@",error); 

    }]; 

回答

0

请确保您使用的应用程序访问令牌,而不是用户访问令牌基本权限已经足够,所以它没有涉及到“FB_Permission_manage_notifications”

截至https://developers.facebook.com/docs/concepts/notifications/记载:

应用可以发送通知给已授权的任何现有用户 应用没有特殊或扩展权限是必需的

...

应用程序可以通过发出HTTP POST请求 到/ USER_ID /通知图形API,具有应用的access_token生成通知。