An android app that demonstrates Snapchat's creative kit integration with Jetpack compose
- To try out this sample app, you need to use Android Studio Arctic Fox.
- You can clone this repository.
- Add your
client idfrom Snapkit Developer Portal inside strings.xml
<string name="snapchat_client_id">Your client id</string>- Make sure to change project name in
AndroidManifest.xml
<application ...>
...
<meta-data
android:name="com.snapchat.kit.sdk.clientId"
android:value="@string/snapchat_client_id" />
<provider
android:authorities="${applicationId}.fileprovider"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"
/>
</provider>
...
</application>- Create
xmldirectory inres - Create
file_paths.xmlfile inxmldirectory. - Add following code snippet for using it as
cache directoryfor storing images
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<cache-path name="tmp" path="/" />
</paths>- Add your own lens uuid from my lenses
- procedure for capturing lens uuid
- Click here to login to check out your lenses
- Now, as shown in below image, click on
chainicon to copy link for your lens -
- Paste the same link in
new tabyou will be able to find uuid as below image shows
- procedure for capturing lens uuid
- As you found your uuid, go inside
MainActivity.ktfind functiongetLens()and add your uuid
fun getLens(){
...
val snapLensContent = SnapLensContent.createSnapLensContent(
"your lens uuid",
launchData
)
...- These are the only steps to do.

