4

I have searched for a lot of questions regarding this The page you requested was not found.
when I do it in sample app then it work nicely and it connecting to facebook and posting work successfuly. But when I integrate it in my App then when I click on Facebook share button then after login it gives The page you requested was not found
what problem is this please help while I m using the latest facebook ios sdk

Please Help!!!

This is my code

facebook = [[Facebook alloc] initWithAppId:@"App_id" andDelegate:self];

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"] 
    && [defaults objectForKey:@"FBExpirationDateKey"]) {
    facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
    facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}

if (![facebook isSessionValid]) {
    [facebook authorize:nil];
}
else {
    [self showShareDialog];
}

///// show ShareDialog Method

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"App_id", @"app_id",nil];

[facebook dialog:@"feed" andParams:params andDelegate:self];

Oho i dont know how to handle this problem. i tried all the solution but no one work for me. problem is when i make a new application and then use facebook ios sdk then it work nice but when i do the same thing in my own application then it gives to problem. 1) The requested page not found 2) does not display dialog screen niether it post it came back to the main facebook page.

What the problem is This Please Help!!! i have set the url in .plist file everything but not work. i m busy with this since Last week please help

Deepesh
  • 8,065
  • 3
  • 28
  • 45
Shaheen Rehman
  • 491
  • 1
  • 5
  • 16

3 Answers3

0

The problem is in the URL. You might have edited the URL of the FBConnect SDK. Check it again. Or Re-Integrate it.

Edited Code Add this code

-(void)BtnClick{
    NSArray *permissions =[[NSArray arrayWithObjects:
                       @"email", @"read_stream", @"user_birthday", 
                       @"user_about_me", @"publish_stream", @"offline_access", nil] retain];
    Facebook *fb=[[Facebook alloc] initWithAppId:kappId];
    [fb authorize:permissions andDelegate:self];

}
- (void)fbDidLogin {

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:msg, @"message",nil];
    [fb requestWithGraphPath:@"me/feed"
                                                andParams:params
                                            andHttpMethod:@"POST"
                                              andDelegate:self];


}
Sanchit Paurush
  • 6,114
  • 17
  • 68
  • 107
  • `You might have edited the URL of the FBConnect SDK` how can i check it – Shaheen Rehman Jul 05 '12 at 11:28
  • Re-Integrate it in your project. is it giving the same error again? – Sanchit Paurush Jul 05 '12 at 11:29
  • yes i m changing the urlschemes in .plist file but again it give me the same error again – Shaheen Rehman Jul 05 '12 at 11:40
  • -@sanchising same issue again! let me rephrase my question? `im using facebook ios sdk and change all the .plist setting. when i click on facebook button it display login page after login it asks about authorization or already authorize when i click on Okay button then it give me message `requested page was not found` while when for the first time i used it in a new project it work. but after deleting the project from my simulator when again i run the app it does not update and give the above message. – Shaheen Rehman Jul 05 '12 at 12:07
  • @ShaheenRehman Do you want to use facebook for sharing purpose or getting some data from it? also tell me that after facebook login where u want to redirect your application. – Sanchit Paurush Jul 05 '12 at 12:10
  • i just want to post strings to Facebook and after login and authorization i just want to display dialog where i can post some string. – Shaheen Rehman Jul 05 '12 at 12:39
  • @ShaheenRehman The Code which I gave you will post your message string (msg) directly to the facebook without displaying it to the user. What you can do is, you can implement a method - (void) requestSucceeded: (NSString *) requestIdentifier which will be hit when the msg successfully posted. – Sanchit Paurush Jul 05 '12 at 13:12
  • i know that you are using here GraphApi which directly post instead of displaying dialog but this also not work for me and the requirement is to display dialog and then share. – Shaheen Rehman Jul 05 '12 at 13:15
0

Please verify the Callback URL is verified correctly in the APP settings, this might be a URL related issue.

Abdul
  • 90
  • 1
  • 9
0

You should have to set this in your .plist file.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>000000000000000</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb164798790305117</string>
        </array>
    </dict>
</array>

where 164798790305117 is your AppID of Facebook and replace it with your AppID.

Mehul Mistri
  • 15,037
  • 14
  • 70
  • 94
  • `i have change this but this not working`. what is `CFBundleURLName` – Shaheen Rehman Jul 05 '12 at 11:35
  • i have a tutorial that work nicely for the first time but when i delete this and run it again then it give the same message"the requested page was not found" please help while i m clearing the cache history but again not work – Shaheen Rehman Jul 05 '12 at 12:09