diff --git a/CHANGELOG.md b/CHANGELOG.md index beb4f3b3..e773da9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 The changes documented here do not include those from the original repository. -## [Version 2.0.0] -- Feat: update sound hook to unzip sound files, for both iOS and Android (https://outsystemsrd.atlassian.net/browse/RMET-2464). -- Feat: update firebase core version (https://outsystemsrd.atlassian.net/browse/RMET-2451). - ## [Version 1.2.0] ## 23-05-2023 diff --git a/hooks/android/sound/copySound.js b/hooks/android/sound/copySound.js new file mode 100644 index 00000000..f1b34aa3 --- /dev/null +++ b/hooks/android/sound/copySound.js @@ -0,0 +1,43 @@ +"use strict"; + +var path = require("path"); +var utils = require("./utilities"); + +module.exports = function(context) { + let cordovaAbove8 = utils.isCordovaAbove(context, 8); + let defer; + if (cordovaAbove8) { + defer = require("q").defer(); + } else { + defer = context.requireCordovaModule("q").defer(); + } + + let platform = context.opts.plugin.platform; + let platformConfig = utils.getPlatformConfigs(platform); + if (!platformConfig) { + utils.handleError("Invalid platform", defer); + } + + let sourceFolderPath = platformConfig.getSoundSourceFolder() + let destFolderPath = platformConfig.getSoundDestinationFolder() + + if(!utils.checkIfFolderExists(destFolderPath)) { + utils.createOrCheckIfFolderExists(destFolderPath) + } + + let files = utils.getFilesFromPath(sourceFolderPath); + if (!files) { + utils.handleError("No directory found", defer); + } + else { + let filteredFiles = files.filter(function(file){ + return file.endsWith(platformConfig.soundFileExtension) == true; + }); + + filteredFiles.forEach(function (f) { + let filePath = path.join(sourceFolderPath, f); + let destFilePath = path.join(destFolderPath, f); + utils.copyFromSourceToDestPath(defer, filePath, destFilePath); + }); + } +} diff --git a/hooks/android/sound/utilities.js b/hooks/android/sound/utilities.js new file mode 100644 index 00000000..82aee8e2 --- /dev/null +++ b/hooks/android/sound/utilities.js @@ -0,0 +1,77 @@ +"use strict" + +var path = require("path"); +var fs = require("fs"); + +var utils = require("./utils"); + +var constants = { + platforms: "platforms", + android: { + platform: "android", + wwwFolder: "assets/www", + soundFileExtension: ".wav", + getSoundDestinationFolder: function() { + return "platforms/android/app/src/main/res/raw"; + }, + getSoundSourceFolder: function() { + return "platforms/android/app/src/main/assets/www"; + } + } +}; + +function handleError(errorMessage, defer) { + console.log(errorMessage); + defer.reject(); +} + +function checkIfFolderExists(path) { + return fs.existsSync(path); +} + +function getFilesFromPath(path) { + return fs.readdirSync(path); +} + +function createOrCheckIfFolderExists(path) { + if (!fs.existsSync(path)) { + fs.mkdirSync(path); + } +} + +function getPlatformConfigs(platform) { + if (platform === constants.android.platform) { + return constants.android; + } else if (platform === constants.ios.platform) { + return constants.ios; + } +} + +function isCordovaAbove(context, version) { + let cordovaVersion = context.opts.cordova.version; + console.log(cordovaVersion); + let sp = cordovaVersion.split('.'); + return parseInt(sp[0]) >= version; +} + + +function copyFromSourceToDestPath(defer, sourcePath, destPath) { + fs.createReadStream(sourcePath).pipe(fs.createWriteStream(destPath)) + .on("close", function (err) { + defer.resolve(); + }) + .on("error", function (err) { + console.log(err); + defer.reject(); + }); +} + +module.exports = { + isCordovaAbove, + handleError, + getPlatformConfigs, + copyFromSourceToDestPath, + getFilesFromPath, + createOrCheckIfFolderExists, + checkIfFolderExists +}; \ No newline at end of file diff --git a/hooks/android/sound/utils.js b/hooks/android/sound/utils.js new file mode 100644 index 00000000..dee7bf7a --- /dev/null +++ b/hooks/android/sound/utils.js @@ -0,0 +1,7 @@ +module.exports = { + getAppName: function (context) { + let ConfigParser = context.requireCordovaModule("cordova-lib").configparser; + let config = new ConfigParser("config.xml"); + return config.name(); + } +}; \ No newline at end of file diff --git a/package.json b/package.json index c97732c7..809ed0ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.outsystems.firebase.cloudmessaging", - "version": "2.0.0", + "version": "1.2.0", "description": "Outsystems plugin for Firebase Cloud Messaging", "keywords": [ "ecosystem:cordova", @@ -14,8 +14,5 @@ "android" ] }, - "engines": [], - "dependencies": { - "adm-zip": "0.4.11" - } + "engines": [] } diff --git a/plugin.xml b/plugin.xml index 9978e50c..be867953 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + OSFirebaseCloudMessaging Outsystems plugin for Firebase Cloud Messaging OutSystems Inc @@ -7,11 +7,8 @@ - + - - - @@ -37,7 +34,6 @@ - @@ -65,6 +61,9 @@ + + + diff --git a/src/android/com/outsystems/firebase/cloudmessaging/build.gradle b/src/android/com/outsystems/firebase/cloudmessaging/build.gradle index eba5e4f1..4ffdef92 100644 --- a/src/android/com/outsystems/firebase/cloudmessaging/build.gradle +++ b/src/android/com/outsystems/firebase/cloudmessaging/build.gradle @@ -23,7 +23,7 @@ apply plugin: 'kotlin-kapt' dependencies { implementation("com.github.outsystems:oscore-android:1.2.0@aar") implementation("com.github.outsystems:oscordova-android:1.2.0@aar") - implementation("com.github.outsystems:osfirebasemessaging-android:1.1.3@aar") + implementation("com.github.outsystems:osfirebasemessaging-android:1.1.0@aar") implementation("com.github.outsystems:oslocalnotifications-android:1.0.0@aar") implementation("com.github.outsystems:osnotificationpermissions-android:0.0.4@aar") diff --git a/src/ios/OSFirebaseCloudMessaging.swift b/src/ios/OSFirebaseCloudMessaging.swift index 24982c0c..eff403f0 100644 --- a/src/ios/OSFirebaseCloudMessaging.swift +++ b/src/ios/OSFirebaseCloudMessaging.swift @@ -212,11 +212,9 @@ extension OSFirebaseCloudMessaging: FirebaseMessagingEventProtocol { switch event { case .click(type: let type): - eventName = type.description + eventName = type == .notification ? "notificationClick" : "internalRouteActionClick" case .trigger(notification: let notification): - eventName = notification.description - @unknown default: - preconditionFailure("Not supposed to get here") + eventName = notification == .silentNotification ? "silentNotification" : "defaultNotification" } self.trigger(event: eventName, data: data) diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/Info.plist b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/Info.plist index aae62b7c..09aca110 100644 --- a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/Info.plist +++ b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/Info.plist @@ -6,30 +6,30 @@ LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath OSFirebaseMessagingLib.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator LibraryIdentifier - ios-arm64_x86_64-simulator + ios-arm64 LibraryPath OSFirebaseMessagingLib.framework SupportedArchitectures arm64 - x86_64 SupportedPlatform ios - SupportedPlatformVariant - simulator CFBundlePackageType diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Info.plist b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Info.plist index 128ad409..582e6e42 100644 Binary files a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Info.plist and b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Info.plist differ diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios.swiftinterface b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios.swiftinterface index df727f90..afeea055 100644 --- a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios.swiftinterface +++ b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios.swiftinterface @@ -1,7 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// swift-compiler-version: Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12) // swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name OSFirebaseMessagingLib -// swift-module-flags-ignorable: -enable-bare-slash-regex import CoreData import FirebaseCore import FirebaseMessaging @@ -11,7 +10,6 @@ import Swift import UIKit import UserNotifications import _Concurrency -import _StringProcessing @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc(OSFCMExtraData) public class OSFCMExtraData : CoreData.NSManagedObject, Swift.Codable { public func encode(to encoder: Swift.Encoder) throws required convenience public init(from decoder: Swift.Decoder) throws @@ -60,18 +58,26 @@ public enum FirebaseMessagingErrors : Swift.Int, Foundation.CustomNSError, Found } public protocol MessagingProtocol { func getGeneralTopic() -> Swift.String + #if compiler(>=5.3) && $AsyncAwait func getToken(of type: OSFirebaseMessagingLib.OSFCMTokenType) async throws -> Swift.String #endif + + #if compiler(>=5.3) && $AsyncAwait func deleteToken() async throws #endif + + #if compiler(>=5.3) && $AsyncAwait func subscribe(toTopic topic: Swift.String) async throws #endif + + #if compiler(>=5.3) && $AsyncAwait func unsubscribe(fromTopic topic: Swift.String) async throws #endif + } public class FirebaseConfiguration { public init(fileName: Swift.String = "GoogleService-Info", bundle: Foundation.Bundle = Bundle.main) @@ -132,24 +138,37 @@ public enum FirebaseNotificationType { } } public enum OSFCMClickableType { - case notification(latestVersion: Swift.Bool) + case notification case action + public static func == (a: OSFirebaseMessagingLib.OSFCMClickableType, b: OSFirebaseMessagingLib.OSFCMClickableType) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { + get + } } public class MessagingManager : OSFirebaseMessagingLib.MessagingProtocol { public init() public func getGeneralTopic() -> Swift.String + #if compiler(>=5.3) && $AsyncAwait public func getToken(of type: OSFirebaseMessagingLib.OSFCMTokenType) async throws -> Swift.String #endif + + #if compiler(>=5.3) && $AsyncAwait public func deleteToken() async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func subscribe(toTopic topic: Swift.String) async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func unsubscribe(fromTopic topic: Swift.String) async throws #endif + @objc deinit } extension Swift.Encodable { @@ -158,9 +177,11 @@ extension Swift.Encodable { public protocol NotificationManagerProtocol { func insertNotification(notificationDict: [Swift.String : Any]) -> Swift.Result func fetchNotifications() -> Swift.Result<[OSFirebaseMessagingLib.OSFCMNotification], Swift.Error> + #if compiler(>=5.3) && $AsyncAwait func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async -> Swift.Result #endif + } @objc @_hasMissingDesignatedInitializers final public class NotificationManager : ObjectiveC.NSObject { convenience public init(coreDataManager: OSFirebaseMessagingLib.CoreDataManager = CoreDataManager()) @@ -168,39 +189,55 @@ public protocol NotificationManagerProtocol { @objc deinit } extension OSFirebaseMessagingLib.NotificationManager : OSFirebaseMessagingLib.NotificationManagerProtocol { + #if compiler(>=5.3) && $AsyncAwait final public func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async -> Swift.Result #endif + final public func insertNotification(notificationDict: [Swift.String : Any]) -> Swift.Result final public func fetchNotifications() -> Swift.Result<[OSFirebaseMessagingLib.OSFCMNotification], Swift.Error> } @objc @_hasMissingDesignatedInitializers open class FirebaseMessagingController : ObjectiveC.NSObject { convenience public init(delegate: OSFirebaseMessagingLib.FirebaseMessagingCallbackProtocol, firebaseManager: OSFirebaseMessagingLib.MessagingManager = MessagingManager(), coreDataManager: OSFirebaseMessagingLib.CoreDataManager = CoreDataManager()) public func getPendingNotifications(clearFromDatabase: Swift.Bool = false) + #if compiler(>=5.3) && $AsyncAwait public func getToken(ofType type: OSFirebaseMessagingLib.OSFCMTokenType = .fcm) async #endif + + #if compiler(>=5.3) && $AsyncAwait public func deleteToken() async #endif + + #if compiler(>=5.3) && $AsyncAwait public func subscribe(_ topic: Swift.String, token: Swift.String = "") async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func unsubscribe(fromTopic topic: Swift.String) async throws #endif + public func clearNotifications() + #if compiler(>=5.3) && $AsyncAwait public func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async #endif + public func setBadge(badge: Swift.Int) public func getBadge() + #if compiler(>=5.3) && $AsyncAwait public func registerDevice() async #endif + + #if compiler(>=5.3) && $AsyncAwait public func unregisterDevice() async #endif + @objc deinit } @_inheritsConvenienceInitializers @objc open class CoreDataManager : ObjectiveC.NSObject { @@ -269,3 +306,5 @@ extension OSFirebaseMessagingLib.FirebaseMessagingErrors : Swift.Hashable {} extension OSFirebaseMessagingLib.FirebaseMessagingErrors : Swift.RawRepresentable {} extension OSFirebaseMessagingLib.FirebaseNotificationType : Swift.Equatable {} extension OSFirebaseMessagingLib.FirebaseNotificationType : Swift.Hashable {} +extension OSFirebaseMessagingLib.OSFCMClickableType : Swift.Equatable {} +extension OSFirebaseMessagingLib.OSFCMClickableType : Swift.Hashable {} diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib index 8bdc1f9c..f8d2db12 100755 Binary files a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib and b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib differ diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Info.plist b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Info.plist index 2e6c8027..47635957 100644 Binary files a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Info.plist and b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Info.plist differ diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftinterface b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftinterface index 05e3168f..a09e6436 100644 --- a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftinterface +++ b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftinterface @@ -1,7 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// swift-compiler-version: Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12) // swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name OSFirebaseMessagingLib -// swift-module-flags-ignorable: -enable-bare-slash-regex import CoreData import FirebaseCore import FirebaseMessaging @@ -11,7 +10,6 @@ import Swift import UIKit import UserNotifications import _Concurrency -import _StringProcessing @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc(OSFCMExtraData) public class OSFCMExtraData : CoreData.NSManagedObject, Swift.Codable { public func encode(to encoder: Swift.Encoder) throws required convenience public init(from decoder: Swift.Decoder) throws @@ -60,18 +58,26 @@ public enum FirebaseMessagingErrors : Swift.Int, Foundation.CustomNSError, Found } public protocol MessagingProtocol { func getGeneralTopic() -> Swift.String + #if compiler(>=5.3) && $AsyncAwait func getToken(of type: OSFirebaseMessagingLib.OSFCMTokenType) async throws -> Swift.String #endif + + #if compiler(>=5.3) && $AsyncAwait func deleteToken() async throws #endif + + #if compiler(>=5.3) && $AsyncAwait func subscribe(toTopic topic: Swift.String) async throws #endif + + #if compiler(>=5.3) && $AsyncAwait func unsubscribe(fromTopic topic: Swift.String) async throws #endif + } public class FirebaseConfiguration { public init(fileName: Swift.String = "GoogleService-Info", bundle: Foundation.Bundle = Bundle.main) @@ -132,24 +138,37 @@ public enum FirebaseNotificationType { } } public enum OSFCMClickableType { - case notification(latestVersion: Swift.Bool) + case notification case action + public static func == (a: OSFirebaseMessagingLib.OSFCMClickableType, b: OSFirebaseMessagingLib.OSFCMClickableType) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { + get + } } public class MessagingManager : OSFirebaseMessagingLib.MessagingProtocol { public init() public func getGeneralTopic() -> Swift.String + #if compiler(>=5.3) && $AsyncAwait public func getToken(of type: OSFirebaseMessagingLib.OSFCMTokenType) async throws -> Swift.String #endif + + #if compiler(>=5.3) && $AsyncAwait public func deleteToken() async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func subscribe(toTopic topic: Swift.String) async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func unsubscribe(fromTopic topic: Swift.String) async throws #endif + @objc deinit } extension Swift.Encodable { @@ -158,9 +177,11 @@ extension Swift.Encodable { public protocol NotificationManagerProtocol { func insertNotification(notificationDict: [Swift.String : Any]) -> Swift.Result func fetchNotifications() -> Swift.Result<[OSFirebaseMessagingLib.OSFCMNotification], Swift.Error> + #if compiler(>=5.3) && $AsyncAwait func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async -> Swift.Result #endif + } @objc @_hasMissingDesignatedInitializers final public class NotificationManager : ObjectiveC.NSObject { convenience public init(coreDataManager: OSFirebaseMessagingLib.CoreDataManager = CoreDataManager()) @@ -168,39 +189,55 @@ public protocol NotificationManagerProtocol { @objc deinit } extension OSFirebaseMessagingLib.NotificationManager : OSFirebaseMessagingLib.NotificationManagerProtocol { + #if compiler(>=5.3) && $AsyncAwait final public func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async -> Swift.Result #endif + final public func insertNotification(notificationDict: [Swift.String : Any]) -> Swift.Result final public func fetchNotifications() -> Swift.Result<[OSFirebaseMessagingLib.OSFCMNotification], Swift.Error> } @objc @_hasMissingDesignatedInitializers open class FirebaseMessagingController : ObjectiveC.NSObject { convenience public init(delegate: OSFirebaseMessagingLib.FirebaseMessagingCallbackProtocol, firebaseManager: OSFirebaseMessagingLib.MessagingManager = MessagingManager(), coreDataManager: OSFirebaseMessagingLib.CoreDataManager = CoreDataManager()) public func getPendingNotifications(clearFromDatabase: Swift.Bool = false) + #if compiler(>=5.3) && $AsyncAwait public func getToken(ofType type: OSFirebaseMessagingLib.OSFCMTokenType = .fcm) async #endif + + #if compiler(>=5.3) && $AsyncAwait public func deleteToken() async #endif + + #if compiler(>=5.3) && $AsyncAwait public func subscribe(_ topic: Swift.String, token: Swift.String = "") async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func unsubscribe(fromTopic topic: Swift.String) async throws #endif + public func clearNotifications() + #if compiler(>=5.3) && $AsyncAwait public func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async #endif + public func setBadge(badge: Swift.Int) public func getBadge() + #if compiler(>=5.3) && $AsyncAwait public func registerDevice() async #endif + + #if compiler(>=5.3) && $AsyncAwait public func unregisterDevice() async #endif + @objc deinit } @_inheritsConvenienceInitializers @objc open class CoreDataManager : ObjectiveC.NSObject { @@ -269,3 +306,5 @@ extension OSFirebaseMessagingLib.FirebaseMessagingErrors : Swift.Hashable {} extension OSFirebaseMessagingLib.FirebaseMessagingErrors : Swift.RawRepresentable {} extension OSFirebaseMessagingLib.FirebaseNotificationType : Swift.Equatable {} extension OSFirebaseMessagingLib.FirebaseNotificationType : Swift.Hashable {} +extension OSFirebaseMessagingLib.OSFCMClickableType : Swift.Equatable {} +extension OSFirebaseMessagingLib.OSFCMClickableType : Swift.Hashable {} diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftinterface b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftinterface index be4ff947..42f624af 100644 --- a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +++ b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftinterface @@ -1,7 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51) +// swift-compiler-version: Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12) // swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name OSFirebaseMessagingLib -// swift-module-flags-ignorable: -enable-bare-slash-regex import CoreData import FirebaseCore import FirebaseMessaging @@ -11,7 +10,6 @@ import Swift import UIKit import UserNotifications import _Concurrency -import _StringProcessing @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc(OSFCMExtraData) public class OSFCMExtraData : CoreData.NSManagedObject, Swift.Codable { public func encode(to encoder: Swift.Encoder) throws required convenience public init(from decoder: Swift.Decoder) throws @@ -60,18 +58,26 @@ public enum FirebaseMessagingErrors : Swift.Int, Foundation.CustomNSError, Found } public protocol MessagingProtocol { func getGeneralTopic() -> Swift.String + #if compiler(>=5.3) && $AsyncAwait func getToken(of type: OSFirebaseMessagingLib.OSFCMTokenType) async throws -> Swift.String #endif + + #if compiler(>=5.3) && $AsyncAwait func deleteToken() async throws #endif + + #if compiler(>=5.3) && $AsyncAwait func subscribe(toTopic topic: Swift.String) async throws #endif + + #if compiler(>=5.3) && $AsyncAwait func unsubscribe(fromTopic topic: Swift.String) async throws #endif + } public class FirebaseConfiguration { public init(fileName: Swift.String = "GoogleService-Info", bundle: Foundation.Bundle = Bundle.main) @@ -132,24 +138,37 @@ public enum FirebaseNotificationType { } } public enum OSFCMClickableType { - case notification(latestVersion: Swift.Bool) + case notification case action + public static func == (a: OSFirebaseMessagingLib.OSFCMClickableType, b: OSFirebaseMessagingLib.OSFCMClickableType) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { + get + } } public class MessagingManager : OSFirebaseMessagingLib.MessagingProtocol { public init() public func getGeneralTopic() -> Swift.String + #if compiler(>=5.3) && $AsyncAwait public func getToken(of type: OSFirebaseMessagingLib.OSFCMTokenType) async throws -> Swift.String #endif + + #if compiler(>=5.3) && $AsyncAwait public func deleteToken() async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func subscribe(toTopic topic: Swift.String) async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func unsubscribe(fromTopic topic: Swift.String) async throws #endif + @objc deinit } extension Swift.Encodable { @@ -158,9 +177,11 @@ extension Swift.Encodable { public protocol NotificationManagerProtocol { func insertNotification(notificationDict: [Swift.String : Any]) -> Swift.Result func fetchNotifications() -> Swift.Result<[OSFirebaseMessagingLib.OSFCMNotification], Swift.Error> + #if compiler(>=5.3) && $AsyncAwait func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async -> Swift.Result #endif + } @objc @_hasMissingDesignatedInitializers final public class NotificationManager : ObjectiveC.NSObject { convenience public init(coreDataManager: OSFirebaseMessagingLib.CoreDataManager = CoreDataManager()) @@ -168,39 +189,55 @@ public protocol NotificationManagerProtocol { @objc deinit } extension OSFirebaseMessagingLib.NotificationManager : OSFirebaseMessagingLib.NotificationManagerProtocol { + #if compiler(>=5.3) && $AsyncAwait final public func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async -> Swift.Result #endif + final public func insertNotification(notificationDict: [Swift.String : Any]) -> Swift.Result final public func fetchNotifications() -> Swift.Result<[OSFirebaseMessagingLib.OSFCMNotification], Swift.Error> } @objc @_hasMissingDesignatedInitializers open class FirebaseMessagingController : ObjectiveC.NSObject { convenience public init(delegate: OSFirebaseMessagingLib.FirebaseMessagingCallbackProtocol, firebaseManager: OSFirebaseMessagingLib.MessagingManager = MessagingManager(), coreDataManager: OSFirebaseMessagingLib.CoreDataManager = CoreDataManager()) public func getPendingNotifications(clearFromDatabase: Swift.Bool = false) + #if compiler(>=5.3) && $AsyncAwait public func getToken(ofType type: OSFirebaseMessagingLib.OSFCMTokenType = .fcm) async #endif + + #if compiler(>=5.3) && $AsyncAwait public func deleteToken() async #endif + + #if compiler(>=5.3) && $AsyncAwait public func subscribe(_ topic: Swift.String, token: Swift.String = "") async throws #endif + + #if compiler(>=5.3) && $AsyncAwait public func unsubscribe(fromTopic topic: Swift.String) async throws #endif + public func clearNotifications() + #if compiler(>=5.3) && $AsyncAwait public func sendLocalNotification(title: Swift.String, body: Swift.String, badge: Swift.Int) async #endif + public func setBadge(badge: Swift.Int) public func getBadge() + #if compiler(>=5.3) && $AsyncAwait public func registerDevice() async #endif + + #if compiler(>=5.3) && $AsyncAwait public func unregisterDevice() async #endif + @objc deinit } @_inheritsConvenienceInitializers @objc open class CoreDataManager : ObjectiveC.NSObject { @@ -269,3 +306,5 @@ extension OSFirebaseMessagingLib.FirebaseMessagingErrors : Swift.Hashable {} extension OSFirebaseMessagingLib.FirebaseMessagingErrors : Swift.RawRepresentable {} extension OSFirebaseMessagingLib.FirebaseNotificationType : Swift.Equatable {} extension OSFirebaseMessagingLib.FirebaseNotificationType : Swift.Hashable {} +extension OSFirebaseMessagingLib.OSFCMClickableType : Swift.Equatable {} +extension OSFirebaseMessagingLib.OSFCMClickableType : Swift.Hashable {} diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib index 2fc4aed2..bc74591e 100755 Binary files a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib and b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/OSFirebaseMessagingLib differ diff --git a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/_CodeSignature/CodeResources b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/_CodeSignature/CodeResources index 7b85387a..b4a21094 100644 --- a/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/_CodeSignature/CodeResources +++ b/src/ios/frameworks/OSFirebaseMessagingLib.xcframework/ios-arm64_x86_64-simulator/OSFirebaseMessagingLib.framework/_CodeSignature/CodeResources @@ -6,51 +6,35 @@ Headers/OSFirebaseMessagingLib-Swift.h - fH3JPwef/vMRKvQlr+7ZH3eykp0= + AFJMO1MVgEBDBExAy6EMZUmtlCY= Info.plist - AvTQnF9OrzZFoCts4GDWx0poCvk= - - Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.abi.json - - XuLhjwjDbSiJQfA9ZwBCRk/a10w= - - Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface - - BBSQKGLt/+z9u9PVfIgaRRkTFpQ= + gCNtgKo1Z0e70mZF0N/Uns6MyB4= Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftdoc - GshJHeHVDcGv1L9jItLjyYIhaEE= + yD05JIg7IvshFI2gdrSlgfCys28= Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftinterface - BBSQKGLt/+z9u9PVfIgaRRkTFpQ= + hZ93QmK4B6u8YNvxdj3zGN8IOWE= Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftmodule - K9K5UnnHqm1ZsfScekwRDVKMHRE= - - Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.abi.json - - XuLhjwjDbSiJQfA9ZwBCRk/a10w= - - Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface - - AnVrp4YXwVQS4LPZl3lIBF/Lsw0= + RN/nqgmffnj6vkk3evA2DK8zaIg= Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftdoc - 7Ne6Hs58K2oU3S72YfmJZgjlTyY= + TP3Ky76PnNed5p/pVLBNdmqsUHA= Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftinterface - AnVrp4YXwVQS4LPZl3lIBF/Lsw0= + 9vUu5TFvwh7X9XUEtTH5oq6KMCo= Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftmodule - YGWlAD+4hM7edzrj5ebwIJzHo54= + m5+Uzr227oG0uPp6uDRythmqsmQ= Modules/module.modulemap @@ -58,7 +42,7 @@ NotificationsModel.momd/NotificationsModel 2.mom - qOrypAsk2AM3E2SRs8+IMnvk/20= + bUXR1zuKj7MSNklidAmQT74BnVI= NotificationsModel.momd/NotificationsModel 2.omo @@ -66,7 +50,7 @@ NotificationsModel.momd/NotificationsModel.mom - OPGHaxQ5hGTwj1O6KFxscY3nh34= + A8DLh4FYRMLg0YvgVfXAKA6cklA= NotificationsModel.momd/VersionInfo.plist @@ -79,77 +63,49 @@ hash2 - vpEEyjV965BZeP2hTt/uAObdLK5ILDPs7qm5YOttDVM= - - - Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.abi.json - - hash2 - - dVmNZofavEc7yeRxTxMEkaYUWbPj25RMYdy1SW+lFS0= - - - Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface - - hash2 - - CQbfS3m/y82tpPOn11WItTddMTSiSIuXWmKso48Y/xo= + w0zYe2l4ETbmKH+U3VdYpvCwzt0X9/4KPaTMfCLNUgg= Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftdoc hash2 - DkHgA31cJEJhursJFIW+UyiJ5YmmR6qV9SQBGtkKRys= + AuHgZsAGI2tKV1q9ib2tVhNfJ07FqOBQBGMILZ9qk9Q= Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftinterface hash2 - CQbfS3m/y82tpPOn11WItTddMTSiSIuXWmKso48Y/xo= + 1r3q2rrgJQ7VVSjG1tV94UoKsAl0pC9gvIO0Pavvh+c= Modules/OSFirebaseMessagingLib.swiftmodule/arm64-apple-ios-simulator.swiftmodule hash2 - fWFpr41W6kUdLZ+wbseOZGLcA6eODTEhYXNdiuVotkg= - - - Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.abi.json - - hash2 - - dVmNZofavEc7yeRxTxMEkaYUWbPj25RMYdy1SW+lFS0= - - - Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface - - hash2 - - OT0Z7FGk5asl9RyUpB3xNKYwi9ZSCpErR46InTUVJ1M= + rM23EStUdaErvX985QzHhF8D+Rn99gKnc+tDTsfi6J4= Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftdoc hash2 - TlpPJIz0TjL4Lr4grkV1LmEzeutx66xvQvA/T7pBO7g= + xRVQAecBgsLDNu4yEfYm+z83wISTdXcKPSkiDKWGpYc= Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftinterface hash2 - OT0Z7FGk5asl9RyUpB3xNKYwi9ZSCpErR46InTUVJ1M= + mRMap2uvPQsbAs36vbDMnnaQwUPuTFqaiOA637JFbyc= Modules/OSFirebaseMessagingLib.swiftmodule/x86_64-apple-ios-simulator.swiftmodule hash2 - yeWh5v677L/dhOp+CWFWYfKcSZcoLkQ1BAidMx8TPAw= + 8UEFE3Lg4M/Xct2s+6ze1BhMO7sMUZdsnxOnrQ7niBU= Modules/module.modulemap @@ -163,7 +119,7 @@ hash2 - eXqZtHmvroqn9nTA8NGcLzO0hnRzqq/AwGL8IOJaYqA= + 4sAIvW4xwXmLKiw8GIoqovfF1/cSsGBhi9N8eGWhKo0= NotificationsModel.momd/NotificationsModel 2.omo @@ -177,7 +133,7 @@ hash2 - ItToCGKo4GuIu7hTa58YxozcTsf4NouPMSg25VKF6i4= + 5+o6uXENIybUVwlUllZL6t1fX6xbPR358c2rIOo1KeI= NotificationsModel.momd/VersionInfo.plist