public void Initialize(string mixPanelToken) { if (mMixpanel == null) { var context = Mvx.Resolve <IDroidService>().CurrentContext; mMixpanel = MixpanelAPI.GetInstance(context, mixPanelToken); } }
void SetupViewBindings() { /* PackageInfo info = PackageManager.GetPackageInfo(PackageName, global::Android.Content.PM.PackageInfoFlags.Signatures); * foreach (global::Android.Content.PM.Signature signature in info.Signatures) * { * MessageDigest md = MessageDigest.GetInstance("SHA"); * md.Update(signature.ToByteArray()); * var hash = Base64.EncodeToString(md.Digest(), Base64Flags.Default); * int j = 1; * }*/ var drawable = Resources.GetDrawable(Resource.Drawable.FacebookRoundedBackground); drawable.SetBounds(0, 0, drawable.IntrinsicWidth, drawable.IntrinsicHeight); btnFacebook.SetCompoundDrawables(drawable, drawable, drawable, drawable); btnFacebook.CompoundDrawablePadding = 24; btnFacebook.SetReadPermissions(new List <string>() { "email", "public_profile", "user_friends" }); manager = CallbackManagerFactory.Create(); btnFacebook.RegisterCallback(manager, this); #if DEBUG txtEmail.Text = "*****@*****.**"; //"*****@*****.**"; txtPassword.Text = "Password$1"; //"Darshan@1234"; #endif btnSignIn.Click += (sender, args) => { ShowProgressDialog(); MixpanelAPI mixpanel = MixpanelAPI.GetInstance(this, MIXPANEL_TOKEN); mixpanel.TimeEvent("SignIn"); mixpanel.Track("SignIn"); var apiTask = new ServiceApi().Login(txtEmail.Text, txtPassword.Text); apiTask.HandleError(this); apiTask.OnSucess(this, (response) => { HideProgressDialog(); StartActivity(typeof(MainActivity)); Finish(); }); }; btnRegister.Click += (sender, args) => { StartActivity(typeof(SignUpActivity)); }; btnForgotPassword.Click += (sender, args) => StartActivity(typeof(ForgotPasswordActivity)); }
public MixPanelStat(Context context) { try { mixpanel = MixpanelAPI.GetInstance(context, YourMixPanelId); Debug.WriteLine("Mixpanel initialized DistinctId {0}", (object)mixpanel.DistinctId); //Ex: send an event with some properties //mixpanel.Track("Coucou Android", new JSONObject(new Dictionary<string,object>{ {"key1","value1"} })); } catch(Exception e) { Debug.WriteLine ("Error in Mixpanel SDK: {0}", (object)e.ToString()); } }
public MixPanelStat(Context context) { try { mixpanel = MixpanelAPI.GetInstance(context, YourMixPanelId); Debug.WriteLine("Mixpanel initialized DistinctId {0}", (object)mixpanel.DistinctId); //Ex: send an event with some properties //mixpanel.Track("Coucou Android", new JSONObject(new Dictionary<string,object>{ {"key1","value1"} })); } catch (Exception e) { Debug.WriteLine("Error in Mixpanel SDK: {0}", (object)e.ToString()); } }