【问题标题】:iphone facebook wall posting with image map linkiphone facebook 墙上张贴图片地图链接
【发布时间】:2011-01-26 17:51:35
【问题描述】:

是否可以通过 iphone 在我的wallpost 侧面附上谷歌地图的链接(图片)? 我的墙贴没问题,但我不知道如何处理地图。 Ps 在我的应用程序中我也实现了 mapkit,我不知道我是否使用坐标进行 gquery 以获得地图链接,或者我必须使用我在 mapkit 上的位置工作

我用谷歌静态地图找到了我的解决方案: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 ];

【问题讨论】:

    标签: iphone facebook mapkit fbconnect


    【解决方案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];
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-27
      • 1970-01-01
      • 1970-01-01
      • 2015-12-11
      • 1970-01-01
      • 2011-05-04
      • 1970-01-01
      相关资源
      最近更新 更多