2

I am developing a chat application using robbiehanson/XMPPFramework.

I am trying to enable Message Carbons for which I am using XMPPMessageCarbons from XEP-0280, but I am neither receiving any response nor an error.

Following is my code.

XMPPMessageCarbons *xmppMessageCarbon  = [[XMPPMessageCarbons alloc] initWithDispatchQueue:dispatch_get_main_queue()];

xmppMessageCarbon.autoEnableMessageCarbons = YES;
xmppMessageCarbon.allowsUntrustedMessageCarbons = YES;

[xmppMessageCarbon activate:xmppStream];

Please tell me if I am missing out anything or doing it in a wrong way. An alternate solution would also be helpful.

Pooja Sangle
  • 301
  • 2
  • 10

1 Answers1

3

I found the solution for this. I was actually doing it in a wrong way. All I need to do is first call activate function and then enableMessageCarbons. So the final code will be

XMPPMessageCarbons *xmppMessageCarbon  = [[XMPPMessageCarbons alloc] initWithDispatchQueue:dispatch_get_main_queue()];

[xmppMessageCarbon activate:xmppStream];
[xmppMessageCarbon enableMessageCarbons]; 
Pooja Sangle
  • 301
  • 2
  • 10
  • Hi could you please guide me how to use XMPPMessageCarbons? I use your code but server doesn't send me response back. Where can I write that code? – Khant Thu Linn Sep 03 '15 at 06:10