public void FetchVariable() { KRTVariables.FetchWithCompletion(delegate(bool isSuccess) { System.Diagnostics.Debug.WriteLine("FetchWithCompletion: " + isSuccess); KRTVariable variable = KRTVariables.VariableForKey("string_var1"); KRTVariable unknownVariable = KRTVariables.VariableForKey("unknown_variable"); System.Diagnostics.Debug.WriteLine("Unknown Variable: " + unknownVariable.StringWithDefaultValue("default value")); KRTVariable arrayVariable = KRTVariables.VariableForKey("array"); var array = arrayVariable.Array; System.Diagnostics.Debug.WriteLine("Array variable: " + string.Join(",", array)); KRTVariable objectVariable = KRTVariables.VariableForKey("object"); var dictionary = objectVariable.Dictionary; System.Diagnostics.Debug.WriteLine("Dictionary variable: " + dictionary.ToString()); KRTVariable[] variables = new KRTVariable[] { variable }; KRTVariables.TrackVariableOpen(variables, new NSDictionary("test-key", "test-value")); KRTVariables.TrackVariableClick(variables, new NSDictionary("test-key", "test-value")); var nulDict = new NSDictionary("test-key", "test-value"); nulDict = null; KRTVariables.TrackVariableOpen(variables, nulDict); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); //For iam delegate testing iamDelegate = new SampleInAppMessagingDelegate(); KRTInAppMessaging.Shared.Delegate = iamDelegate; //For idfa testing idfaDelegate = new SampleIDFADelegate(); var configuration = new KRTConfiguration(); configuration.IdfaDelegate = this.idfaDelegate; configuration.IsDryRun = false; KRTApp.SetLogLevel(KRTLogLevel.Verbose); KRTApp.SetupWithAppKey("APP_KEY", configuration); KRTInAppMessaging.Configure(); KRTNotification.Configure(); KRTVariables.Configure(); KRTTracker.View("chat", "chat"); System.Diagnostics.Debug.WriteLine("AdvertisingIdentifierString: " + idfaDelegate.AdvertisingIdentifierString); System.Diagnostics.Debug.WriteLine("VisitorId: " + KRTApp.VisitorId); System.Diagnostics.Debug.WriteLine("IsOptOut: " + KRTApp.IsOptOut); string[] btnTitles = new string[] { "Identify", "View", "Track", "ViewForScene", "Push", "UserSync", "OptOut", "OptIn", "RenewVisitorId", "IsPresenting", "Dismiss", "Suppress", "Unsuppress", "Fetch Variables" }; AddButtons(btnTitles); }