【问题标题】:iOS iPhone SDK integrating app with instagram [duplicate]iOS iPhone SDK将应用程序与instagram集成[重复]
【发布时间】:2014-02-06 03:04:14
【问题描述】:

将应用程序与 instagram 集成.. 如何完成,请提前提供帮助,谢谢 这是我尝试过的代码

 NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"];
    if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
        NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
        NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.ig"];

    UIImage *image = [UIImage imageNamed:@"instagram.jpeg"];

    NSData *imageData = UIImagePNGRepresentation(image);
    [imageData writeToFile:savedImagePath atomically:YES];
    NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath];
    NSLog(@"%@",imageUrl);
    UIDocumentInteractionController *docController = [[UIDocumentInteractionController alloc] init];
    docController.delegate = self;
    docController.UTI = @"com.instagram.photo";
    docController.URL = imageUrl;
    [docController setURL:imageUrl];
    [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}

【问题讨论】:

  • 请阅读您的帖子并尝试理解所要求的内容。
  • 这是我尝试过的代码..但它不起作用你能帮忙吗?
  • 你想做什么?与其只是粘贴一些代码,不如试着告诉我们到底是什么问题——为什么它不起作用,你想让它做什么,哪里出错了?
  • 我必须将我的 iphone 应用程序与 instagram 集成。你知道怎么做吗?

标签: ios instagram


【解决方案1】:

现在在 iOS 中使用 Instagram API 更加简单。看看这个新的 SDK http://github.com/shyambhat/InstagramKit

【讨论】:

    【解决方案2】:

    您应该查看InstagramShareiOSHow to share an image on Instagram in iOS?

    请注意,您实际上无法通过 API 向 Instagram 发帖,您只能检查并启动 Instagram 应用并准备好要发布的图片。 Instagram 尚未开放他们的发布 API,我怀疑他们会这样做,因为他们希望鼓励用户 (1) 使用他们的应用程序和 (2) 使用他们的过滤器、自动调整和其他有助于 Instagram 的功能用户体验。

    此外,一旦您离开应用并启动 Instagram,FWIW 将无法自动返回。

    【讨论】:

      猜你喜欢
      • 2016-12-06
      • 2012-04-09
      • 2010-12-28
      • 2018-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-20
      • 1970-01-01
      相关资源
      最近更新 更多