Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade SDK to Camera Kit v1.26.1 (And lenses to LS v4.55.1) #3

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
This repository contains a template project that allows you to build a Unity application and leverage Snap's Camera Kit technology. It supports both iOS and Android builds.

## Requirements
- Unity 2022.1.23f1
- Camera Kit SDK 1.23.0 (compatible with Lens Studio v4.47)
- Unity 2022.3.17f1
- Camera Kit SDK 1.26.1 (compatible with Lens Studio v4.55.1)
- Android:
- Android Studio Flaming (Min SDK version 22, Target SDK version 33)
- Android Studio Flamingo (Min SDK version 22, Target SDK version 33)
- Gradle 7.2
- iOS:
- XCode 14.1
- XCode 15
- Cocoapods

## Project structure
Expand Down Expand Up @@ -134,17 +134,20 @@ In order to get a callback from your app, you'll need to configure a Remote API.
2. Visibility: `Private`
3. Host: `unity`
4. Security Scheme: `NONE`
5. Click **Next**
3. In the following screen, add an Endpoint with information as below:
1. Reference ID: `unitySendData`
3. **Add Endpoint** with information as below:
1. Reference ID: `unity_send_data`
2. Path: `sendData`
3. Method: `POST`
4. Click **Add Parameter**, and add a Parameter with information as below:
1. Name: `unityData`
2. Parameter Location: `HEADER`
3. External Name: `unitySendData`
4. Optional: `YES`
5. Constant: `NO`
4. **Add Parameter**, and add a Parameter with information as below:
1. Name: `unityData`
2. Parameter Location: `HEADER`
4. Optional: `YES`
5. Constant: `NO`
4. **Add Endpoint** with information as below:
1. Reference ID: `unity_request_state`
2. Path: `requestState`
3. Method: `GET`
4. (No parameters)
5. Check the confirmation box and click **Submit API**

From this moment on, you have a **Remote API Spec ID** in the portal, which you will need for the steps below.
Expand All @@ -161,7 +164,7 @@ function sendEventToUnity(eventName, eventValue) {
"eventName" : eventName,
"eventValue" : eventValue
};
UnityApi.unitySendData(JSON.stringify(dataToSend), function(err, r){
UnityApi.unity_send_data(JSON.stringify(dataToSend), function(err, r){
print("Data sent to Unity");
print("Error? " + err);
print("Result? " + r);
Expand Down Expand Up @@ -220,7 +223,7 @@ Since there is no direct method for a lens to receive pushes from an outside con
```javascript
script.api.requestUpdatedStateFromUnity = function()
{
ApiModule.unityRequestState(script.api.handleUnityUpdate)
ApiModule.unity_request_state(script.api.handleUnityUpdate)
}

script.api.handleUnityUpdate = function(err, response) {
Expand Down
17 changes: 0 additions & 17 deletions app-android/.idea/deploymentTargetDropDown.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app-android/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ internal object UnityGenericApiService : LensesComponent.RemoteApiService {
onResponse: Consumer<LensesComponent.RemoteApiService.Response>
): LensesComponent.RemoteApiService.Call {
return when (val endpointId = request.endpointId) {
"unitySendData" -> {
"unity_send_data" -> {
Log.d("unity-camkit", "Params from Lens ${request.parameters.toString()}")
UnityPlayer.UnitySendMessage("CameraKitHandler", "MessageResponseFromLens", request.parameters["unityData"])
onResponse.accept(request.toSuccessResponse())
LensesComponent.RemoteApiService.Call.Answered
}
"unityRequestState" -> {
"unity_request_state" -> {
Log.d("unity-camkit", "Params from Lens ${request.parameters.toString()}")
UnityPlayer.UnitySendMessage("CameraKitHandler", "MessageLensRequestedState", "")
Pending.statusUpdateRequest = request
Expand Down
6 changes: 3 additions & 3 deletions app-ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ target 'UnityWithCameraKit' do
# Pods for UnityWithCameraKit

pod 'Alamofire', '~> 5.4'
pod 'SCSDKCameraKit', '1.23.0'
pod 'SCSDKCameraKitReferenceUI', '1.23.0'
pod 'SCSDKCameraKitReferenceSwiftUI', '1.23.0'
pod 'SCSDKCameraKit', '1.26.1'
pod 'SCSDKCameraKitReferenceUI', '1.26.1'
pod 'SCSDKCameraKitReferenceSwiftUI', '1.26.1'

target 'UnityWithCameraKitTests' do
inherit! :search_paths
Expand Down
26 changes: 13 additions & 13 deletions app-ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Alamofire (5.6.2)
- SCSDKCameraKit (1.23.0)
- SCSDKCameraKitReferenceSwiftUI (1.23.0):
- SCSDKCameraKitReferenceUI (~> 1.23.0)
- SCSDKCameraKitReferenceUI (1.23.0):
- SCSDKCameraKit (~> 1.23.0)
- SCSDKCameraKit (1.26.1)
- SCSDKCameraKitReferenceSwiftUI (1.26.1):
- SCSDKCameraKitReferenceUI (~> 1.26.1)
- SCSDKCameraKitReferenceUI (1.26.1):
- SCSDKCameraKit (~> 1.26.1)

DEPENDENCIES:
- Alamofire (~> 5.4)
- SCSDKCameraKit (= 1.23.0)
- SCSDKCameraKitReferenceSwiftUI (= 1.23.0)
- SCSDKCameraKitReferenceUI (= 1.23.0)
- SCSDKCameraKit (= 1.26.1)
- SCSDKCameraKitReferenceSwiftUI (= 1.26.1)
- SCSDKCameraKitReferenceUI (= 1.26.1)

SPEC REPOS:
trunk:
Expand All @@ -21,10 +21,10 @@ SPEC REPOS:

SPEC CHECKSUMS:
Alamofire: d368e1ff8a298e6dde360e35a3e68e6c610e7204
SCSDKCameraKit: 2386b3b0a17f64760ec4eca52031b96baa7cf318
SCSDKCameraKitReferenceSwiftUI: aec586966a52b585c1d4949e8b92c8ce45130080
SCSDKCameraKitReferenceUI: 9eaf2cafde9793cea9bfa1675de5aea397fcd239
SCSDKCameraKit: 3ebeb28638f7d478257caa3102e0edc987eb1a63
SCSDKCameraKitReferenceSwiftUI: 09e35e93927ba3717b6f3c191cc05c29baf66c09
SCSDKCameraKitReferenceUI: 9013428085da7532f2eb94204dc06882072b6081

PODFILE CHECKSUM: 297dbcbac2198db62184a06d1a1ded1aadf154ef
PODFILE CHECKSUM: fa2bfbcbcae72546a04f45428258f58a41c54cd1

COCOAPODS: 1.12.1
COCOAPODS: 1.15.0
Loading
Loading