Azure / AzureNotificationHubs

Azure Notification Hubs
MIT License
2 stars 5 forks source link

iOS 13 Notification Issues #10

Open JeffHoffelner opened 4 years ago

JeffHoffelner commented 4 years ago

Have not been able to receive notifications on iOS 13. I have been using the code below to fix the issue but I am told by Xamarin Notification Hub support that it is not the correct code and to contact you to determine the correct code:

    public async override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
    {
        if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
        {

            //iOS 13 or greater

            byte[] bytes = deviceToken.ToArray<byte>();
            string[] hexArray = bytes.Select(b => b.ToString("x2")).ToArray();
            string strFinal = string.Join(string.Empty, hexArray);

            JanitorsApp.DeviceSpecificValues.gobjdeviceToken = strFinal;
        }
        else
        {

            //ios less than 13

            JanitorsApp.DeviceSpecificValues.gobjdeviceToken = deviceToken;
        }
    }
mpodwysocki commented 4 years ago

@JeffHoffelner I'm unclear what you are trying to do here with getting the device token and what this code is trying to accomplish. Can you provide the following?

  1. What IDE are you using?
  2. What iOS version are you using?
  3. Are you using an SDK from Azure Notification Hubs? If so, which version?
  4. Is this specific to iOS 13 or does it apply to earlier versions?