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 disable tracking in Swift? #459

Closed
wlxo0401 opened this issue Aug 4, 2023 · 2 comments
Closed

How can I disable tracking in Swift? #459

wlxo0401 opened this issue Aug 4, 2023 · 2 comments
Labels
question Further information is requested

Comments

@wlxo0401
Copy link

wlxo0401 commented Aug 4, 2023

Summary

스크린샷 2023-08-04 오후 7 10 28

My project is Swif.

However, only Objective-C is available for how to use Disable tracking.

How can I apply it in Swift as well?? Or are there any related documents?

The code I want to do with Swift is below.

#import "AMPTrackingOptions.h"

AMPTrackingOptions *options = [[[[AMPTrackingOptions options] disableLatLng];
[[Amplitude instance] setTrackingOptions:options];

@yuhao900914
Copy link
Contributor

Hi @wlxo0401,
Thanks for using amplitude. I added the swift example in the doc. It will be merged and released soon.
Also sharing the snippet here.

            let trackingOptions = AMPTrackingOptions().disableCity().disableCarrier();
            Amplitude.instance().setTrackingOptions(trackingOptions!);

Closing this issue. Feel free to reopen this if you still have issues.
Thanks.

@yuhao900914
Copy link
Contributor

Just want to share with you. We have a new iOS SDK which is developed using swift. It will be GA soon. And this is the SDK we are going to deprecate. Read more.
There has been a lot of improvement in the latest iOS SDK. Please take a look at here. More information related to the latest architecture.

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