2010-06-19 7 views
0

est possible d'attacher un lien (image) d'une carte google sur le côté de mon wallpost throug iphone? mon commentaire sur le mur est correct, mais je ne sais pas comment faire avec la carte. Ps dans mon application j'ai implémenté aussi mapkit, je ne sais pas si je fais une requête avec coordonnée pour obtenir le lien carte ou je dois travailler en utilisant la position que j'ai sur mapkitiphone facebook mur avec lien carte image

J'ai trouvé ma solution avec des cartes statiques google: D

voici mon code:

dialog.attachment = [NSString stringWithFormat: 
        @"{ \"name\":\"%@ si trova a %@\"," "\"media\":[{\"type\":\"image\"," 
        "\"src\":\"http://maps.google.com/maps/api/staticmap?size=100x100&zoom=14&markers=color:blue|label:here|%g,%g&mobile=true&sensor=false\"," 
        "\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],}", 
        _facebookName, citta.text, mylat, mylong ]; 

Répondre

1

pour poster une image, utilisez le code suivant (extrait de démonstration app

- (IBAction) publishStream: (id)sender { 

    SBJSON *jsonWriter = [[SBJSON new] autorelease]; 

    NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
           @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil]; 

    NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; 

    NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys: 
          @"a long run", @"name", 
          @"The Facebook Running app", @"caption", 
          @"it is fun", @"description", 
          @"http://itsti.me/", @"href", 
          [NSArray arrayWithObjects: 
          [NSDictionary dictionaryWithObjectsAndKeys: 
           @"image", @"type", 
           @"http://www.gogle.com/", @"href", 
           @"http://a1.twimg.com/profile_images/457512510/iconoTwitter_bigger.gif", @"src",nil] 
          , nil ] 
          ,@"media", nil]; 


    NSString *attachmentStr = [jsonWriter stringWithObject:attachment]; 
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           kAppId, @"api_key", 
           @"Share on Facebook", @"user_message_prompt", 
           actionLinksStr, @"action_links", 
           attachmentStr, @"attachment", 
           nil]; 


    [_facebook dialog: @"stream.publish" 
      andParams: params 
     andDelegate:self]; 

} 
Questions connexes