Are you looking for help?
Hi everyone. Currently, I’m configuring notifications, so far I have registered devices without no problems, but when I try to send notifications, devices are not receiving them.
Backendless Version (3.x / 5.x, Online / Managed / Pro )
v6.5.4
Client SDK (REST / Android / Objective-C / Swift / JS )
SwiftSDK
Current iOS app version: 15.0
Application ID
53659D05-8CE2-3A56-FF51-4838E888AF00
Expected Behavior
- Send notifications from BackendlessUI or SDK methods
- Notification appears in the registered device in the specified channel (default)
Actual Behavior
- I try to send a notification
- Registered devices do not receive notification
Code for registration
extension AppDelegate: UNUserNotificationCenterDelegate {
func setUpEnableUserNotifications() {
let options: UNAuthorizationOptions = [.alert, .sound, .badge]
unUserNotificationCenterCurrent.delegate = self
unUserNotificationCenterCurrent.requestAuthorization(options: options) { success, _ in guard success else { return } }
UIApplication.shared.registerForRemoteNotifications()
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let responseHandler = { (response: String) -> Void in print(response)}
let errorHandler = { (fault: Fault) -> Void in
assertionFailure("An error occurred while trying to save changes to the server - Error code: \(fault.message)")
}
Backendless.shared.messaging.registerDevice(deviceToken: deviceToken, responseHandler: responseHandler, errorHandler: errorHandler)
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("Device registration failed: \(error.localizedDescription)")
}
}