Exemple #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            mBtnSignIn  = FindViewById <Button>(Resource.Id.btn_sign_in);
            mEtEmail    = FindViewById <EditText>(Resource.Id.et_email);
            mEtPassword = FindViewById <EditText>(Resource.Id.et_password);

            mBtnSignIn.Click += SignInHandler;

            try
            {
                Leanplum.AddVariablesChangedHandler(new CustomVariablesChangedCallback(VariableChanged));
                Leanplum.Start(this);
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
Exemple #2
0
    void Start()
    {
        DontDestroyOnLoad(this.gameObject);

        SocketUtilsFactory.Utils = new SocketUtils();

        if (!string.IsNullOrEmpty(AppVersion))
        {
            Leanplum.SetAppVersion(AppVersion);
        }
        if (string.IsNullOrEmpty(AppID) || string.IsNullOrEmpty(ProductionKey) || string.IsNullOrEmpty(DevelopmentKey))
        {
            Debug.LogError("Please make sure to enter your AppID, Production Key, and " +
                           "Development Key in the Leanplum GameObject inspector before starting.");
        }

        if (Debug.isDebugBuild)
        {
            Leanplum.SetAppIdForDevelopmentMode(AppID, DevelopmentKey);
        }
        else
        {
            Leanplum.SetAppIdForProductionMode(AppID, ProductionKey);
        }

        Leanplum.Start();
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Leanplum.OnVariablesChanged(() =>
            {
                btnSignIn.SetTitle(buttonTitle.StringValue, UIControlState.Normal);

                var buttonColorValue = buttonColor.StringValue;
                switch (buttonColorValue)
                {
                case Constants.RED_COLOR:
                    btnSignIn.BackgroundColor = UIColor.Red;
                    break;

                case Constants.GREEN_COLOR:
                    btnSignIn.BackgroundColor = UIColor.Green;
                    break;

                case Constants.BLUE_COLOR:
                    btnSignIn.BackgroundColor = UIColor.Blue;
                    break;
                }
            });

            btnSignIn.TouchUpInside += SignInHandler;
        }
Exemple #4
0
    void Awake()
    {
        // Enables push notifications on iOS.
        Leanplum.RegisterForIOSRemoteNotifications();

        // Automatically tracks in-app purchases on iOS.
        // To track in-app purchases on Android,
        // use Leanplum.trackGooglePlayPurchase in your Android code when a purchase occurs.
        Leanplum.TrackIOSInAppPurchases();
    }
Exemple #5
0
    private IEnumerator UpdateVariables()
    {
        // Real apps would only update at key points in the application's user experience, of course...
        var waiter = new WaitForSeconds(5.0f);

        while (true)
        {
            yield return(waiter);

            Leanplum.ForceContentUpdate();
        }
    }
        private void InitLeanplum()
        {
            Leanplum.SetApplicationContext(this);
            LeanplumActivityHelper.EnableLifecycleCallbacks(this);

            Parser.ParseVariables(this);
            Leanplum.EnableVerboseLoggingInDevelopmentMode();
            Leanplum.SetAppIdForDevelopmentMode(Constants.LEANPLUM_APP_ID, Constants.LEANPLUM_DEV_APP_KEY);

            //Enable this for Production
            //Leanplum.SetAppIdForProductionMode(Constants.LEANPLUM_APP_ID, Constants.LEANPLUM_PROD_APP_KEY);
        }
Exemple #7
0
    void Awake()
    {
        // First, you need to setup your AndroidManifest.xml file to use push notifications.
        // See the documentation in Help > Docs > Unity > In-App & Push.
        Leanplum.SetGcmSenderId(Leanplum.LeanplumGcmSenderId);

        // Enables push notifications on iOS.
        Leanplum.RegisterForIOSRemoteNotifications();

        // Automatically tracks in-app purchases on iOS.
        // To track in-app purchases on Android,
        // use Leanplum.trackGooglePlayPurchase in your Android code when a purchase occurs.
        Leanplum.TrackIOSInAppPurchases();
    }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            Leanplum.SetDevelopmentAppId(Constants.LEANPLUM_APP_ID, Constants.LEANPLUM_DEV_APP_KEY);

            //Enable this fro production
            //Leanplum.SetProductionAppId(Constants.LEANPLUM_APP_ID, Constants.LEANPLUM_PROD_APP_KEY);

            Leanplum.Start();

            return(true);
        }
Exemple #9
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Leanplum.SetDevelopmentAppId("app_0rTalYoeicR4EfMQBDZAdBmpg1XeIwJzap7p2iBGiVI", "dev_IgFz41JDCoJq1KoDNeHm5ieBX5H3mSGOzcmq6OAhDW0");
            Leanplum.Start();

            Insights.Initialize("f9b1313070b01f3b9b850f653d30accc7c1a4139");

            TapeRecorder.StartRecording("d926a3d24630dccae275dbdd0688548f");

            Profile.EnableUpdatesOnAccessTokenChange(true);
            Settings.AppID       = "1163660970326808";
            Settings.DisplayName = "Techent";
            return(ApplicationDelegate.SharedInstance.FinishedLaunching(application, launchOptions));
        }
    void Start()
    {
        DontDestroyOnLoad(this.gameObject);

        SocketUtilsFactory.Utils = new SocketUtils();

        if (!string.IsNullOrEmpty(AppVersion))
        {
            Leanplum.SetAppVersion(AppVersion);
        }
        if (string.IsNullOrEmpty(AppID) || string.IsNullOrEmpty(ProductionKey) || string.IsNullOrEmpty(DevelopmentKey))
        {
            Debug.LogError("Please make sure to enter your AppID, Production Key, and " +
                           "Development Key in the Leanplum GameObject inspector before starting.");
        }

        if (Debug.isDebugBuild)
        {
            Leanplum.SetAppIdForDevelopmentMode(AppID, DevelopmentKey);
        }
        else
        {
            Leanplum.SetAppIdForProductionMode(AppID, ProductionKey);
        }

                #if UNITY_IPHONE
        Leanplum.RegisterForIOSRemoteNotifications();
                #elif UNITY_ANDROID
        // Registering for Push in Android - using the Built-in Sender ID
        Leanplum.SetGcmSenderId(Leanplum.LeanplumGcmSenderId);

        // This would be used if using your own sender ID.
//		Leanplum.SetGcmSenderId("123456790abcdef");

        // In this case using both sender IDs, for ex. if you want Leanplum to send notifications through Leanplum's ID
        // and your own server to send notifications through your own ID.
//		Leanplum.SetGcmSenderIds("123456790abcdef", Leanplum.LeanplumGcmSenderId);
                #endif

        Leanplum.Started += delegate(bool success) {
            Debug.Log("### Leanplum started");
        };

        Leanplum.VariablesChanged += delegate {
            Debug.Log("### Variables callback ");
        };

        Leanplum.Start();
    }
Exemple #11
0
    void Start()
    {
        welcomeMessage = Var <string> .Define("welcomeMessage", "Welcome to Leanplum!");

        Var <bool> testBoolVariable = Var <bool> .Define("testBoolVariable", true);

        DontDestroyOnLoad(this.gameObject);

        SocketUtilsFactory.Utils = new SocketUtils();

        if (!string.IsNullOrEmpty(AppVersion))
        {
            Leanplum.SetAppVersion(AppVersion);
        }
        if (string.IsNullOrEmpty(AppID) || string.IsNullOrEmpty(ProductionKey) || string.IsNullOrEmpty(DevelopmentKey))
        {
            Debug.LogError("Please make sure to enter your AppID, Production Key, and " +
                           "Development Key in the Leanplum GameObject inspector before starting.");
        }


        Leanplum.SetDeviceId("23-March-D001");
//        if (Debug.isDebugBuild)
//        {
        Leanplum.SetAppIdForDevelopmentMode(AppID, DevelopmentKey);
//        }
//        else
//        {
//            Leanplum.SetAppIdForProductionMode(AppID, ProductionKey);
//        }

                #if UNITY_IPHONE
        Leanplum.RegisterForIOSRemoteNotifications();
                #elif UNITY_ANDROID
        Leanplum.SetGcmSenderId(Leanplum.LeanplumGcmSenderId);
                #endif


        Leanplum.VariablesChanged += delegate {
            Debug.Log("Variables Changed");
            Debug.Log(welcomeMessage.Value);
            Debug.Log(testBoolVariable.Value);
        };

        Leanplum.Start();
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("PickUp"))
        {
            pickupCount++;
            other.gameObject.SetActive(false);

            // TEST CASE 02
            // Manually generate userId on each pickUp (5 users in total).
            if (Leanplum.HasStarted)
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>();
                attributes.Add("pickUp Count", pickupCount);
                Leanplum.SetUserAttributes(attributes);
                Leanplum.Track("PickUp");

                string userName = "******" + (pickupCount).ToString();
                Leanplum.SetUserId(userName);
                Leanplum.ForceContentUpdate();
            }
        }
    }
    void Start()
    {
        DontDestroyOnLoad(this.gameObject);

        SocketUtilsFactory.Utils = new SocketUtils();

        if (!string.IsNullOrEmpty(AppVersion))
        {
            Leanplum.SetAppVersion(AppVersion);
        }
        if (string.IsNullOrEmpty(AppID) || string.IsNullOrEmpty(ProductionKey) || string.IsNullOrEmpty(DevelopmentKey))
        {
            Debug.LogError("Please make sure to enter your AppID, Production Key, and " +
                           "Development Key in the Leanplum GameObject inspector before starting.");
        }

        if (Debug.isDebugBuild)
        {
            Leanplum.SetAppIdForDevelopmentMode(AppID, DevelopmentKey);
        }
        else
        {
            Leanplum.SetAppIdForProductionMode(AppID, ProductionKey);
        }

        Leanplum.Inbox.InboxChanged       += inboxChanged;
        Leanplum.Inbox.ForceContentUpdate += forceContentUpdate;

#if UNITY_EDITOR
        EditorMessageTemplates.DefineConfirm();
        EditorMessageTemplates.DefineOpenURL();
        EditorMessageTemplates.DefineGenericDefinition();
        LeanplumNative.ShouldPerformActions(true);
#endif

        Leanplum.Start();
    }
 /// <summary>
 ///     Call this when your application starts.
 ///     This will initiate a call to Leanplum's servers to get the values
 ///     of the variables used in your app.
 /// </summary>
 public override void Start(string userId, IDictionary<string, object> attributes, Leanplum.StartHandler startResponseAction)
 {
     _setGameObject(LeanplumUnityHelper.Instance.gameObject.name);
     Started += startResponseAction;
     string attributesString = attributes == null ? null : Json.Serialize(attributes);
     _start(SharedConstants.SDK_VERSION, userId, attributesString);
 }
Exemple #15
0
 private void SignInHandler(object sender, EventArgs e)
 {
     Leanplum.Track("Sign in button clicked");
 }