我想分享文本/照片/視頻到Instagram。我正在尋找這個很長一段時間,但我沒有得到任何適當的文件。如果有人知道關於instagram的份額,請告訴我。如何在ios中分享文本/照片/視頻到Instagram
5
A
回答
0
請嘗試下面的代碼。
@property (nonatomic, retain) UIDocumentInteractionController *dic;
CGRect rect = CGRectMake(0 ,0 , 0, 0);
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsEndImageContext();
NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/test.igo"];
NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", jpgPath]];
// NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", screenshot]];
self.dic.UTI = @"com.instagram.photo";
self.dic = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.dic=[UIDocumentInteractionController interactionControllerWithURL:igImageHookFile];
self.dic.annotation = [NSDictionary dictionaryWithObject:@"Here Give what you want to share" forKey:@"InstagramCaption"];
[self.dic presentOpenInMenuFromRect: rect inView: self.view animated: YES ];
- (UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}
它適用於我。希望它可以幫助你。
2
此時,通過API上傳是不可能的。我們有意識地選擇不添加這個,原因如下:
Instagram是關於你在旅途中的生活 - 我們希望在應用內鼓勵照片 。但是,未來我們可能會根據具體情況向白名單 訪問各個應用。
我們想要打擊垃圾郵件&低質量的照片。一旦我們允許從其他來源上傳 ,就很難控制進入到Instagram生態系統的內容。所有這一切,我們正在努力找到 ,確保用戶在我們的 平臺上擁有一致的高質量體驗。
也許你可以試試鉤:http://instagram.com/developer/iphone-hooks/或https://instagram.com/developer/mobile-sharing/android-intents/
相關問題
- 1. 在iOS上分享視頻到Instagram
- 2. 我如何在iOS/Obj-C上分享Instagram上的視頻
- 3. 如何在iOS上分享照片到Facebook?
- 4. 如何使用Ionic與Instagram分享照片
- 5. 使用掛鉤的Instagram視頻分享
- 6. 在iOS上分享圖像到Instagram
- 7. Sinch SDK android共享視頻,Audiosm照片
- 8. iOS Facebook分享視頻Swift
- 9. 如何訪問Instagram照片
- 10. Instagram iOS API發佈視頻
- 11. 如何分享iphone中的照片
- 12. 你能分享照片到你的應用程序從ios照片庫
- 13. 根據標籤獲取instagram照片/視頻
- 14. 分享本地圖片或視頻文件
- 15. IOS分析查詢幫助兩個類照片和視頻
- 16. 如何獲取視頻的Instagram Media_ID在Ios中??
- 17. 如何將圖片從我的應用程序分享到Instagram
- 18. 如何通過/ feed分享Facebook照片
- 19. 如何在Instagram-API中區分輪播媒體與圖片或視頻媒體?
- 20. ALAssetsGroup setAssetsFilter在iOS中獲取照片和視頻
- 21. Instagram的視頻共享Android意圖
- 22. 禁用IOS中的照片共享,Ionic2本機照片查看器插件
- 23. 無法在Instagram上共享ios 5中的文本
- 24. 上傳和分享照片
- 25. 訪問視頻和照片+
- 26. 與標準文本共享照片 - Facebook iOS SDK 4.x
- 27. 像照片共享社交應用程序的Instagram查詢字符串,如Instagram
- 28. 如何在Android中獲取FrameLayout中播放的視頻照片?
- 29. 從圖庫圖片中的「分享」按鈕分享照片/照片到我的離子2應用程序
- 30. 分享文本文檔或使用iCloud的照片
使用下面的代碼,你可以張貼照片,但是這個代碼將打開相機,然後點擊照片會從你的應用Instagram的上傳。 NSURL * instagramURL = [NSURL URLWithString:@「instagram:// location?id = 1」];如果([[UIApplication sharedApplication] canOpenURL:instagramURL]){ [[UIApplication sharedApplication] openURL:instagramURL]; } – 2015-10-21 17:01:41