You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a Lens using Snapchat's dynamic lens example as a starting point.
I tested the Lens in Lens Studio with a fallback datasource and the Lens was correctly showing the values.
I published the Lens and I'm viewing it in our App.
Reproduceable Code
//JavaScript code constinitialLaunchData={challenge: 'Return to Oz',duration: '... in 13 Days',stats: ["22 Workouts","13K calories burned","30 miles"],date: [2023,12,14]};return(<><CameraKitref={ref}style={styles.container}isActive={active}initialCameraFacing="front"initialLens={{id: route?.params?.lensId,launchData: initialLaunchData,}}zoom={zoom}focus={focus}preset="hd-1280x720"lensGroups={[cameraKitSettings.lensGroupId]}onInitialized={()=>{console.log('onInitialized');}}onLensChanged={(_event)=>{// console.log(event);}}onPhotoTaken={(picture)=>{console.log({ picture });navigation.navigate('SnapchatPreviewScreen',{type: Enums.PREVIEW_TYPES.PHOTO,path: picture.path,});}}onVideoRecordingFinished={(video)=>{console.log({ video });setIsVideoRecording(false);navigation.navigate('SnapchatPreviewScreen',{type: Enums.PREVIEW_TYPES.VIDEO,path: video.path,});}}onError={(error)=>{console.log('onError',error);}}/>
//Lens manager code
//@input Component.Text challengeText;
//@input Component.Text durationText;
//@input Component.Text statsText;
//@input Component.Text dateText;
// This will use FallbackData if global.launchParams has not been filled out
var launchParams = global.launchParams;
/* Storage accessors */
var challenge;
var duration;
var stats;
var date;
var storageKeys = ["challenge","duration","stats", "date"]
/****************/
function getData() {if(launchParams){if(launchParams.has(storageKeys[0])&&launchParams.has(storageKeys[1])&&launchParams.has(storageKeys[2])&&launchParams.has(storageKeys[3])){challenge=launchParams.getString(storageKeys[0]);duration=launchParams.getString(storageKeys[1]);stats=launchParams.getString(storageKeys[2]);date=launchParams.getStringArray(storageKeys[3]);returntrue;}
return false;
}}functionpopulateFields(){script.challengeText.text=challenge;script.durationText.text=duration;for(variinstats){script.statsText.text+=(parseInt(i)+1)+". "+stats[i]+'\n';}
setDate();
}functionsetDate(){if(date.length==3&&date[1]<=12){script.dateText.text=global.localizationSystem.getDateFormatted(newDate(date[0],date[1]-1,date[2]));} else {print("Error: Incorrect date passed in, should be [year, month, day]. Today's date will be used instead");script.dateText.text=global.localizationSystem.getDateFormatted(newDate());}}if(getData()){populateFields();} else {print("Failed to get Data");
What happened instead?
The correct Lens is shown but the hardcoded values for the fields are shown, not the launchData values that were passed in.
I was the sole contributor to this repository. Unfortunately, due to a company layoff, I have left. As a result, there is no one maintaining this library anymore.
Nevertheless, I intend to address this issue at the appropriate time. It appears to be a straightforward problem to fix.
What were you trying to do?
I have created a Lens using Snapchat's dynamic lens example as a starting point.
I tested the Lens in Lens Studio with a fallback datasource and the Lens was correctly showing the values.
I published the Lens and I'm viewing it in our App.
Reproduceable Code
What happened instead?
The correct Lens is shown but the hardcoded values for the fields are shown, not the launchData values that were passed in.
Relevant log output
No response
Device
Pixel 7
Library Version
0.2.0
Additional information
The text was updated successfully, but these errors were encountered: