Snapchat Snapkit Lessons In Documentation

Part 2 in a continuing saga of working with Snapchat Snapkit for iOS/Swift

Part 1 — Snapchat Snapkit Developer Support Sadly Sad

After getting a somewhat satisfactory answer to the daunting instruction foo://bar — without bar my next step was the bullet right below it in the documentation for Login Kit


  • SCSDKScopes (string-array): The scopes of access your application will request from the user; see Understanding Scopes section above

Fine, fine let’s go to the Understanding Scopes section

Understanding Scopes
Scopes let your application declare which Login Kit features it wants access to. If a scope is toggleable, the user can deny access to one scope while agreeing to grant access to others.
Login Kit offers the following scopes:
https://auth.snapchat.com/oauth2/api/user.external_id: Grants access to a stable user ID specific to your app
https://auth.snapchat.com/oauth2/api/user.display_name: Grants access to the user's Snapchat display name
https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar: Grants access to the user's Bitmoji avatar; toggleable by user

Well, okay so that section talks about the scopes, but says nothing about what this SCSDKScopes (string-array) is supposed to look like. Time to file another bug.

Documentation does not clearly state the format of SCSDKScopes array

In this case, I didn’t do all the possible homework I could have done. Github user Jarod pointed this out to me. If I had dug into the example repository, I would have seen an example.

<key>SCSDKScopes</key> <array> <string>https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar</string> </array>

Next up, I’ll try the next few bullet points and see how it goes .. Here’s a preview

  • LSApplicationQueriesSchemes (string-array): Must contain snapchat, bitmoji-sdk, and itms-apps
  • CFBundleURLSchemes (string-array): Must contain your redirect URL’s scheme — so if your redirect URL is my-app://abc/xy/z, this field would contain my-app

In the Snap Kit developer portal, add the same URL you put in Info.plist to your app's Redirect URLs. Without this, you'll get an error when your app tries to open Snapchat for OAuth.

Series

Contact: