How to disable MSSticker if it is locked?

Home Forums General Support How to disable MSSticker if it is locked?

This topic contains 8 replies, has 2 voices, and was last updated by  Justin at CartoonSmart 3 days, 21 hours ago.

  • September 20, 2016 at 11:43 am #155990

    How will you disable people from using locked MSStickers? I’ve missed something from the tutorial and I can click on the lock stickers and send it as a message.

    And if lock stickers was pressed, how to make it prompt to purchase allstickers. Thank you.

  • September 20, 2016 at 11:48 am #155992

    No, you haven’t missed anything. There’s actually not an isEnabled type property for stickers. Though the more people that tell Apple that at bugreport.apple.com , the better. They do take feature requests there.

    But there’s two options. Use an alternate image (unworthy) of sending, though if someone wanted, they could still send it. I’m thinking like a Lock Icon overtop the image or animation.

    Or you can intentionally make the APNG over 500kb, in which case it won’t send. The only issue there is you’re adding to the file size unnecessarily if you do that for every animation. Will people notice? Probably not though.

    My suggestion would be to make one over-size 500kb image and use that as a placeholder for every locked sticker. Doing that is Apple-approved by the way.

  • September 20, 2016 at 11:35 pm #156029

    Yeah, thats a tricky one. I’ve been up and down that sticker browser code. They might be overlaying something on top of the browser to disable it. Kinda feel like they must be to trigger the purchase prompt.

    • September 21, 2016 at 4:15 am #156030

      @justin, I tried doing a file (APNG) greater than 500, I can still stick it or send it as a sticker. How did you do your APNG?

    • September 21, 2016 at 10:25 am #156040

      You might want to double check that its actually over 500kb. It is a .png file right? Not a Sticker Sequence ?

    • September 24, 2016 at 8:02 am #156122

      So it looks like the trick to this is using MSStickerView to show each MSSticker. So it means adding an MSStickerView for each sticker.

      
      let sticker: MSSticker
              do {
      try sticker = MSSticker(contentsOfFileURL: stickerURL, localizedDescription: "")
      
      let newStickerView:MSStickerView = MSStickerView(frame: cell.frame)
      newStickerView.sticker = sticker
      newStickerView.startAnimating()
      
      //newStickerView.isUserInteractionEnabled = false  //would disable the sticker if you wanted to do that. 
      
      }
      
                  } catch {
                  
                      print(error)
                  
                  }
              
              }
      

      In the example cell.frame could be any CGRect.

You must be logged in to reply to this topic.