2010-06-19 40 views
0

是可能附加一個谷歌地圖的鏈接(圖像)在我的wallpost通過iPhone的一側? 我的牆貼是好的,但我不知道如何處理地圖。 Ps在我的應用程序中,我已經實現了mapkit,我不知道我是否用座標來獲取地圖鏈接的gquery,或者我必須使用mapkit上的位置來工作iphone臉譜牆張貼與圖像映射鏈接

我發現我的解決方案與谷歌的靜態地圖: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]; 

}