小编use*_*395的帖子

如何将图像从我们的应用程序导出到Instagram?

我使用了以下代码,但它没有用.我想把我的应用程序中的图像放到我的iPhone上安装的Instagram应用程序中.

NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"IMG_0192"  ofType:@"jpg"];
fileToOpen = [fileToOpen substringToIndex:[fileToOpen length] - 3];
fileToOpen=[NSString stringWithFormat:@"%@ig",fileToOpen];
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
NSLog(@"%@",fileToOpen);
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
//imageToUpload is a file path with .ig file extension
/*UIAlertView *alert = [[UIAlertView alloc] 
                      initWithTitle:@"" 
                      message:@"Can open app!" 
                      delegate:self  
                      cancelButtonTitle:@"OK" 
                      otherButtonTitles:nil];
[alert show];
*/

self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:fileToOpen]];
self.documentInteractionController.UTI = @"com.instagram.photo";
self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"Its a testing" forKey:@"InstagramCaption"];
Run Code Online (Sandbox Code Playgroud)

我尝试了很多,但它根本不起作用.

iphone objective-c ios instagram

3
推荐指数
1
解决办法
5753
查看次数

无法在xmpp聊天应用中注册用户

我想在我的iOS App中实现XMPP框架,我已经完成了所有的事情(与其他用户聊天,显示其他用户的存在等)

但问题是,我无法从我的应用程序中注册新用户.我正在使用以下代码,

if ([appDel.xmppStream supportsInBandRegistration])
    [appDel.xmppStream registerWithPassword:txt_Password.text error:nil];
Run Code Online (Sandbox Code Playgroud)

但是对于这个,supportsInBandRegistration方法总是返回NO而我不会被调用方法永远不会registerWithPassword :.

如果有任何解决方案,请帮助我

iphone chat ios

1
推荐指数
1
解决办法
2913
查看次数

标签 统计

ios ×2

iphone ×2

chat ×1

instagram ×1

objective-c ×1