2013-05-21 112 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生成通知。