0

My Apologies if this question was asked before. I have created group chat i am able to send the messages but I don't receive any notification when other person sends a message to me. To get the message i have leave & rejoin the room to get all messages.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Anand
  • 2,086
  • 2
  • 26
  • 44

3 Answers3

0

Have you set the room's delegate to take care of the receiving room message?

try to set the room delegate :

[#XMPPRoom# addDelegate:]

Weizhi
  • 174
  • 4
  • 22
0

This is how you can create a MUC Room; Click Link Here

And this how you invite participants in MUC and send messages to them: Click Link Here

Community
  • 1
  • 1
Fatima Arshad
  • 350
  • 2
  • 5
0

If you are in background mode then you will surely get notification. But for this you have to create Local Notification. You have to create Local Notification in below method.

- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message
{
        UILocalNotification *localNotification = [[UILocalNotification alloc] init];
        localNotification.alertAction = @"OK";
        localNotification.fireDate = [NSDate date];
        localNotification.alertBody = xmppmessage;
        localNotification.soundName = UILocalNotificationDefaultSoundName;
        [[UIApplication sharedApplication] presentLocalNotificationNow:localNotification];

}

If you are not online while another user send you message, so at this stage you have to use PushNotification.

Parthpatel1105
  • 541
  • 6
  • 17