0

アプリがユーザーに通知を投稿するように、iPhone アプリでこの API を使用したい : https://developers.facebook.com/docs/concepts/notifications/許可: FB_Permission_manage_notifications が、仕事への呼び出しを取得できませんでした: アイデアはありますか? (私はこの応答を取得します:{"data":[],"summary":[]}

    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);

   }];
4

1 に答える 1

0

ユーザー アクセス トークンではなく、アプリ アクセス トークンを使用していることを確認してください。基本権限はもう十分なので、「FB_Permission_manage_notifications」とは関係ありません

https://developers.facebook.com/docs/concepts/notifications/に記載されているとおり:

アプリは、アプリを承認した既存のユーザーに通知を送信できます。特別な許可や拡張許可は必要ありません

...

アプリケーションは、 app access_tokenを使用して HTTP POST リクエストを /user_id/notifications Graph API に発行することにより、通知を生成できます。

于 2013-05-22T02:58:54.593 に答える