简体   繁体   中英

Facebook ios sdk: Page not found message after integrate it into my App

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. im busy with this since Last week please help

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


}

请确认在APP设置中验证回调网址是否正确,这可能是与网址相关的问题。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM