join us on Discord for support, updates, and all things Snap AR! See you there!
[Guide] Setting Up Push-To-Device For Camera Kit Sample Apps
Pre-Requisites
Setup the App ID and API Token for the sample apps using the values found in the apps page of the Camera Kit portal
Developer Portal Setup
The Redirect URIs and allowlisted usernames need to be set in the developer portal at kit.snapchat.com
Add Snapchat Usernames to Demo Users
Enable Login Kit
Select the Initial Version or version you are enabling Push-To-Device for, scroll down and select the Login Kit toggle to enable Login Kit for this integration
Add Redirect URI to Login Kit Section
Add <your-app-name>://snap-kit/oauth2
to the Redirect URI field within Login Kit, note that we will use myapp
for the redirect URI for the remainder of this example:
Android Setup:
This assumes you have already set the gradle.properties values for api.token and application.id
Open the build.gradle file:
In manifestPlaceholders set the clientID:
snapKitClientId to the Public OAuth 2.0 Client ID in the Developer Portal:
Then set the snapKitRedirectUrl and following fields as:
'snapKitRedirectUrl': 'myapp://snap-kit/oauth2', 'snapKitScheme': 'myapp', 'snapKitHost': 'snap-kit', 'snapKitPath': '/oauth2',
iOS Setup
This assumes you have already set the SCCameraKitClientID and SCCameraKitAPIToken values in the Info Properties.
Set ClientID and RedirectURL
Open the Info Properties tab:
Set the provided Key:
SCSDKRedirectUrl
value asmyapp://snap-kit/oauth2
Set
SCSDKClientId
to the Public OAuth 2.0 Client ID in the Developer Portal:Scroll down to URL Types and change the URL Schemes to
myapp
or the name of the app you used for the redirectURL
Using Push-To-Device
- With the sample app deployed, press the Gear icon in the Android UI or the bottom UI element with the phone and arrow on iOS.
- You will be prompted to login to Snapchat and connect the auth to the Camera Kit app
- Once connected, Press the Scan Snapcode button in Lens Studio to pair with this app:
- You can then send future versions of the Lens from Lens Studio to the app via the drop down in the upper right of Lens Studio by selecting Send to Camera Kit
Comments
-
@ForumChris Coming in clutch. Thanks Chris!!!
0 -
@ForumChris, how would you test push-to-device CameraKit lenses using the Web SDK?
0 -
@kipp said:
@ForumChris, how would you test push-to-device CameraKit lenses using the Web SDK?Thanks for posting on the forum! At the time of this writing, push-to-device is not ready for the Web SDK. You'll have to publish lens, add to lens folder, grab lens group id, and add to integration to test.
But know that our eng team is cooking up a couple things for a more efficient process / better experience! Stay tuned...
1