Exception: Failed to register the device for remote notifications

I have been trying to add push notifications to both iOS and android using the remote notification package from unity.

I have followed the documentation perfectly and been over it multiple times. The notifications work as expected with android but when testing it with iOS, I seem to be getting an error rather than the notification token being printed to the console.

I have done some research and found some old threads which list some code to put in unity to do with APS entitlement but this code is deprecated and throws an error now.

Any help would be appreciated, I’m using unity 2022.2.12f1 and building for min iOS 12

Same issue with iOS,

Failed to register the device for remote notifications. at Unity.Services.PushNotifications.PushNotificationsServiceInstance.RegisterForPushNotificationsAsync

Using
Unity: 2021.3.31f1
Push Notifications: Version 4.0.0-pre.1
building for min iOS 12

Same issue for me. I have tried for both production and development builds. Also, I am not getting the green tick on the UGS dashboard where I add the keys for IOS.

9470063--1330877--upload_2023-11-14_11-50-46.png