示例#1
0
        public override void OnTokenRefresh()
        {
            var refreshedToken = FirebaseInstanceId.Instance.Token;

            SendRegistrationToServer(refreshedToken);
            ChatClientFactory.GetChatClient().SetFirebaseToken(refreshedToken);
        }
示例#2
0
        void SendRegistrationToServer(string token)
        {
            hub = new NotificationHub(Constants.NotificationHubName,
                                      Constants.ListenConnectionString, this);

            var tags = new List <string>()
            {
                "android"
            };
            var regID = hub.Register(token, tags.ToArray()).RegistrationId;

            ChatClientFactory.GetChatClient().SetNotificationRegistrationId(regID);
        }