How to get device token in iOS 13 with Xamarin?

前端 未结 7 1956
悲&欢浪女
悲&欢浪女 2020-12-11 03:31

Our RegisteredForRemoteNotifications code broke because the token was retrieved with:

deviceToken.ToString().Trim(\'<\').Trim(\'>\').Replace(\" \", \"\         


        
7条回答
  •  -上瘾入骨i
    2020-12-11 04:13

    You can use a more simplified version:

    var bytes = deviceToken.ToArray();
    var token = BitConverter.ToString(bytes).Replace("-", "");
    

提交回复
热议问题