SnapKitSample-Android

Introduction: The unofficial demo app of the Snapchat's Snap Kit
More: Author   ReportBugs   
Tags:

This is an unofficial demo app of the Snap Kit produced by SnapChat.

Login Kit

Following this document, you can implement SnapChat login. https://docs.snapchat.com/docs/login-kit/

You can fetch displayName & avatar (bitmoji avatar) so far.

1.Call Login Method when the button tapped

val button: Button = findViewById(R.id.button2)
button.setOnClickListener {
    SnapLogin.getAuthTokenManager(this).startTokenGrant()
}

2.After login, fetch user datas

override fun onSuccess(p0: UserDataResponse?) {
    val me = p0!!.data.me
    val name = me.displayName
    val avatar = me.bitmojiData.avatar
    goToNextView(name, avatar)
}

Bitmoji Kit

Following this document. https://docs.snapchat.com/docs/creative-kit/

You can make a Bimoji avatar view & a Bitmoji selection picker.

Fetch avatar image

Bitmoji.fetchAvatarUrl(this, this)

// MARK: - FetchAvatarUrlCallback
override fun onSuccess(p0: String?) {
    currentImageURL = p0
    val imageView: ImageView = findViewById(R.id.imageView)
    Glide.with(this).load(p0).into(imageView)
}

Show bitmoji pickerview

supportFragmentManager.beginTransaction()
    .replace(R.id.bitmoji_container, BitmojiFragment())
    .commit()

Creative Kit

Following this document. https://docs.snapchat.com/docs/creative-kit/

Support Me
Apps
About Me
Google+: Trinea trinea
GitHub: Trinea