1

I am working on app that contains facebook login .After login with face book I need to go to native application & app should display user name & image that was there in face book .But when I am logining with facebook It is showing "SECURITY WARNING:"Please treat the URL above as you would your password and do not share it with anyone. in ios" ,& not coming back to my native app .Can any one sort this issue.I am using Facebook Graph api for face book.

In AppDelegate:

-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ 
  return [[_viewController facebook] handleOpenURL:url]; 
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 
  return [[_viewController facebook] handleOpenURL:url]; 
}
Raptor
  • 53,206
  • 45
  • 230
  • 366
user2285751
  • 11
  • 1
  • 1
  • 2
  • Why so many questions with all CAPS today? Did you handle custom URL in your AppDelegate, as taught in the getting start documentation of Facebook iOS SDK ? – Raptor Apr 16 '13 at 09:34
  • -(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ return [[_viewController facebook] handleOpenURL:url]; } – user2285751 Apr 16 '13 at 09:41
  • - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [[_viewController facebook] handleOpenURL:url]; } this I written in appdelegate class I am getting Id but I am unable to come back to native application – user2285751 Apr 16 '13 at 09:43
  • helped you add codes to question. Did you set the App ID in the app's `.plist` as well? – Raptor Apr 16 '13 at 09:46
  • I created app & added appid FB_Graph = [[FbGraph alloc]initWithFbClientID:APPID]; – user2285751 Apr 16 '13 at 09:59
  • please help any one to sort out this issue I am new to ios why error is coming how to solve this can any one explain this please – user2285751 Apr 16 '13 at 10:04

4 Answers4

2

I had the same issue with my ios app and this is what i have done to resolve my problem. i have found the below url in my app and changed the connection from http to https.

earlier url: http://www.facebook.com/connect/login_success.html

changed url: https://www.facebook.com/connect/login_success.html

now it's working fine.

Zac24
  • 2,514
  • 1
  • 23
  • 28
0

I found one solution. I hope it will work for you.

Just paste this UIWebViewDelegate method in your FbGraph.m file....

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

    if([request.URL.relativeString hasPrefix:@"https://www.facebook.com/connect/login_success.html" ])
        self.webView.hidden=TRUE;
    return YES;
}
Ajay
  • 1,622
  • 20
  • 36
0

Solved per Zack24 on Apr 24.

Here is my webView loadRequest URL. Note the https for the redirect_uri.

https://graph.facebook.com/oauth/authorize?client_id=147261088671924&redirect_uri=https://www.facebook.com/connect/login_success.html&display=touch&type=user_agent&scope=read_stream,publish_stream

Vincent
  • 155
  • 3
  • 11
-1

Apart from implementing :

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation`

you have to add URL Types > URL Schemes into your application plist, with value : fb1234567890 where 1234567890 is your App ID.

See Item 5: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/

Raptor
  • 53,206
  • 45
  • 230
  • 366
  • 1
    when i was downloading facebook sdk it is showing an error "error in downloading face book sdk"I have downloaded 5 times it is showing same error .please provide me any sample application that works correctly.Kindly any one sort this issue please – user2285751 Apr 16 '13 at 11:43