How to get device token in iOS 13 with Xamarin?

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

Our RegisteredForRemoteNotifications code broke because the token was retrieved with:

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


        
7条回答
  •  自闭症患者
    2020-12-11 04:02

    There is a field in deviceToken object called DebugDescription. Format that field and you will get the token.

    var myToken = deviceToken.DebugDescription.Replace("<", string.Empty).Replace(">", string.Empty).Replace(" ", string.Empty).ToUpper();
    

提交回复
热议问题