0

SDK for iPhone outdated and not working properly?

Hi guys,

I just tried out the Social SDK for mac/iphone. It seems the last update was back in June. Documentation for integration shown in this link
http://developer.yahoo.com/social/sdk/objectivec/
is different from that of the source code.

[session sendUserToAuthorizationWithCallback:nil];

The line above is specified in the instruction, but this method does not exist in the method. instead, a similar method is found

/**
* Automatically fetches a new request token and opens the native browser for the user to login.
* @param callbackUrl An optional callback URL.
*/
- (void)sendUserToAuthorizationWithCallbackUrl:(NSString *)callbackUrl;

As specified in the instruction in the method, the callbackURL is optional. So i replaced sendUserToAuthorizationWithCallback with sendUserToAuthorizationWithCallbackURL , and run the app.

The application just crashed because in line 160 of YOSSession.m, newRequestToken.key and newRequestToken.secret are both null. I have placed the key, secret and appid in my request. Unable to go continue because I'm not sure if it's my fault, or the code is outdated. Can't seem to find any documentation online about this, so I guess this isn't used frequently.

Hope someone can get back to me.

by
22 Replies
  • I'm sending this post over to the developer of the SDK to let him know of the issues. Thanks for bringing this to our attention.

    Jonathan LeBlanc
    Technology Evangelist
    Yahoo! Developer Network
    Twitter: jcleblanc
    0
  • Hi, I have a feeling you may be using an out-dated version.

    Pull down the latest from our GitHub repository and try it out again. If that doesn't help, please let me know here and I can assist further.

    http://github.com/yahoo/yos-social-objc

    Thanks for picking up the error in the documentation, I will have that fixed.

    Cheers,
    Zach
    0
  • QUOTE (basictheory @ Dec 3 2009, 02:27 PM) <{POST_SNAPBACK}>
    Hi, I have a feeling you may be using an out-dated version.

    Pull down the latest from our GitHub repository and try it out again. If that doesn't help, please let me know here and I can assist further.

    http://github.com/yahoo/yos-social-objc

    Thanks for picking up the error in the documentation, I will have that fixed.

    Cheers,
    Zach


    Hi,

    I'm not using an outdated version. It's my first time downloading the SDK last week. Anyway, I downloaded it again just in case.
    Then I use the sample app in Samples/SocialSample and try to compile it fails. It was missing some files (Source/YOAuth/Crypto/hmac.c etc)
    But I managed to find these files and it compiles fine.

    Then I put in the key, secret and app ID to the sample app. These are the only modification I make to the sample app. Compile and run it in simulator. Few seconds later it crashes.

    If I comment out
    [self.session sendUserToAuthorizationWithCallbackUrl:nil];
    The app does not crash. That line seems to be giving problem
    0
  • I believe I've fixed the issue. It seems the Authorization header is not getting accepted by our OAuth server, as it returns an error about missing oauth params.

    In the mean time, I've changed the code to set the OAuth params in the query string, and some better error checking for missing keys.

    You can find the changes here:
    http://github.com/yahoo/yos-social-objc/co...a472149791e86c9

    Please let me know if you still have any issues.

    -zach
    0
  • QUOTE (basictheory @ Dec 14 2009, 01:43 PM) <{POST_SNAPBACK}>
    I believe I've fixed the issue. It seems the Authorization header is not getting accepted by our OAuth server, as it returns an error about missing oauth params.

    In the mean time, I've changed the code to set the OAuth params in the query string, and some better error checking for missing keys.

    You can find the changes here:
    http://github.com/yahoo/yos-social-objc/co...a472149791e86c9

    Please let me know if you still have any issues.

    -zach


    Hi,
    Thanks for the changes, but I am still getting the same error. The app crashes at start.
    If I uncomment line 191 of YOSSession.m,
    //NSLog(@"error fetching request token. check your consumer key and secret.");
    The content gets printed out to console. So it was an error with fetching request token.

    I've checked that my key, secret and app id are correct.
    0
  • Hi,

    I am able to get the OAuth authentication page , but the control over my app. loses as this page gets loaded in a web browser ...
    Please help me out...
    I m using the following code

    QUOTE
    session = [YOSSession sessionWithConsumerKey:@"**************************************************"
    andConsumerSecret:@"************************"
    andApplicationId:@"******"];

    BOOL hasSession = [session resumeSession];

    if(hasSession == FALSE) {
    [session sendUserToAuthorizationWithCallbackUrl:nil];
    NSLog(@"no logged in user");
    }else{
    [self sendRequests];
    }
    0
  • QUOTE (Manmay @ Dec 16 2009, 12:54 AM) <{POST_SNAPBACK}>
    Hi,

    I am able to get the OAuth authentication page , but the control over my app. loses as this page gets loaded in a web browser ...
    Please help me out...
    I m using the following code


    At this point, a callback is needed in order to return to your application.

    Currently we don't allow non-http/https callback URLs, but the workaround here is to setup your application as a web application and set your callback URL to a script on a server somewhere.

    CODE
    [self.session sendUserToAuthorizationWithCallbackUrl:@"http://yourdomain.com/iphone/callback"];


    Then, register a custom URL scheme for your iPhone application from your Info.plist file, and then setup your server side script to redirect Safari back to your application via the URL scheme you just set up.

    CODE
    <?php
    $query = $_SERVER['QUERY_STRING'];
    header("Location: com-mycompany-myapp://oauth-response?" . $query);
    ?>
    0
  • QUOTE (honcheng81 @ Dec 15 2009, 07:36 AM) <{POST_SNAPBACK}>
    Hi,
    Thanks for the changes, but I am still getting the same error. The app crashes at start.
    If I uncomment line 191 of YOSSession.m,
    //NSLog(@"error fetching request token. check your consumer key and secret.");
    The content gets printed out to console. So it was an error with fetching request token.

    I've checked that my key, secret and app id are correct.


    I've made a couple more updates to handle OAuth errors a bit better.

    http://github.com/yahoo/yos-social-objc/archives/master

    Please update, and try this:

    Set a breakpoint on line 74 of YOSAuthRequest.m and run the app.
    From the debugger, check the value of the local variable response, and check the responseText.
    This will have information on what the error is with OAuth and will make it easier to debug further.
    0
  • QUOTE (basictheory @ Dec 16 2009, 10:35 AM) <{POST_SNAPBACK}>
    I've made a couple more updates to handle OAuth errors a bit better.

    http://github.com/yahoo/yos-social-objc/archives/master

    Please update, and try this:

    Set a breakpoint on line 74 of YOSAuthRequest.m and run the app.
    From the debugger, check the value of the local variable response, and check the responseText.
    This will have information on what the error is with OAuth and will make it easier to debug further.


    Hi,

    I tried, and responseText shows that my secret key is rejected. So I copied and paste all the oauth info to the app just to double check, but it does not work. Still the same error.

    So I removed the project from my Yahoo account, and recreated a new project. Compile and run, and this time it gave me a different error
    responseText = <html><title>OAuth Error</title>\n
    0
  • QUOTE (honcheng81 @ Dec 18 2009, 12:35 AM) <{POST_SNAPBACK}>
    Hi,

    I tried, and responseText shows that my secret key is rejected. So I copied and paste all the oauth info to the app just to double check, but it does not work. Still the same error.

    So I removed the project from my Yahoo account, and recreated a new project. Compile and run, and this time it gave me a different error
    responseText = <html><title>OAuth Error</title>\n


    Can you provide the complete http request/response?
    0
  • QUOTE (Dustin Whittle @ Dec 22 2009, 01:20 PM) <{POST_SNAPBACK}>
    Can you provide the complete http request/response?


    Hi,
    How do I provide the complete http request/response? I am just using the provider source code, and put in the API and secret key.
    0
  • QUOTE (basictheory @ Dec 16 2009, 10:06 AM) <{POST_SNAPBACK}>
    CODE
    [self.session sendUserToAuthorizationWithCallbackUrl:@"http://yourdomain.com/iphone/callback"];


    Then, register a custom URL scheme for your iPhone application from your Info.plist file, and then setup your server side script to redirect Safari back to your application via the URL scheme you just set up.

    CODE
    <?php
    $query = $_SERVER['QUERY_STRING'];
    header("Location: com-mycompany-myapp://oauth-response?" . $query);
    ?>


    Thanks for this valuable information. Following your instructions I got the auth & call back working and the php page loads the app.

    Now my problem is how do I retrieve the session/state when the app is reloaded ?

    thanks again!
    0
  • QUOTE (Bikrant @ Jul 8 2010, 09:47 PM) <{POST_SNAPBACK}>
    Thanks for this valuable information. Following your instructions I got the auth & call back working and the php page loads the app.

    Now my problem is how do I retrieve the session/state when the app is reloaded ?

    thanks again!


    Got it running now..thanks for the great library!
    0
  • QUOTE (basictheory @ Dec 16 2009, 10:06 AM) <{POST_SNAPBACK}>
    At this point, a callback is needed in order to return to your application.

    Currently we don't allow non-http/https callback URLs, but the workaround here is to setup your application as a web application and set your callback URL to a script on a server somewhere.

    CODE
    [self.session sendUserToAuthorizationWithCallbackUrl:@"http://yourdomain.com/iphone/callback"];


    Then, register a custom URL scheme for your iPhone application from your Info.plist file, and then setup your server side script to redirect Safari back to your application via the URL scheme you just set up.

    CODE
    <?php
    $query = $_SERVER['QUERY_STRING'];
    header("Location: com-mycompany-myapp://oauth-response?" . $query);
    ?>


    I just began to use this SDK yesterday and, based on the error message I got in the OAuth response (oauth_problem=signature_invalid), it would seem that non-http or https callback URLs are still not supported (e.g., custom iphone URL schemes) by Yahoo web service APIs.

    Will they be supported in the near future? While the workaround is simple enough, it assumes we have access to a server where we can install the workaround redirect script, which isn't necessarily the case.

    Thanks!
    0
  • QUOTE (Bikrant @ Jul 10 2010, 05:32 PM) <{POST_SNAPBACK}>
    Got it running now..thanks for the great library!

    Could you, or anyone, help out as to how you were able to get the session information. I've got it bumping back to my app but I'm not sure how to get the session information from there. It's always telling me hasSession == YES. Thanks!
    0
  • Hi guys<br>I am facing the same problem .pls suggest what should i do.<br><br><br><div class="quote"><div class="quotetop">QUOTE<cite>(honcheng @ 2 Dec 2009 5:07 PM)</cite></div><blockquote class="quotemain">Hi guys,<br><br>I just tried out the Social SDK for mac/iphone. It seems the last update was back in June. Documentation for integration shown in this link<br><a href="http://developer.yahoo.com/social/sdk/objectivec/" rel="nofollow" target="ext">http://developer.yahoo.com/social/sdk/objectivec/</a><br>is different from that of the source code. <br><br><strong> [session sendUserToAuthorizationWithCallback:nil]; </strong><br><br>The line above is specified in the instruction, but this method does not exist in the method. instead, a similar method is found<br><br>/**<br> * Automatically fetches a new request token and opens the native browser for the user to login.<br> * @param callbackUrl An optional callback URL.<br> */<br>- (void)sendUserToAuthorizationWithCallbackUrl:(NSString *)callbackUrl;<br><br>As specified in the instruction in the method, the callbackURL is optional. So i replaced <strong>sendUserToAuthorizationWithCallback</strong> with <strong>sendUserToAuthorizationWithCallbackURL </strong> , and run the app. <br><br>The application just crashed because in line 160 of YOSSession.m, <strong>newRequestToken.key</strong> and <strong>newRequestToken.secret </strong> are both null. I have placed the key, secret and appid in my request. Unable to go continue because I&#39;m not sure if it&#39;s my fault, or the code is outdated. Can&#39;t seem to find any documentation online about this, so I guess this isn&#39;t used frequently. <br><br>Hope someone can get back to me.</blockquote></div>
    0
  • Any help with this?
    0
  • Hi my apps gets crash can u tell me what is the output of this example?
    0
  • Hi my apps gets crash can u tell me what is the output of this example?
    0
  • Hi<br>My app get crashed also, i figured out that is because all permissions of the app are set to None&nbsp;<br>When i used any permission it is working with me but i just need minimum permissions to use for authentication so what minimim permission i can have??
    0
  • Hi,
             I am using the link "https://github.com/yahoo/yos-social-objc/archives/master" for getting yahoo contacts into my iphone application,
    When i loggedin with my yahoo account, it is showing some agree option after that it is showing some text like "To complete sharing of Yahoo! info with TestApp, enter code "XXXXX" into TestApp". But in the webpage it is not showing any option to enter that text thing..... And after logged in how can we come back to the App...

    Thanks,

    Rajesh   
    0
  • Hi,
             I am using the link "https://github.com/yahoo/yos-social-objc/archives/master" for getting yahoo contacts and profile info into my iphone application,
    When i logged-in with my yahoo account, it is showing some agree option after that it is showing some text like "To complete sharing of Yahoo! info with TestApp, enter code "XXXXX" into TestApp". But in the webpage it is not showing any option to enter that text thing..... And after logged in how can we come back to the App...

    Can any one give me suggestion how i open url for authentication in UIWebView inside my app.

    Thanks,

    Pankaj
    0
This forum is locked.

Recent Posts

in Y!OS SDKs