Search code examples
iosswiftsnapchat

Snap Kit doesn't open Snapchat with startSending


I'm trying out the Snap Kit Framework from Snapchat using their sample code but when running the code nothing happens and no error is thrown.

import SCSDKCreativeKit

let snap = SCSDKNoSnapContent()
snap.sticker = SCSDKSnapSticker(stickerImage: UIImage(named: "story_share.png")!)
snap.caption = "Snap on Snapchat!"
snap.attachmentUrl = profileURL.absoluteString

SCSDKSnapAPI().startSending(snap) { (error: Error?) in
    print(error)
}

The logs don't indicate an error either:

myapp[853:121028] [SnapKit] Dynamic config update status: success

Things I've tried or insured are correct:

  • My app is registered online with the correct bundle id, my test snapchat username and the creative kit is selected
  • the development key is in the Info.plist file as SCSDKClientId
  • snapchat is in the list of LSApplicationQueriesSchemes
  • the code runs on the main thread
  • using their userInteractionEnabled trick doesn't make a difference
  • I'm using carthage and embed the core and creative framework as usual

What could be the reason why this doesn't work?


Solution

  • I found the disappointing answer that it only works using the deprecated method call:

    SCSDKSnapAPI(content: snap).startSnapping() { (error: Error?) in
        ...
    }
    

    I hope that Snapchat fixes their terrible framework in the future. If anyone knows an actual solution, please let me know and I'll accept your answer.