xmpp-messenger-ios icon indicating copy to clipboard operation
xmpp-messenger-ios copied to clipboard

XMPP Framework Issue in Xcode8.1 with Swift 3

Open NiladriPadhy opened this issue 9 years ago • 15 comments

I am trying implement XMPP chat functionality in Xcode8.1 with Swift 3.0, but unfortunately getting "Framework issues".

Any kind of work around solution or alternate supported framework will be a great help.

NiladriPadhy avatar Nov 30 '16 16:11 NiladriPadhy

Same Here

mrezahemmati avatar Dec 27 '16 10:12 mrezahemmati

Anybody, please, migrate this project to Swift 3! I really need!

MuratDeveloper avatar Dec 28 '16 11:12 MuratDeveloper

  1. remove pod from your podfile
pod 'xmpp-messenger-ios'
  1. add following lines to your podfile
pod 'FMDB'
pod 'JSQMessagesViewController'
pod 'JSQSystemSoundPlayer', '~> 2.0'
pod 'XMPPFramework', :git => "https://github.com/robbiehanson/XMPPFramework.git", :branch => 'master'
  1. Add files from /Pods/Classes to your project
  2. Install your pod again with pod install
  3. Fix swift compatibility errors
  4. Change body.setStringValues() to body.stringValue=
  5. Fix Casting errors
  6. in oneChat.swift file
var result: SecTrustResultType =  SecTrustResultType.Deny as! SecTrustResultType
  1. Add an objective C category file for DDXMLNode and name it "nullable"
@interface DDXMLNode (nullable)

+ (id)namespaceWithNullableName:(nullable NSString *)name stringValue:(NSString *)stringValue;

@end
@implementation DDXMLNode (nullable)

+ (id)namespaceWithNullableName:(nullable NSString *)name stringValue:(NSString *)stringValue{
    return [DDXMLNode namespaceWithName:name stringValue:stringValue];
}

@end

  1. in oneMessage.swift
composing.namespaces = [(DDXMLElement.namespaceWithNullableName(nil , stringValue: "http://jabber.org/protocol/chatstates")) as! DDXMLNode]

11.add thread:"" to methods that miss thread parameter If you find a better way,please let me know

mrezahemmati avatar Dec 28 '16 18:12 mrezahemmati

I'm trying to do it. Thank you very much! But, if not difficult, can you give the finished project which works on Swift 3? Thank you!

MuratDeveloper avatar Dec 29 '16 07:12 MuratDeveloper

@MuratDeveloper xmpp-messenger-ios-master.zip

mrezahemmati avatar Dec 29 '16 07:12 mrezahemmati

@mohammadrhemmati Thank you, it's works! You are unbelievable!

MuratDeveloper avatar Dec 29 '16 09:12 MuratDeveloper

@mohammadrhemmati when i use your codes xmpp-ios-messenger-classes in my project it gives me error. looks like its not converted it swift 3 but your sample code runs without error in xcode 8. is there any setup i have to do? kindly help

BhushaniOS avatar Jan 06 '17 07:01 BhushaniOS

@BhushaniOS Try setting "Target Setting->Build Setting->Swift Compiler - Version ->Use legacy swift language version" to "YES"

mrezahemmati avatar Jan 06 '17 10:01 mrezahemmati

@mohammadrhemmati by doing this it gives me error in other classes code in my project which are developed in swift 3 :(

BhushaniOS avatar Jan 06 '17 11:01 BhushaniOS

@BhushaniOS I will check it.

mrezahemmati avatar Jan 06 '17 14:01 mrezahemmati

Any Update Above Issue @mohammadrhemmati by doing this it gives me error in other classes code in my project which are developed in swift 3 :(

JDModi avatar Feb 13 '17 05:02 JDModi

Hi, Iam faceing Module libxml not found DDXMLNode.h

and Could not build Objective-C module 'XMPPFramework'.

Please Help me.

shravanteegala avatar Mar 20 '17 04:03 shravanteegala

yes i did it in Swift 3

JDModi avatar Jul 18 '17 11:07 JDModi

Hello I am using xcode 9 and swift 4.0 but I got error in xmpp framework semantic issue in FMDB class

bhavesh27691 avatar Apr 04 '18 13:04 bhavesh27691

HI Shravanteegala,

Can you please help on Openfire group chat issue, I have implemented group chat but sometimes users unable to send or receive the messages in the particular group.

Thanks Dayakar reddy.

dayakar06 avatar Apr 26 '18 18:04 dayakar06