I\'ve listed here Yahoo Integration steps which I\'ve followed.
Here is the solution.
NOTE: You would be needing an intermediate server for that.
http://10.0.0.76/iOS/yos-social-php-master/sample/sampleapp.php
URL types
, URL identifier
& URL Schemes
. as indicated in Code Block 3yourLocalServer/iOS/yos-social-php-master/sample/sampleapp.php
file. (https://github.com/yahoo/yos-social-php/blob/master/sample/sampleapp.php)Summary
Mobile App navigates to Server -> Server manages authentication via OAuth-php. Once authenticated Server retrieves profile details & server indicates safari to navigate back to - your-mobile-App. Your-mobile-app gets all details in Code Block
Code Block 1
- (IBAction)connectYahoo:(id)sender {
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:
@"http://yourLocalServer/iOS/yos-social-php-master/sample/sampleapp.php"
]];
}
Code Block 2
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
if([[url scheme] isEqualToString:@"com.yourcompany.app.fsq"]) {
return [self.obj_LoginHomeVCtr.foursquare handleOpenURL:url];
} else if([[url scheme] isEqualToString:@"com.yourcompany.app.googleplus"]){
return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}else if([[url scheme] isEqualToString:@"fb188315544652080"]){
return [FBAppCall handleOpenURL:url
sourceApplication:sourceApplication
fallbackHandler:^(FBAppCall *call) {
NSLog(@"In fallback handler");
}];
} else if ([[url scheme] isEqualToString:@"com.yourcompany.app.yahoo"]){
STLog(@"URL is %@",url);
return YES;
}
return YES;
}
Code block 3
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.yourcompany.app.yahoo</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.yourcompany.app.yahoo</string>
</array>
</dict>
</array>
Code block 4
else if($hasSession && $profile) {
$string = "com.yourcompany.app.yahoo://response?birthdate=" . $profile->birthdate . "&familyName=" . $profile->familyName. " " . $profile->givenName . "&gender=" . $profile->gender . "&guid=" . $profile->guid . "&image=" . $profile->image->imageUrl;
echo '<meta http-equiv="Refresh" content="1;URL='. $string .'">';
}
?>
From the Yahoo docs you linked here are a few things to check:
Check that you are requesting and receiving approval for the correct permissions from the user
Inspect the YOSResponseData
object, if an error occurred it should contain an NSError
object.
It also contains an NSHTTPURLResponse
object. Check the response header and status code.
You've probably checked this stuff already, if so add the results to the question.
fetchProfileWithDelegate:
(source here) builds a URL and sets some header info, then passes this data to [YOSRequestClient -sendAsyncRequestWithDelegate:]
(source here).
The request client then creates a NSMutableURLRequest
and NSURLConnection
and starts a connection.
Once the data is downloaded (if any) YOSResponseData
takes over and creates a new object from the downloaded data (source code here).
There is no code path I can see that would allow the serviceResponseData
object passed in to be nil
. You should at least be able to see [data didSucceed]
, which will tell you if the HTTP response was < 400
. Oddly enough, if the server just opens and closes the connection with no HTTP response, I believe [data didSucceed] == YES
even though it obviously didn't succeed (since 0 < 400).
It doesn't look like you're doing anything wrong. My guess is that since the last commit was 4 years ago, and the company has gone through significant restructuring since then, the project has been abandoned and nobody has bothered making a note of it.
Update: In addition to having no updates for 4 years, Yahoo's developer forum for this software has been closed. I don't think Yahoo's API for this software is working any more. –
You can now use the updated Yahoo iOS SDK without going through so many steps: https://github.com/yahoo/yos-social-objc