Exemple #1
0
        private void RemoveSessionPartnerParameter()
        {
            if (!Command.ContainsParameter("key"))
            {
                return;
            }

            var keys = Command.Parameters["key"];

            for (var i = 0; i < keys.Count; i = i + 1)
            {
                var key = keys[i];
                Adjust.RemoveSessionPartnerParameter(key);
            }
        }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Configure AdjustDelegate object.
            adjustDelegate = new AdjustDelegateXamarin();

            // Configure adjust.
            string yourAppToken = "2fm9gkqubvpc";
            string environment  = AdjustConfig.EnvironmentSandbox;

            var config = ADJConfig.ConfigWithAppToken(yourAppToken, environment);

            // var config = ADJConfig.ConfigWithAppToken(yourAppToken, environment, true);

            // Change the log level.
            config.LogLevel = ADJLogLevel.Verbose;
            // config.LogLevel = ADJLogLevel.Suppress;

            // Enable event buffering.
            // config.EventBufferingEnabled = true;

            // Enable background tracking.
            config.SendInBackground = true;

            // Set default tracker.
            // config.DefaultTracker = "{TrackerToken}";

            // Set an attribution delegate.
            config.Delegate = adjustDelegate;

            // Add session callback parameters.
            Adjust.AddSessionCallbackParameter("scp_foo", "scp_bar");
            Adjust.AddSessionCallbackParameter("scp_key", "scp_value");

            // Remove session callback parameters.
            Adjust.RemoveSessionCallbackParameter("scp_foo");
            Adjust.RemoveSessionCallbackParameter("scp_key");

            // Add session partner parameters.
            Adjust.AddSessionPartnerParameter("spp_a", "spp_b");
            Adjust.AddSessionPartnerParameter("spp_x", "spp_y");

            // Remove session partner parameters.
            Adjust.RemoveSessionPartnerParameter("scp_a");
            Adjust.RemoveSessionPartnerParameter("scp_x");

            // Clear all session callback parameters.
            // Adjust.ResetSessionCallbackParameters();

            // Clear all session partner parameters.
            // Adjust.ResetSessionPartnerParameters();

            Adjust.AppDidLaunch(config);

            // Put the SDK in offline mode.
            // Adjust.SetOfflineMode(true);

            // Disable the SDK.
            // Adjust.SetEnabled(false);

            // Send push notification token once you have obtained it or when it changes the value.
            // NSData pushNotificationToken = NSData.FromString("Token");
            // Adjust.SetDeviceToken(pushNotificationToken);

            return(true);
        }
        public override void OnCreate()
        {
            base.OnCreate();

            // Configure Adjust.
            const String appToken    = "2fm9gkqubvpc";
            const String environment = AdjustConfig.EnvironmentSandbox;
            AdjustConfig config      = new AdjustConfig(this, appToken, environment);

            // Change the log level.
            config.SetLogLevel(LogLevel.Verbose);

            // Enable event buffering.
            // config.SetEventBufferingEnabled((Java.Lang.Boolean)true);

            // Enable background tracking.
            config.SetSendInBackground(true);

            // Set default tracker.
            // config.SetDefaultTracker("{YourDefaultTracker}");

            // Set attribution callback.
            config.SetOnAttributionChangedListener(this);

            // Set session callbacks.
            config.SetOnSessionTrackingFailedListener(this);
            config.SetOnSessionTrackingSucceededListener(this);

            // Set event callbacks.
            config.SetOnEventTrackingFailedListener(this);
            config.SetOnEventTrackingSucceededListener(this);

            // Set deferred deeplink callback.
            config.SetOnDeeplinkResponseListener(this);

            // Add session callback parameters.
            Adjust.AddSessionCallbackParameter("scp_foo", "scp_bar");
            Adjust.AddSessionCallbackParameter("scp_key", "scp_value");

            // Remove session callback parameters.
            Adjust.RemoveSessionCallbackParameter("scp_foo");
            Adjust.RemoveSessionCallbackParameter("scp_key");

            // Add session partner parameters.
            Adjust.AddSessionPartnerParameter("spp_a", "spp_b");
            Adjust.AddSessionPartnerParameter("spp_x", "spp_y");

            // Remove session partner parameters.
            Adjust.RemoveSessionPartnerParameter("scp_a");
            Adjust.RemoveSessionPartnerParameter("scp_x");

            // Clear all session callback parameters.
            Adjust.ResetSessionCallbackParameters();

            // Clear all session partner parameters.
            Adjust.ResetSessionPartnerParameters();

            Adjust.OnCreate(config);

            // Put the SDK in offline mode.
            // Adjust.SetOfflineMode(true);

            // Disable the SDK.
            // Adjust.Enabled = false;

            // Send push notification token once you have obtained it or when it changes the value.
            Adjust.SetPushToken("YourPushNotificationToken");

            RegisterActivityLifecycleCallbacks(new ActivityLifecycleCallbacks());
        }
        public static void RemoveSessionPartnerParameter(string key)
        {
#if NETFX_CORE
            Adjust.RemoveSessionPartnerParameter(key);
#endif
        }