【问题标题】:Instagram iphone hooks descriptionInstagram iphone 挂钩说明
【发布时间】:2014-08-07 06:01:56
【问题描述】:

我正在尝试创建一个应用程序,在我的应用程序中编辑图片后,它会在其中打开 Instagram。我希望它在进入 instagram 时在描述中包含一个标签,但我似乎迷失了如何实现它。 iphone 挂钩状态使用标语,但我不知道在哪里放置。下面是我的代码

NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
docInteraction.delegate = self;
Saves the edited Image to directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"instaFilterx.jpg"];
UIImage *image = combinedImage;
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:savedImagePath atomically:NO];

    //Loads the edited Image
NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:@"instaFilterx.jpg"];
UIImage *tempImage = [UIImage imageWithContentsOfFile:getImagePath];

Hooks the edited Image with Instagram
NSString  *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/instaFilterx.igo"];
[UIImageJPEGRepresentation(tempImage, 1.0) writeToFile:jpgPath atomically:YES];

Prepares the DocumentInteraction with the .igo image for Instagram
NSURL *instagramImageURL = [[NSURL alloc] initFileURLWithPath:jpgPath];
docInteraction = [UIDocumentInteractionController
interactionControllerWithURL:instagramImageURL];
[docInteraction setUTI:@"com.instagram.exclusivegram"];eciate any help. Thank you.

【问题讨论】:

    标签: ios iphone hook instagram


    【解决方案1】:

    为您的 Instagram 帖子添加标题。执行以下操作:

    docInteraction.annotation=[NSDictionary dictionaryWithObjectsAndKeys:@"Your #Text", @"InstagramCaption", nil];
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多