Domanda

Sto creando un'applicazione per iPhone in cui devo caricare le foto con diversi servizi. Sono riusciti foto in upload con Twitpic e Yfrog ma non in grado di fare con Plixi.  Sto usando Oauth, come Twitter non sta permettendo l'autenticazione di base.

Se qualcuno ha provato con Plixi, si prega di darmi una mano !!

Googled un sacco, ma non ottenere tutta la documentazione rilevante per il nuovo OAuth per Plixi.

È stato utile?

Soluzione

Infine, io sono con una soluzione per il mio problema:)

Se qualcuno viene anche bloccato con questo problema, basta aggiungere la cartella TweetPhoto dal seguente link dell'applicazione: http: / /code.google.com/p/tweetphoto-api-objective-c/downloads/detail?name=TPAPI-Objective-C-Library.zip

modificare gli URL TweetPhoto per Plixi ora. Inoltre, può fare riferimento al mio codice seguente per effettuare chiamate di funzione:

-(void)uploadtoTweetPhoto{
    NSString *message = [self.tweetTextView.text stringByReplacingOccurrencesOfString:@"Max. 140 characters" withString:@""];
NSMutableDictionary *dictionary  = [[NSMutableDictionary alloc]init];


 if((message == nil) || ([message isEqual:@""])){
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Please enter your tweet message.." message: @"" delegate:nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
    [alert show];
    [alert release];
}
 else{
     [dictionary setObject:message forKey:@"message"];
 }

if([dictionary count] == 1){
    [indicator startAnimating];
    [NSThread detachNewThreadSelector:@selector(uploadPhotoToTweetPhoto:) toTarget:self withObject:dictionary];


}
[dictionary release];
}



- (void)uploadPhotoToTweetPhoto:(NSDictionary *)dictionary{

    NSString *message = [dictionary objectForKey:@"message"];
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    NSString *accessTokenKey = [[NSUserDefaults standardUserDefaults] valueForKey:@"oauth_token"];
    NSString *accessTokenSecret = [[NSUserDefaults standardUserDefaults] valueForKey:@"oauth_token_secret"];

    TweetPhoto *tweetPhoto = [[TweetPhoto alloc] initWithSetup:accessTokenKey identitySecret:accessTokenSecret apiKey:Plixi_API_Key serviceName:@"Twitter" isoAuth:YES];

    NSData *dat =[tweetPhoto upload:UIImageJPEGRepresentation(self.imgView.image,0.8) comment:message tags:@"" latitude:23.4646 longitude:-87.7809 returnType:TweetPhotoCommentReturnTypeXML];
    NSString *status =[NSString stringWithFormat:@"%i",[tweetPhoto statusCode]];
    [tweetPhoto release];
    [self performSelectorOnMainThread:@selector(photoUploadedtoTweetPhoto:) withObject:status waitUntilDone:[NSThread isMainThread]];
    [pool release];
}

- (void)photoUploadedtoTweetPhoto:(NSString*)status{
    [indicator stopAnimating];
    if([status isEqualToString:@"201"])
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Tweet Posted" message: @"" delegate:nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
        [alert show];
        [alert release];
    }
    else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Tweet Failed" message: @"" delegate:nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
        [alert show];
        [alert release];
    }

}

Altri suggerimenti

Sono curioso di vedere la frase che hai utilizzato in Google. In ogni caso, googling funzione "Plixi api" me questa pagina , quali link ad un cacao involucro su Google Code

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top