Skip to content

Instantly share code, notes, and snippets.

@zaneclaes
Created October 25, 2014 22:05
Show Gist options
  • Save zaneclaes/29d3f55d08fdec0588d4 to your computer and use it in GitHub Desktop.
Save zaneclaes/29d3f55d08fdec0588d4 to your computer and use it in GitHub Desktop.
static NSString * const kKeyHasAttributedReferral = @"hasAttributedReferral";
- (void)attributeReferral {
if([[NSUserDefaults standardUserDefaults] boolForKey:kKeyHasAttributedReferral]) {
return;
}
// Attribute referrals
NSMutableDictionary *params = [NSMutableDictionary dictionary];
params[@"device"] = [[UIDevice currentDevice].model componentsSeparatedByString:@" "].firstObject;
params[@"os_version"] = [[UIDevice currentDevice].systemVersion stringByReplacingOccurrencesOfString:@"." withString:@"_"];
// Add any user-specific parameters and send it to the attribution script...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment