Skip to content

Instantly share code, notes, and snippets.

@flurrydev
flurrydev / iosuserproperties
Last active April 22, 2020 21:38
iOS User Properties
NSArray *array = @[@"value1", @"value2", @"value3"];
//Sets and replaces (if any exist) the values for a property.
[FlurryUserProperties set:@"key" Values: array];
[FlurryUserProperties set:@"key" Value: @"string"];
//Adds the values or single value to the property.
[FlurryUserProperties add:@"key" Values: array];
[FlurryUserProperties add:@"key" Value: @"string"];
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let builder = FlurrySessionBuilder.init()
.withLogLevel(FlurryLogLevelAll)
.withAppVersion("123")
.withCrashReporting(true)
.withDataSaleOptOut(true) //the default is false
Flurry.startSession("apiKey", with: builder)
return true
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
FlurrySessionBuilder* builder = [[[[FlurrySessionBuilder new]
withCrashReporting:YES]
withAppVersion:@"123"]
withDataSaleOptOut:YES]; // the default is NO
[Flurry startSession:@"apiKey" withSessionBuilder:builder];
//Your code
...
FlurryAgent.onError(errorId: String, message: String, exception: Throwable)
// Capture author info & user status
val articleParams = HashMap<String, String>()
articleParams["Author"] = "John Q"
articleParams["User_Status"] = "Registered"
FlurryAgent.logEvent("Article_Read", articleParams)
import com.flurry.android.FlurryAgent
class MyApplication : Application() {
init {
FlurryAgent.Builder()
.withLogLevel(Log.VERBOSE)
.withLogEnabled(true)
.build(this, FLURRY_APIKEY)
//your code
}
NSDictionary *consentDict = [[NSDictionary alloc] initWithObjectsAndKeys:@"iab", @"IAB_Consent_String", nil];
[FlurryConsent updateConsentInformation: [[FlurryConsent alloc] initWithGDPRScope:YES andConsentStrings: consentDict]];
NSDictionary *consentDict = [[NSDictionary alloc] initWithObjectsAndKeys:@"IAB_Consent_String", @"iab", nil];
FlurryConsent *consent = [[FlurryConsent alloc] initWithGDPRScope:YES
andConsentStrings:consentDict];
FlurrySessionBuilder* builder = [[[[[[FlurrySessionBuilder new]
withLogLevel:FlurryLogLevelAll]
withCrashReporting:YES]
withSessionContinueSeconds:10]
withAppVersion:@”0.1.2”]
withConsent:consent];
9üM"m³IÓM{"fl.frame.log.counter":70}®üM"mIÓM@{"fl.ccpa.optout.timestamp":1568238599194,"fl.ccpa.optout":true}…-üM"m§IÓM{"fl.bundle.id":"com.yahoo.FlurryTestApp","fl.app.version":"1.0","fl.app.version.code":"1","fl.app.version.override":"Beta2","fl.build.environment":1}0üM"mªIÓM{"fl.device.properties":{"bnd.ver":"1","device.arch":"arm64","scr.height":"667","device.os.version":"12.2","scr.width":"375","device.model.1":"x86_64"}}0üM"mªIÓM>{"fl.sdk.version.code":"10.0.0","fl.background.enabled":false}3üM"m­IÓM&{"fl.country":"US","fl.language":"en"}-üM"m§IÓM°{"fl.background.session.metrics":true,"fl.apikey":"487BDYX4SWJJB2SXW5C3","fl.agent.platform":2,"fl.agent.version":256,"fl.play.service.availability":-1,"fl.agent.report.key":1}1üM"m«IÓM{"fl.app.orientation":0}¢3üM"m¬IÓM#{"fl.timezone.value":"US\/Pacific"}5üM"m¯IÓM{"fl.network.status":2}üM"mJÓMj{"fl.session.elapsed.start.time":1305692580,"fl.session.id":1568238599210,"fl.session.id.current.state":0}¤9üM"m³IÓM¦{"fl.continue.session.millis":10000,"fl.initial.time
[Flurry openPrivacyDashboard:^(BOOL success) {
if (success)
{
NSLog(@"Successfully open privacy dashboard!");
} else {
NSLog(@"Fail to open privacy dashboard!");
}
}];