I have a subclass of MSStickerBrowserViewController that contains a MSStickerBrowserView with a couple dozen MSStickers. For analytics, we're trying to track which stickers are the most popular in the sticker app. Is there any way to tell which MSSticker was selected by the user?
There are no delegate methods to tell us that information, unfortunately. I got around this by making my own UICollectionView of MSStickerViews, then adding tap and long press gesture recognizers to the sticker views.
Make sure the gesture's shouldRecognizeSimultaneouslyWith delegate method returns true so they don't get in the way.
To track whether a sticker is actually sent vs. selected takes a bit more work. Tapping and sending a sticker is pretty straightforward to track - the MSMessagesAppViewController methods didStartSending and didCancelSending can tell you if a message was sent or discarded from the input view.
Tracking the peeled and applied sticker analytics is trickier. Applying a sticker to a previous message in the conversation doesn't trigger any of those methods. Best I've come up with so far is to track where the long press ended and make an educated guess as to whether or not the sticker had been sent or cancelled.
© 2022 - 2024 — McMap. All rights reserved.