الجمعة، 20 ديسمبر 2013

Posting status automatically using graph with url provided

I'm using actual Facebook iOS SDK and trying to post status update, with url provided.

So far I managed to post simple text status using:

[connection addRequest:[FBRequest requestForPostStatusUpdate:message] completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {// [self showAlert:message result:result error:error]; }]; [connection start];

I tried to modify it so, the url would be attached and did it like this:

[connection addRequest:[FBRequest requestForPostOpenGraphObjectWithType:@"RG Training" title:@"Test Title" image:nil url:@"http://runguru.pl" description:@"Test description" objectProperties:nil] completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { if (error) [self.appDelegate showUnknownCommunicationError];}];[connection start];

Unfortunately this causes error:

Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x15f7c010 {com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x15fc53f0 {NSUnderlyingError=0x15eec120 "bad URL", NSLocalizedDescription=bad URL}, com.facebook.sdk:HTTPStatusCode=200, com.facebook.sdk:ErrorSessionKey=, expirationDate: 2014-02-18 09:32:00 +0000, refreshDate: 2013-12-20 09:36:53 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:( "photo_upload", "basic_info", "video_upload", "share_item", "publish_stream", installed, "user_friends", "status_update", "public_profile", "create_note", "publish_actions")>}

Error says there is something wrong with URL, but what?


View the original article here

ليست هناك تعليقات:

إرسال تعليق