2010-06-19 2 views
0

내 wallpost throug 아이폰의 측면에 Google지도의 링크 (이미지)를 첨부 할 수 있습니까? 나의 벽 포스트는 ok 다. 그러나 나는지도와 함께하는 방법을 모르고있다. Ps 내 앱에서 mapkit도 구현했는데지도 링크를 얻기 위해 좌표계가있는 gquery를 만들거나 mapkit에있는 위치를 사용하여 작업해야하는지 모르겠습니다.iphone facebook wall 게시 이미지 맵 링크

내 솔루션을 찾았습니다. 여기

내 코드의 D : 구글 정적지도를

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 ]; 

답변

1

이 이미지는 다음 코드를 사용하여 게시 (데모 애플리케이션에서 추출

- (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]; 

} 
관련 문제