2015-02-06 2 views
0

아이폰에서 파일을 성공적으로 보낼 수있었습니다. 이제 iphone에서 iphone으로 파일을 보내려합니다. 불행히도 항상 다음 오류 코드가 나타납니다. 오류 설명 인쇄 : 오류 도메인 = XMPPOutgoingFileTransferErrorDomain 코드 = -1 "받는 사람에게 SI 제안을 보낼 수 없습니다. 필수 기능. " UserInfo = {0x1a9773d0 NSLocalizedDescription = SI 제안을 보낼 수 없습니다; 받는 사람이 필요한 기능이없는}XMPP 프레임 워크에서 파일을 전송하는 중

코드를 내가 전송에 사용하고 다음 해요 :.

- (무효) 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); 
} 

}

내가 어디에서 잘못하고 있니? 도움을 주셔서 감사합니다

답변

1

iPhone에서 iPhone으로 파일을 보내려면 특정 서버에 이미지 또는 파일을 업로드해야하며 서버에 성공적으로 업로드 한 후에는 업로드 한 파일 URL을 다른 iPhone 사용자에게 보내야합니다. 그래서 두 번째 사용자는 특정 URL에서 파일을 다운로드 할 수 있습니다.

관련 문제