Esempio n. 1
0
        public async void BaiduBinded(object sender, BindedEventArgs e)
        {
            //PushManager.SetTags(Xamarin.Forms.Forms.Context, userMarks);

            if (hub == null)
            {
                hub = new WindowsAzure.Messaging.NotificationHub(ConfigurationSettings.HUB_NAME, ConfigurationSettings.HUB_CONNEXTION_STRING, Xamarin.Forms.Forms.Context);
            }
            await Task.Run(() =>
            {
                using (var re = hub.RegisterBaidu(e.UserID, e.ChannelID, userMarks))
                {
                    if (!string.IsNullOrEmpty(re.RegistrationId))
                    {
                        isRegisted = true;
                    }
                    else
                    {
                        isRegisted = false;
                    }
                }
            });

            NotifyMessageReceiver.Binded -= BaiduBinded;
        }
Esempio n. 2
0
        public override void OnBind(Context p0, int p1, string p2, string p3, string p4, string p5)
        {
#if DEBUG
            System.Diagnostics.Debug.WriteLine($"OnBind {p1} {p2} {p3}");
#endif



            BindedEventArgs args = new BindedEventArgs {
                UserID = p3, ChannelID = p4
            };
            Binded?.Invoke(this, args);
        }