willSelectMessage and didSelectMessage don't fire

Based on sdk document, willSelect, didSelect method should be inovked after user selects a message, but it looks like those 2 methods only get fired once. and if sender side tap same message again those methods don't get called. Is it by deisng. also on receiver side, it never call those methods at all.


func willSelect(MSMessage, conversation: MSConversation)

Invoked after the user selects a message object in the transcript, but before the system updates the conversation’s

selectedMessage
property.


func didSelect(MSMessage, conversation: MSConversation)

Invoked after the system updates the conversation’s

selectedMessage
property in response to the user selecting a message object in the transcript.

Accepted Reply

I noticed the same thing. I got around it by using didBecomeActive(with conversation:) then checking conversation.selectedMessage

to see if the user launched the application by tapping one of my messages. Once the application is running didSelect works fine, for me.

Replies

I noticed the same thing. I got around it by using didBecomeActive(with conversation:) then checking conversation.selectedMessage

to see if the user launched the application by tapping one of my messages. Once the application is running didSelect works fine, for me.

thx. i follow your approach to code my logic.

Hi, your approach makes sense, but I still see a problem : when one selects a message, the app extension opens in expanded mode.


So, if the Message extension is not open, I can track didBecomeActive, and I can tell if the user selected the message or clicked the Expand button (lower right). So far so good.


But if the Message extension is already open, didBecomeActive is not fired, and I can't tell if the user clicked on the message or the Expand button.


This really is a head scratcher, as I would like to handle these situations in 2 different ways.


Do you have any idea for this case ?


Regards

I am with Chris on this. This is indeed a problem and there needs to be a way to address this. As Chris said, currently didSelect is called only the first time and any subsequent taps on the message doesn't call didSelect function but the screen transitions to MSMessagesAppPresentationStyleExpanded. Any help or advice is highly appreciated.


Regards

I posted my workaround on this thread. It's roughly the IceCreamBuilder solution, plus subtle hinting to user to ward off complete confusion. It's not perfect, and it might not be appropriate for every app design.

We ended up just completely dismissing the entire iMessage application when compacting if the application was launched from a selectedMessage. This works for our behaviors but obviously isn't suitable for everyone. It's not what we want but it was the best we could get with the currently exposed APIs.

This is what we end up doing. Not the proper fix but until we get anything for this behavior I think it's the only way of doing it. Let's hope these issues get fixed before iOS 11!

Is App Review going to be okay with dismissing on collapse-to-compact-mode? It sort of violates their intended interface design...