iphone - Upload video to instagram via another app iOS -



iphone - Upload video to instagram via another app iOS -

i trying share video captured app instagram app crashes. photos getting shared successfully. code used:

nsdata* videodata = [nsdata datawithcontentsofurl:info[@"uiimagepickercontrollermediaurl"]]; nsstring *path = [nshomedirectory() stringbyappendingpathcomponent:@"instagram.igo"]; [videodata writetofile:path atomically:yes]; nsurl *fileurl=[nsurl fileurlwithpath:path]; nsdictionary *filecaption = @{ @"instagramcaption" : @"shared app" }; [self setdocumentinteractioncontroller:[self setupcontrollerwithurl:fileurl usingdelegate:self]]; [self.documentinteractioncontroller setuti:@"com.instagram.exclusivegram"]; [self.documentinteractioncontroller setannotation:filecaption]; [self.documentinteractioncontroller presentopeninmenufromrect:rect inview:self.view animated:yes];

on capturing video, app redirects & opens instagram app crashes. can help me doing wrong or tell me right method share video instagram asap.?

thanks

i suspect it's you've written video sharing. in app utilize next generate location:

nsstring *cachesfolder = [nssearchpathfordirectoriesindomains(nscachesdirectory, nsuserdomainmask, yes) lastobject]; nsstring *filename = [cachesfolder stringbyappendingpathcomponent:@"journal.pdf"]; ... write file ...

then later share this:

_documentcontroller = [uidocumentinteractioncontroller interactioncontrollerwithurl:[nsurl fileurlwithpath:filename]]; _documentcontroller.delegate = self; [_documentcontroller presentoptionsmenufromrect:self.view.bounds inview:self.view animated:yes];

ios iphone objective-c instagram

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -