protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); var stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"Mixpanel version: {MixpanelAPI.Version}"); var mixpanel = MixpanelAPI.GetInstance(this, "YOUR_TOKEN"); stringBuilder.AppendLine("Device info:"); foreach (var deviceInfo in mixpanel.DeviceInfo) { stringBuilder.AppendLine($" - {deviceInfo.Key}: {deviceInfo.Value}"); } var textView = FindViewById <TextView>(Resource.Id.textViewBox); textView.Text = stringBuilder.ToString(); }
public override void OnCreate() { base.OnCreate(); RegisterActivityLifecycleCallbacks(this); FacebookSdk.ApplicationId = ConstantsHelper.FB_ApplicationID; //"469763806538563"; FacebookSdk.ApplicationName = ConstantsHelper.AppName; //"FanWord"; FacebookSdk.SdkInitialize(this); MixpanelAPI mixpanel = MixpanelAPI.GetInstance(this, MIXPANEL_TOKEN); CrossPushNotifications.Current.Configure(ServiceApiBase.HubName, ServiceApiBase.AzureConnectionString, new[] { "fanword" }, Resource.Drawable.AppIcon); ////due to blank notification the code is commented //CrossPushNotifications.Current.PushNotificationClicked += (sender, e) => //{ // Navigator.HandleNotificationTap(e.MetaData, e.Title, e.Message); //}; //CrossPushNotifications.Current.PushNotificationRecieved += (sender, item) => //{ // var lastId = CrossSettings.Current.GetValueOrDefault("LastNotificationId", ""); // if (lastId == item.Id) // return; // CrossSettings.Current.AddOrUpdateValue("LastNotificationId", item.Id); // CrossPushNotifications.Current.ShowLocalNotification(item); //}; }
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()); } }