camera-kit-ios-sdk icon indicating copy to clipboard operation
camera-kit-ios-sdk copied to clipboard

LensMediaPickerProvider bug

Open Jmaguerre opened this issue 2 years ago • 1 comments

Hi!

Context:

  • I'm using the latest version as of today which is 1.36.1.
  • iOS 18.1.1 on an iPhone 16 Pro.

I'm implementing a custom LensMediaPickerProvider for a Background Image lens. My provider is pretty much dummy since I'm actually using a PHPickerViewController so the user can pick an image from the native camera roll implementation. The way I'm doing this is on the mediaPickerProviderRequestedUIPresentation method I create the view controller and present it. This works perfect. However, I'm experiencing some odd behaviours.

Things I'm experiencing:

  • After applying the lens, mediaPickerProviderRequestedUIDismissal from the LensMediaPickerProviderUIDelegate is called first and then mediaPickerProviderRequestedUIPresentation. Why is the requested dismissal method called when applying the lens? Shouldn't it only call the request for presentation?

  • After canceling the native PHPickerViewController and dismissing it. Trying to apply the lens again succeeds but mediaPickerProviderRequestedUIPresentation is never called again so I can't show the picker a consecutive time.

  • Applying another lens which has nothing to do with a media picker is calling mediaPickerProviderRequestedUIDismissal on the provider UI delegate. Is this intended?

  • Only after this other lens is applied and mediaPickerProviderRequestedUIDismissal is called, then mediaPickerProviderRequestedUIPresentation is called again and it goes back to working (I can show the PHPickerViewController).

Sorry if it doesn't qualify as an issue, there's no much documentation on custom providers. The only thing I found was the MediaPickerView implementation which gave me a hint on how I could make this work.

Thanks!

Jmaguerre avatar Dec 05 '24 20:12 Jmaguerre

Solved my issue, sorry for the miss report

Jmaguerre avatar Dec 06 '24 14:12 Jmaguerre