मुझे अपने आईफोन एप्लिकेशन में दीवार पर फेसबुक पोस्टिंग लागू करने में समस्या है। मैंने एसडीके स्थापित किया और लिंकवर्क फ्रेमवर्क लॉगिन ठीक काम कर रहा है। यहां कोड है:आईफोन ऐप पर दीवार पर फेसबुक एसडीके पोस्ट
-(IBAction)loginButtonPressed:(id)sender
{
NSLog(@"loginButtonPressed: called");
AppDelegate *appdel=[[UIApplication sharedApplication] delegate];
appdel.facebookSession=[[FBSession alloc] init];
[appdel.facebookSession openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error)
{
//
}];
}
लेकिन मुझे उपयोगकर्ता की दीवार पर संदेश पोस्ट करने में समस्या है। यहां कोड है:
-(IBAction)likeButtonPressed:(id)sender
{
NSLog(@"likeButtonPressed: called");
// Post a status update to the user's feedm via the Graph API, and display an alert view
// with the results or an error.
NSString *message = @"test message";
NSDictionary *params = [NSDictionary dictionaryWithObject:message forKey:@"message"];
// use the "startWith" helper static on FBRequest to both create and start a request, with
// a specified completion handler.
[FBRequest startWithGraphPath:@"me/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:message result:result error:error];
}];
}
कृपया मेरी सहायता करें। मेरे कोड में क्या गलत है? या मुझे लॉगिन अनुरोध के लिए कुछ अनुमतियां जोड़नी चाहिए?
आप वास्तविक _problem/Error_ वर्णन करने के लिए भूल गया था। – CBroe
जब आप अपना फेसबुक पोस्ट शुरू करते हैं तो लॉग इन फॉर्म प्रदर्शित होता है? –
मुझे डीबग में एक संदेश मिला है: 'त्रुटि: HTTP स्थिति कोड: 400' और' ऑपरेशन पूरा नहीं हो सका। (com.facebook.FBIOSSDK त्रुटि 5.) 'ÙIAlertView' – user1385666