gpt4 book ai didi

ios - 我们可以使用 iOS 应用程序将图片发布到 instagram 中吗

转载 作者:行者123 更新时间:2023-11-29 10:44:38 24 4
gpt4 key购买 nike

我需要使用 Instagram 分享图片。我使用 this 创建了 CLIENT ID 和 CLIENT SECRET .我在堆栈溢出中进行了搜索,但没有找到任何有用的链接。谁能帮我解决这个问题。

最佳答案

是的,您可以按照以下代码在 instagram 上发布图片

-(IBAction)uploadimage:(UIButton*)sender
{

NSURL *instagramURL = [NSURL URLWithString:@"instagram://"];

if ([[UIApplication sharedApplication] canOpenURL:instagramURL])
{

CGSize size=CGSizeMake(612, 612);

UIImage *TajImage = [UIImage imageNamed:@"gujarat.jpg"];

UIImage *image = [self scale:TajImage toSize:size];

NSString *jpgPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"instagram.igo"];


[UIImageJPEGRepresentation(image, 1.0) writeToFile:jpgPath atomically:YES];

CGRect rect = CGRectMake(0 ,0 , 0, 0);

NSURL *fileURL = [NSURL fileURLWithPath:jpgPath];

self.docFile = [UIDocumentInteractionController interactionControllerWithURL:fileURL];

self.docFile.delegate = self;

[self.docFile setUTI:@"com.instagram.exclusivegram"];

[self.docFile setAnnotation:@{@"InstagramCaption" : @"Gujarti Lion,Girnar,India"}];

[ self.docFile presentOpenInMenuFromRect:rect inView:self.view animated:YES];

[[UIApplication sharedApplication] openURL:instagramURL];

}
}

在 Instagram 上传图片:

enter image description here

关于ios - 我们可以使用 iOS 应用程序将图片发布到 instagram 中吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22803327/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com