Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios XMPP框架发送文件_Ios_Iphone_Xmpp_Xmppframework - Fatal编程技术网

Ios XMPP框架发送文件

Ios XMPP框架发送文件,ios,iphone,xmpp,xmppframework,Ios,Iphone,Xmpp,Xmppframework,我成功地从iphone向spark发送了一个文件。 现在我想将一个文件从iphone发送到iphone,不幸的是,我总是收到以下错误代码: 打印错误说明: 错误域=xmppoutgoingfiletransferrordomain Code=-1“无法发送SI报价;收件人没有必需的功能。”用户信息={0x1a9773d0 NSLocalizedDescription=无法发送SI报价;收件人没有必需的功能。} 我用于传输的代码以及以下内容: -(无效)elaborazioneInvioTrafe

我成功地从iphone向spark发送了一个文件。 现在我想将一个文件从iphone发送到iphone,不幸的是,我总是收到以下错误代码: 打印错误说明: 错误域=xmppoutgoingfiletransferrordomain Code=-1“无法发送SI报价;收件人没有必需的功能。”用户信息={0x1a9773d0 NSLocalizedDescription=无法发送SI报价;收件人没有必需的功能。}

我用于传输的代码以及以下内容:

-(无效)elaborazioneInvioTraferimentoFile{

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下载文件