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

How can I use Ampli CLI + autocapture for tracking lifecycle? #245

Closed
carlosmellado opened this issue Oct 28, 2024 · 1 comment
Closed
Labels
question Further information is requested

Comments

@carlosmellado
Copy link

Summary

I want to use the Ampli CLI for allowing product to manage all the event and properties, and it works nice, but I can't manage to make it work with lifecycle events as per documentation, you recommend to use autocaptureand it's not accessible or it's not working at all using the Ampli.instance.load() function.

The only way I make it work is doing something like this:

//Call to load()
Ampli.instance.load(LoadOptions(environment: .environment))
//Then change the defaultTracking Options
Ampli.instance.client.configuration.defaultTracking = DefaultTrackingOptions(sessions: true, appLifecycles: true, screenViews: true)

Even working, I see a warning because you deprecated defaultTracking in order to use autocapture.
But autocapture is a read-only property and can't be changed.

So, I would like to know your recommendations in order to use Ampli CLI and how to being able to change the autocapture options as well.

Thanks in advance.

@carlosmellado carlosmellado added the question Further information is requested label Oct 28, 2024
@crleona crleona transferred this issue from amplitude/Amplitude-iOS Nov 14, 2024
@crleona
Copy link
Collaborator

crleona commented Nov 14, 2024

Hi @carlosmellado, this appears to be an issue with Amplitude-Swift, not Amplitude-iOS, as we've only added autocapture in Amplitude-Swift.

To configure autocapture, please pass a configuration with the configured options to your ampli.load, something like ampli.load(LoadOptions(client: LoadClientOptions(configuration: Configuration(apiKey: "", autocapture: [.sessions, .appLifecycles]))))

@crleona crleona closed this as completed Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants