Takeparticipantphoto where is the taken photo passed to/saved at?

Trying zoomapps-advancedsample-react. after debuggin the various issues that it has, I added the takeparticipantphoto permission and added it to apis.js, and connected it to a button. When button is pressed, zoom pop up permission request, and after allowing taking participant photo, animation of such aciton is shown. But I don’t know where the photo taken from it is sent to. The API call only returns a promise, which is a promise that resolves to whether or not the call was successful.

@davidzhangshs,

Thank you for posting in the Zoom Developer forum. Are you listening for the OnPhoto event, the image data should be returned in the response:

I tried following both the documentation and example from an 2023 post, neither work. The event is empty.

zoomSdk.onPhoto((event) => {
  console.log(event)
  const onPhotoResponseElement = document.getElementById('on-photo-response');
  onPhotoResponseElement.innerHTML += `<div>${JSON.stringify(event.response)}</div>`;
});

// For each onPhoto event, add a new div that displays the event inside on-photo-response
zoomSdk.addEventListener('onPhoto', (event) => {
  console.log(event)
  const onPhotoResponseElement = document.getElementById('on-photo-response');
  onPhotoResponseElement.innerHTML += `<div>${JSON.stringify(event)}</div>`;
});

zoomSdk.addEventListener(‘onPhoto’, async (event) => {
const data = await event;
const onPhotoResponseElement = document.getElementById(‘on-photo-response’);
onPhotoResponseElement.innerHTML += <div>${event.participantUUID}</div>;
onPhotoResponseElement.innerHTML += <div>${JSON.stringify(data)}</div>;
});

Eventually it is resolved by adding an additional await on the event… this is pretty broken. Who would have thought you need to await on event in the event listener?

zoomSdk.addEventListener(‘onPhoto’, async (event) => {
const photoData = await event;
}

please fix the documentation for this. I can’t post the link to it because the forum doesn’t allow.

didn’t understand your question! is it about photo enhancing then you should take a try to imgify photo enhancer.