带有图像地图链接的 iPhone Facebook 墙贴

发布于 2024-09-06 06:01:25 字数 698 浏览 1 评论 0原文

可以通过 iPhone 在我的墙贴侧面附加 google 地图的链接(图像)吗? 我的墙贴没问题,但我不知道如何处理地图。 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 ];

is possible to attach a link (image) of a google map on the side of my wallpost throug iphone?
my wall post is ok, but i've no idea how to do with the map.
Ps in my app i've implemented also mapkit, i don't know if i make a gquery with coordinate to obtain map link or i must work using the position that i have on mapkit

i've found my solution with google static maps :D

here's my 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 ];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

聚集的泪 2024-09-13 06:01:25

要发布图像,请使用以下代码(从演示应用程序中提取)

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

}

to post a image use the following code (extracted from demo 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];

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文