Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMPP Framework Issue in Xcode8.1 with Swift 3 #73

Open
NiladriPadhy opened this issue Nov 30, 2016 · 15 comments
Open

XMPP Framework Issue in Xcode8.1 with Swift 3 #73

NiladriPadhy opened this issue Nov 30, 2016 · 15 comments

Comments

@NiladriPadhy
Copy link

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.

@mrezahemmati
Copy link

Same Here

@MuratDeveloper
Copy link

MuratDeveloper commented Dec 28, 2016

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

@mrezahemmati
Copy link

  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

@MuratDeveloper
Copy link

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!

@mrezahemmati
Copy link

@MuratDeveloper
xmpp-messenger-ios-master.zip

@MuratDeveloper
Copy link

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

@BhushaniOS
Copy link

@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

@mrezahemmati
Copy link

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

@BhushaniOS
Copy link

BhushaniOS commented Jan 6, 2017

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

@mrezahemmati
Copy link

@BhushaniOS I will check it.

@JDModi
Copy link

JDModi commented Feb 13, 2017

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 :(

@shravanteegala
Copy link

Hi,
Iam faceing Module libxml not found DDXMLNode.h

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

Please Help me.

@JDModi
Copy link

JDModi commented Jul 18, 2017

yes i did it in Swift 3

@bhavesh27691
Copy link

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

@dayakar06
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants