The problem
On iOS 10.2
didSelect() is only called when select a message for the first time, but not for the second time selecting the same message (right after the first select happened). For example:
- Click a received MSMessage Message_A while my message app is active, didSelect() method is correctly called and app transit to extended view.
- Click down arrow to bring app back to compressed view.
- Click the same message - Message_A again, this time didSelect() isn't triggered.
Words From Apple
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.
My thought
It seems selectedMessage isn't updated when we click that message the second time (because it was already set in the first click), thus didSelect() isn't called.
Question
- Am I doing it wrong?
- Is there a way to work around and call didSelect() as long as a selection happens? selectedMessage is read only...
- Or is there a way to make message expire (disappear) from conversation immediately after user opens (clicks) the message?
@degapps,
Here is a workaround: After first click on message, didSelect() will take you to expanded view. Now, if a transition to compact view happens, we dismiss this app. It's not a good solution and unlikely to work for most of applications.