Hi guys, so I have already create APN certificates for my sandbox environment, and test in sandbox app environment.
And then I have configure my code:
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
print("APNs token retrieved: \(deviceToken)")
Messaging.messaging().apnsToken = deviceToken
let deviceTokenString = deviceToken.map { String(format: "%02x", $0) }.joined()
Task.init(operation: {
do {
let success = try await AmityUIKitManager.client.registerDeviceForPushNotification(withDeviceToken: deviceTokenString)
print("Register Device Amity for Notif: SUCCEED? \(success)")
} catch {
// An error occurred while trying to register the device for push notifications
}
})
}
Any suggestion?