Ios XMPP框架发送文件
我成功地从iphone向spark发送了一个文件。 现在我想将一个文件从iphone发送到iphone,不幸的是,我总是收到以下错误代码: 打印错误说明: 错误域=xmppoutgoingfiletransferrordomain Code=-1“无法发送SI报价;收件人没有必需的功能。”用户信息={0x1a9773d0 NSLocalizedDescription=无法发送SI报价;收件人没有必需的功能。} 我用于传输的代码以及以下内容: -(无效)elaborazioneInvioTraferimentoFile{Ios XMPP框架发送文件,ios,iphone,xmpp,xmppframework,Ios,Iphone,Xmpp,Xmppframework,我成功地从iphone向spark发送了一个文件。 现在我想将一个文件从iphone发送到iphone,不幸的是,我总是收到以下错误代码: 打印错误说明: 错误域=xmppoutgoingfiletransferrordomain Code=-1“无法发送SI报价;收件人没有必需的功能。”用户信息={0x1a9773d0 NSLocalizedDescription=无法发送SI报价;收件人没有必需的功能。} 我用于传输的代码以及以下内容: -(无效)elaborazioneInvioTrafe
XMPPOutgoingFileTransfer *xmppIncomingFileTransfer= [XMPPOutgoingFileTransfer new];
[xmppIncomingFileTransfer activate:self.xmppStream];
[xmppIncomingFileTransfer addDelegate:self delegateQueue:dispatch_get_main_queue()];
UIImage *img=[UIImage imageNamed:@"ico.png"];
NSData *pngData = UIImagePNGRepresentation(img);
NSArray *paths1 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths1 objectAtIndex:0]; //Get the docs directory
NSString *filePath = [documentsPath stringByAppendingPathComponent:@"ico.png"]; //Add the file name
[pngData writeToFile:filePath atomically:YES]; //Write the file
// do error checking fun stuxmppIncomingFileTransferff...
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *fullPath = [[paths lastObject] stringByAppendingPathComponent:@"ico.png"];
NSData *data = [NSData dataWithContentsOfFile:fullPath];
NSLog(@"******%@",self.senderId);
NSError *err;
if (![xmppIncomingFileTransfer sendData:data
named:@"ico.png"
toRecipient:[XMPPJID jidWithString:self.senderId]
description:@"Baal's Soulstone, obviously."
error:&err]) {
DDLogInfo(@"You messed something up: %@", err);
}
}
我哪里做错了?感谢您的帮助将文件从iPhone发送到iPhone,您必须将图像或文件上载到特定的服务器,并且在服务器上成功上载后,您必须将上载的文件URL发送到另一个iPhone用户。以便第二个用户可以从该特定URL下载文件