Is there a way to get information out of a lens and into my app?

Kevando
Kevando Posts: 76 🔥🔥

I am very new to iOS development, and I am having trouble understanding how (or if) to get information from the lens into my app.

It's nothing special really, I have a sequential set of lenses that I want to progress the user through and I need to tell if the user "completed" the lens. My solution right now is to make each lens a timed experience with a question at the end.

Tagged:

Best Answer

  • ForumChris
    ForumChris Posts: 23 👻
    #2 Answer ✓

    Hey @Kevando

    To send data from the Lens to the app you will want to use Remote APIs.

    In the Camera Kit Sample app you can look at the CatFactRemoteApiServiceProvider for an example implementation and adapt that to send a request from the Lens once the user has completed it. Your use case is most similar to the Button Press example on that docs page mentioned above.

Answers

  • Kevando
    Kevando Posts: 76 🔥🔥

    Thanks @ForumChris ! This example inherently answers all of my follow up questions. Amazing work as always :D

  • James William
    James William Posts: 1
    edited December 2023 #4

    Your approach of creating a timed experience with questions at the end for each lens sounds like a reasonable solution. To get information from the lens into your app, you might want to explore using sensors, camera data, or user interactions depending on the nature of your lenses.

    Feel free to ask specific questions or share more details about your project if you need further guidance. The iOS developer community is a great resource, and you'll find plenty of support as you learn navigate through your development journey.