wou*_*rds 22 api hook ios instagram
据我所知,你必须使用com.instagram.photo获得常规选项和com.instagram.exclusivegram为documentinteractioncontroller的UTI如果你真的只想要的Instagram +使用正确的扩展.ig一般和.igo独家Instagram的.
出于某种原因,我看到了多个选项,而不仅仅是我喜欢的Instagram ...
我忘记了什么吗?它有不同的做法吗?
UIImage *image = (UIImage *)[info valueForKey:UIImagePickerControllerOriginalImage];
NSURL *instagramURL = [NSURL URLWithString:@"instagram://"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
CGRect rect = CGRectMake(0,0,0,0);
CGRect cropRect=CGRectMake(0,0,612,612);
// ig voor gewone instagram, igo voor exclusive instagram
NSString *jpgPath=[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/temp/photo.igo"];
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropRect);
UIImage *img = [[UIImage alloc] initWithCGImage:imageRef];
CGImageRelease(imageRef);
[UIImageJPEGRepresentation(img, 1.0) writeToFile:jpgPath atomically:YES];
NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@",jpgPath]];
// exclusive zou direct in de instagram app moeten openen, helaas toont hij meerdere opties met instagram ergenes helemaal achteraan
self.documentInteractionController.UTI = @"com.instagram.exclusivegram";
self.documentInteractionController = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"Alweer een Nostalgie deelnemer! #nostalgiebusje" forKey:@"InstagramCaption"];
[self.documentInteractionController presentOpenInMenuFromRect: rect inView: self.view animated: YES ];
}
Run Code Online (Sandbox Code Playgroud)

self.documentInteractionController.UTI = @"com.instagram.exclusivegram";
self.documentInteractionController = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
Run Code Online (Sandbox Code Playgroud)
似乎UTI字符串被setupControllerWithURL:usingDelegate:方法覆盖.
| 归档时间: |
|
| 查看次数: |
6011 次 |
| 最近记录: |