iOS GCMessengerSDKSample

Hey, we would like to introduce live chat to our iOS application and have the sample from below working.

What seems to be missing is a delegate method to indicate that an incoming message has been received from agent to customer.

I can see in the 'ChatElementDelegate' a method for:
- (void)didReceiveChatElement:(id<StorableChatElement>)item;
This notifies our code that a message has been sent to the agent by the customer but this does not get fired the other way round. Is this intentional? ideally we would like to have our code notified when an incoming message is received so the user can navigate around the app while waiting for an agent.

Thanks

Hi Chris,

Thank you for sharing the details of the issue.

There are two specific flows you’re looking for:

  1. Triggering the didReceiveChatElement event when a chat element is received from the agent.
  2. Receiving a notification when the agent sends messages to the user, even when the user is navigating outside the chat window.

Feedback:

  • Passing events for received messages should indeed be possible via didReceiveChatElement. - We were able to reproduce the issue and bug was opened and will be fixed on version v1.11.1.
  • Currently, we do not support sending notifications to users while the chat window is inactive. This functionality will be available once Push Notifications are implemented. - Push Notification feature is in our roadmap for 2025.

BR,
Eliza

ah thanks for that. One more observation. the functions in the sample app for ending a chat on the mobile app:

/**
 Ends current chat handler.
 */
- (void)endChat:(BOOL)forceClose;

/**
 Teminates the chat controller and all active chats.
 */
- (void)terminate;

These are not informing the Agent that the user has left the chat. is this a bug?

Thanks

hey @Eliza_Koren perhaps @Andras_Solyom any idea why we do not see an end to the chat from the agent point of view when these functions are called?

I also notice the project has been updated to use 1.11 but I do not see a 1.11 release in the podspec repo? so the pod update and project build now fails...

Hi ios_dev,

It was a merge mistake, I apologise for this. We corrected the sample application code, now it should update to the latest official release, 1.10.2.

Hi,

If you use the terminate or endChat:false, the SDK will close the socket, not terminate the whole conversation. The conversation still can be continued until the session token is not expired.

Thanks, Is there any way to allow the customer to end the chat and have the the agent aware of this?

The web client has an end chat button that does this.

Hi Chris,

The Conversation Clear feature is not supported on Mobile Messenger.
It's on our roadmap. Possible release target is Q1-Q2 timeframe.
We have a dedicated idea for this feature, we will share updates on the idea.

Currently there is no other workaround to end the conversations in Mobile Messenger