1

是否有机会为通过 iPhone Hook 创建的新 Instagram 帖子添加描述?

        NSString *moviePath = outputPath;
        NSString *caption = @"description";
        NSURL *movieURL = [NSURL fileURLWithPath:moviePath isDirectory:NO];
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeVideoAtPathToSavedPhotosAlbum:movieURL
                                    completionBlock:^(NSURL *assetURL, NSError *error)
        {
            NSURL *instagramURL = [NSURL URLWithString:
                                   [NSString stringWithFormat:@"instagram://library?AssetPath=%@&annotation=%@",
                                    [[assetURL absoluteString] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]],
                                    [caption stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]]]
                                   ];
            if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
                [[UIApplication sharedApplication] openURL:instagramURL];
            }
            else {
                NSLog(@"Can't open Instagram");
            }
        }];

我尝试过,但它在描述文本字段中没有显示任何内容。你能帮助我吗?

4

0 回答 0