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

Add callbacks or support Google Analytics #15

Closed
fulldecent opened this issue Sep 3, 2015 · 1 comment
Closed

Add callbacks or support Google Analytics #15

fulldecent opened this issue Sep 3, 2015 · 1 comment

Comments

@fulldecent
Copy link

Here is the code I am removing from my app's AppDelegate while switching from arashpayan/appirater to SARate. It would be nice to be able to do this in SARate. Alternatively, SARate could automatically do this without any configuration if the GA was available.

#pragma mark - AppiraterDelegate

- (void)appiraterDidDisplayAlert:(Appirater *)appirater
{
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Appirater"
                                                          action:@"DisplayAlert"
                                                           label:@"done"
                                                           value:@1] build]];
}

- (void)appiraterDidDeclineToRate:(Appirater *)appirater
{
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Appirater"
                                                          action:@"DeclineToRate"
                                                           label:@"done"
                                                           value:@1] build]];
}

- (void)appiraterDidOptToRate:(Appirater *)appirater
{
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Appirater"
                                                          action:@"OptToRate"
                                                           label:@"done"
                                                           value:@1] build]];
}

- (void)appiraterDidOptToRemindLater:(Appirater *)appirater
{
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Appirater"
                                                          action:@"OptToRemindLater"
                                                           label:@"done"
                                                           value:@1] build]];
}

- (void)appiraterWillPresentModalView:(Appirater *)appirater animated:(BOOL)animated
{
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Appirater"
                                                          action:@"WillPresentModalView"
                                                           label:@"done"
                                                           value:@1] build]];
}

- (void)appiraterDidDismissModalView:(Appirater *)appirater animated:(BOOL)animated
{
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Appirater"
                                                          action:@"DidDismissModalView"
                                                           label:@"done"
                                                           value:@1] build]];
}
@fulldecent
Copy link
Author

Closing, Apple is killing this project in iOS 11.

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

1 participant