0

I am using sharekit to upload the image on twitter. I have set keys and callback URL perfectly.

But after entering my login and password credentials to upload image on twitter I got following error message.

"There was a problem requesting access from Twitter."

Earlier before few months in the same app I was able to upload the image with same code.

But right now I am facing the problem

can you tell me what is the exact problem

thanks in advance.

user1954352
  • 1,577
  • 4
  • 14
  • 16

2 Answers2

4

There is some changes occur in share kit. To resolve this issue. You have to change some piece of lines in SHKTwitter.mfile under this method:

 - (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest

For detail info follow this link & make changes according to this link & then check:

https://github.com/SteveLeviathan/ShareKit/commit/7aab77655c1cbb1bf79092fcb3bb24dd80ab6380

UPDATE:

Replace your this method with my & then check:

- (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest
{   
    if (xAuth)
    {
        NSDictionary *formValues = [pendingForm formValues];

        OARequestParameter *username = [[[OARequestParameter alloc] initWithName:@"x_auth_username"
                                                                           value:[formValues objectForKey:@"username"]] autorelease];

        OARequestParameter *password = [[[OARequestParameter alloc] initWithName:@"x_auth_password"
                                                                           value:[formValues objectForKey:@"password"]] autorelease];

        OARequestParameter *mode = [[[OARequestParameter alloc] initWithName:@"x_auth_mode"
                                                                       value:@"client_auth"] autorelease];

        [oRequest setParameters:[NSArray arrayWithObjects:username, password, mode, nil]];
    }

    else {
             if (self.pendingAction == SHKPendingRefreshToken)
                  {
                            if (accessToken.sessionHandle != nil)
                                   [oRequest setOAuthParameterName:@"oauth_session_handle" withValue:accessToken.sessionHandle];
                       }

                else
                        [oRequest setOAuthParameterName:@"oauth_verifier" withValue:[authorizeResponseQueryVars objectForKey:@"oauth_verifier"]];
            }
} 
Vishal
  • 8,246
  • 6
  • 37
  • 52
  • thanks for your help but as mentioned in url I wrote block of code but still I am getting same error. – user1954352 Apr 26 '13 at 05:31
  • I have one another issue after doing it also. It is "there was an error while sharing". Previously i am able to post the image on twitter – Rahul Aug 29 '13 at 11:20
0

You can switch to ShareKit 2 - it is being updated frequently.

Vilém Kurz
  • 3,401
  • 2
  • 34
  • 43