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 id
from 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
xml
directory inres
- Create
file_paths.xml
file inxml
directory. - Add following code snippet for using it as
cache directory
for 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
chain
icon to copy link for your lens -
- Paste the same link in
new tab
you will be able to find uuid as below image shows
- procedure for capturing lens uuid
- As you found your uuid, go inside
MainActivity.kt
find functiongetLens()
and add your uuid
fun getLens(){
...
val snapLensContent = SnapLensContent.createSnapLensContent(
"your lens uuid",
launchData
)
...
- These are the only steps to do.