Skip to content

release 7.2.5 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 7.2.5

* Fixed a bug due to which the request for permission to send push notifications did not appear on IOS.

# 7.2.4

* Fixed a bug that did not allow you to remove a subscription to a RT event in Android.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Follow the steps below to get started with Backendless Flutter SDK:
To use this plugin in your Flutter project, add `backendless_sdk` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/):
```dart
dependencies:
backendless_sdk: ^7.2.4
backendless_sdk: ^7.2.5
```
#### STEP 2. Import the Backendless SDK:
Add the following import to your Dart code
Expand Down
28 changes: 24 additions & 4 deletions ios/Classes/CallHandlers/MessagingCallHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import Flutter
import Backendless

class MessagingCallHandler: FlutterCallHandlerProtocol {
class MessagingCallHandler: NSObject, FlutterCallHandlerProtocol, UNUserNotificationCenterDelegate {

// MARK: -
// MARK: - Constants
Expand Down Expand Up @@ -317,11 +317,31 @@ class MessagingCallHandler: FlutterCallHandlerProtocol {
registerDeviceArgs[Args.channels] = arguments[Args.channels]
registerDeviceArgs[Args.expiration] = arguments[Args.expiration]

DispatchQueue.main.async { [weak self] in
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
if let error = error {
print(":red_circle: APNS error: \(error.localizedDescription)")
}
else {
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
self.didAskRegistration = true
self.registerDeviceFinished = result
}
}
}
} else {
let settings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
UIApplication.shared.registerUserNotificationSettings(settings)
UIApplication.shared.registerForRemoteNotifications()
self?.didAskRegistration = true
self?.registerDeviceFinished = result
}
// DispatchQueue.main.async { [weak self] in
//
// UIApplication.shared.registerForRemoteNotifications()
// self?.didAskRegistration = true
// self?.registerDeviceFinished = result
}

func didRegisterForRemotePushNotifications(withToken deviceToken: Data) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: backendless_sdk
description: Flutter plugin for Backendless SDK. It provides access to the Backendless services that enable the server-side functionality for developing and running mobile and desktop apps.
version: 7.2.4
version: 7.2.5
homepage: https://backendless.com

environment:
Expand Down