6

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?

David M
  • 433
  • 3
  • 12

1 Answers1

5

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.

JAB
  • 3,165
  • 16
  • 29
  • Hey - I am trying to do the same thing and have implemented a custom class attempting to do what you suggested but cant display my sticker views, only stickers.. can you help me out please? My question is http://stackoverflow.com/questions/39760009/how-to-add-sticker-views-to-browser-view-in-swift – blue Sep 29 '16 at 01:35
  • @BJHStudios do you know how to send stickerview in message programatically, i have written some code to send via insert message but at same time auto sending of msstickerview also triggered so it sometime auto insert call and some time my overrided insert called.let me know if you have some example to sort out this type issue. – Muhammad Shauket Jun 05 '17 at 06:54