Retweet using STTwitter API - ios

I have tried to add the retweet concept in my application using STTwitter API with following method after user authentication:
[twitter postStatusRetweetWithID:[NSString stringWithFormat:#"691544087921606656"] successBlock:^(NSDictionary *status) {
NSLog(#"status..%#",status);
} errorBlock:^(NSError *error) {
NSLog(#"error..%#",error);
}];
But it is showing following error:
Error Domain=STTwitterTwitterErrorDomain Code=220 "Your
credentials do not allow access to this resource."
UserInfo={NSUnderlyingError=0x7b170ca0 {Error Domain=STHTTPRequest
Code=403 "HTTP Status 403: Forbidden"
UserInfo={NSLocalizedDescription=HTTP Status 403: Forbidden}},
NSLocalizedDescription=Your credentials do not allow access to this
resource.}
If anyone has experienced with the STTwitter API. Suggest me some idea to get rid from this error.
Thanks in advance.

Related

Failed to fetch full profile details from LinkedIn API

I tried to fetch full profile details from LinkedIn API. I referred a sample app also. In my app I tried,
[LISDKSessionManager createSessionWithAuth:[NSArray arrayWithObjects:LISDK_FULL_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION, nil] state:nil showGoToAppStoreDialog:YES successBlock:^(NSString *returnState) {
[self.delegate didSuccessfullyLogIntoLinkedIn];
} errorBlock:^(NSError *error) {
[self.delegate fetchingFailedWithError:error];
}];
This code gives me an error
The operation couldn’t be completed. (LISDKAuthError error 5.)
But in the sample app which is provided by the LinkedIn, This same code is working. I went through my app authentications. It has only following fields. I think the problem is, In this list there is no r_fullprofile field.
Is this the problem? Is it possible to add r_fullprofile field to this list?
Although basic access gives you only 4 fields, an answer is "Yes, it is possible". If you subscribe to LinkedIN Partnership Programs.

Linkedin retrieve full profile details?

I want to integrate the Linkedin API and fetch all the details (Education ,detail..)
But When I pass r_fullprofile in the grant access. I am getting following error.
authorization failed Error Domain=LIALinkedInERROR Code=1
I have done the code as below :
- (LIALinkedInHttpClient *)client {
LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:#"http://www.google.com"
clientId:#"XXXXXXX"
clientSecret:#"XXXXX"
state:#"DCEEFWF45453sdffef424"
grantedAccess:#[#"r_fullprofile",#"r_emailaddress"]];
return [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];
}
May be you are not aware of the developer programe changes done by LinkedIn as explained in https://developer.linkedin.com/support/developer-program-transition

Spotify API getting starred list not authorized

I'm using the Spotify iOS SDK and trying to get use this function starredListForUserInSession:callback: to find a user's starred list once they have logged in.
The actual logging in of the user is working correctly, as I am able to stream Spotify tracks and a valid SPTSession is returned. I am including both the streaming and the playlist reading scopes as seen below:
SPTAuth *auth = [SPTAuth defaultInstance];
NSURL *loginPageURL = [auth loginURLForClientId:kSpotifyClientID
declaredRedirectURL:[NSURL URLWithString:kSpotifyCallbackURL]
scopes:#[SPTAuthStreamingScope, SPTAuthPlaylistReadPrivateScope]];
However, when I use the function:
[SPTRequest starredListForUserInSession:[AppDelegate sharedAccounts].spotifySession callback:^(NSError *error, id object) {
if (error) {
NSLog(#"%#", error);
}
}];
I consistently receive the following error:
"The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x7a8cbf50 {NSErrorFailingURLKey=https://api.spotify.com/v1/users/(null)/starred, NSErrorFailingURLStringKey=https://api.spotify.com/v1/users/(null)/starred, NSUnderlyingError=0x7a6d5b60 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"
When I looked this up, it said that it means this request requires authentication, though the user has already been authenticated with the presumably correct scope. What am I missing?

Photobucket iOS API Authentication

I'm trying to integrate Photobucket iOS API with my project. I requested and already have consumer key and secret. But I have a problem with authentication (may be there is will be problems with upload). Please look at my code.
At first init photobucket manager:
manager = [[PhotobucketAPI alloc] initWithConsumerKey:photobucketConsumerKey
consumerSecret:photobucketConsumerSecret
globalErrorDelegate:self];
Then request authentication:
[manager loginDirectAndStoreForUsername:login
password:pass
delegate:self
didSucceedSelector:#selector(didSucceedLogin:)
didFailSelector:#selector(didFailLogin:)
downloadProgressDelegate:self
uploadProgressDelegate:self];
This is how look like method didFailLogin::
- (void)didFailLogin:(NSError *)error
{
if (error)
NSLog(#"Error: %#", error);
}
And all time I'm getting this error:
Error Domain=Authentication failed. Code=999 "The operation couldn’t
be completed. (Authentication failed. error 999.)"
So what I doing wrong?

Post tweets through Objective-c Using STTwitter

So here is my problem. I am trying to authenticate an app and post a tweet on the twitter using STTwitter API for iOS. Here is my code using STTwitter framework.
STTwitterAPI *twitter= [STTwitterAPI twitterAPIWithOAuthConsumerName:#"mytwitterdisplayname"
consumerKey:#"consumerkey"
consumerSecret:#"consumersecret"
username:#"myloginuseremailid"
password:#"password"];
And using this object twitter as follows
[twitter postStatusUpdate:#"test" inReplyToStatusID:nil
latitude:nil
longitude:nil
placeID:nil
displayCoordinates:nil
trimUser:nil
successBlock:^(NSDictionary *status) {
// ...
} errorBlock:^(NSError *error) {
// ...
}];
However, each time I run this code I get following error as authentication failure.
"Error Domain=STHTTPRequest Code=220 "Your credentials do not allow access to this resource." UserInfo=0xdf46550 {NSLocalizedDescription=Your credentials do not allow access to this resource.}"
Is there something wrong I am doing? Any help is much appreciated.
I am using iOs7 and Xcode 5.0.2

Resources