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

Unable to remove a user property #71

Open
kylef opened this issue Apr 24, 2014 · 3 comments
Open

Unable to remove a user property #71

kylef opened this issue Apr 24, 2014 · 3 comments

Comments

@kylef
Copy link
Contributor

kylef commented Apr 24, 2014

The current API doesn't allow for removing of a user property, there is no remove method and setUserProperty:toValue: doesn't support this.

+ (void)setUserProperty:(NSString *)property toValue:(NSString *)value {
    if (value == nil) {
        NSLog(@"ARAnalytics: Value cannot be nil ( %@ ) ", property);
        return;
    }

    [_sharedAnalytics iterateThroughProviders:^(ARAnalyticalProvider *provider) {
        [provider setUserProperty:property toValue:value];
    }];
}

Is this down to certain providers not letting these be removed?

@Daniel1of1
Copy link
Collaborator

haven't seen them all but I imagine, will look into it. for reference, do you have an example of which provider allows you to remove?

@kylef
Copy link
Contributor Author

kylef commented Jun 27, 2014

This depends on the provider, and some providers might need to map nil to another method or value.

I'd suggest we remove the early return inside [ARAnalytics setUserProperty:toValue:] and move this into each provider that doesn't support unsetting.

/cc @briomusic

@ssuchanowski
Copy link

+1

I'd be good to add to that 'analytics reset' which would clear and reinit all stack - eg. after logout.

Currently I am manually checking if currentProviders is 0 to init them from scrach and do this to stop all:

NSSet *providers = [[ARAnalytics currentProviders] copy];
for (ARAnalyticalProvider *provider in providers) {
  [ARAnalytics removeProvider:provider];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants