0

I don't want to use graph story. But all other methods are rejected by Facebook team with message: Please make sure you are not pre-filling message field. for example:

NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setObject:text forKey:@"message"];
  [params setObject:@"link" forKey:@"type"];
//[params setObject:@"http://google.com/" forKey:@"link"];
if(photoID) {
    [params setObject:photoID forKey:@"object_attachment"];
}
FBRequestConnection *connection = [[FBRequestConnection alloc] init];
NSMutableDictionary* photosParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                     image,@"source",
                                     text,@"message",
                                     nil];
FBRequest *request = [[FBRequest alloc] initWithSession:[FBSession activeSession]
                                               graphPath:@"me/photos"
                                              parameters:photosParams
                                              HTTPMethod:@"POST"];
[connection addRequest:request completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    completionBlock(error);
}];

FBRequest *req = [FBRequest requestForGraphPath:@"me/feed"];
req.graphObject = (id<FBGraphObject>)[NSDictionary dictionaryWithDictionary:params];
[connection addRequest:req
     completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
         if (!error && result) {
             NSLog(@"%@",result);
        }
     }
 ];

Please explain what method I should use in this case? In case if correct behavior is use stories then why other methods are not marked as deprecated?

Thanks.

HG04
  • 1

0 Answers0