Skip to content

Commit

Permalink
Prepare Release of Version 1.2.0 (#66)
Browse files Browse the repository at this point in the history
* chore: Add Unreleased Tag to CHANGELOG

* RMET-2036 :: Updated jcenter to mavenCentral (#40)

* RMET-2045 - Firebase Cloud Messaging Plugin - Use fixed versions (#39)

* fix: use fixed versions

References: https://outsystemsrd.atlassian.net/browse/RMET-2045

* chore: update changelog

* refactor: remove jcenter

References: https://outsystemsrd.atlassian.net/browse/RMET-2036

* chore: update changelog

* feat: iOS | Add Get APNs Token (#41)

Update iOS lib files in order to include the new Get APNs Token method.
Delegate the app's `application:didRegisterForRemoteNotificationWithDeviceToken:` to Cloud Messaging's delegate extension.

* RMET-2114 FB Cloud Messaging - Android - Fix click notification without deeplink (#42)

* tentativefix: added pending intent to every notification

* chore: update lib for testing

References: https://outsystemsrd.atlassian.net/browse/RMET-2114

* chore: update lib

* feat: update messaging library to version 1.0.1

References: https://outsystemsrd.atlassian.net/browse/RMET-2114

* refactor: remove new line

* chore: update changelog

Co-authored-by: Nelson Lopes Silva <5671236+nflsilva@users.noreply.github.com>

* Fix: Silent Notifications issue (#44)

The method `application:didReceiveRemoteNotification:fetchCompletionHandler:` is not being triggered by apps that use the plugin, so it's not possible to trigger silent notifications.
The same fix was applied for the `application:didRegisterForRemoteNotificationsWithDeviceToken:` as the method suffered from the same issue.

* fix: Replace iOS code for library (#45)

Remove the iOS code and replace it for the xcframework.

* RMET-2312 :: Empty silent notification crash fix (#46)

* chrore: bump patch version to 1.0.6. Changed lib version to new patch vesion 1.0.2

* chrore: bump patch version to 1.0.6

* feat: iOS | Use Local Notifications library (#48)

Update the iOS xcframework that already includes the Local Notifications library.
Add the local notifications library.
Remove unnecessary files introduced on conflict fix.

* RMET-2310 FB Cloud Messaging - Update FCM lib and add Local Notifications Lib (#49)

* feat: update osfirebasemessaging-android

References: https://outsystemsrd.atlassian.net/browse/RMET-2310

* fix: include local notifications lib in build.gradle

* chore: update changelog

* feat: React to "Push" Data Message (#51)

Update the OSFirebaseMessagingLib and OSLocalNotificationsLib in order to allow the trigger of Local Notifications when a Data Message with a Notification structure is received.

* RMET-2378 Cloud Messaging Plugin - Hook for sound files (#52)

* feat: first version of hook to copy sound files

References: https://outsystemsrd.atlassian.net/browse/RMET-2378

* chore: save current progress

* refactor: remove comment

* refactor: remove unnecessary code from hook

References: https://outsystemsrd.atlassian.net/browse/RMET-2378

* refactor: remove unnecessary functions

References: https://outsystemsrd.atlassian.net/browse/RMET-2378

* chore: update libs

References: https://outsystemsrd.atlassian.net/browse/RMET-2378

* chore: update changelog

* refactor: replace var with let

* refactor: replace var with let

* refactor: use let instead of var

* chore: update lib version

* RMET-2421 FCM Plugin  - Fix click notification crash (#53)

* chore: update lib version

* chore: update lib version

* chore: update lib

* chore: update changelog

* chore: update lib version

* chore: update lib versions

* feat: Add Actions to "Push" Data Messages (#55)

Update the OSFirebaseMessagingLib and OSLocalNotificationsLib to add reaction to a Push Data Message with Actions configured.

Co-authored-by: Marta Carlos <marta.carlos@outsystems.com>

* RMET-2387 FCM Plugin - Android - Add action buttons (#57)

* chore: update libs

* chore: update libs

* feat: handle action button clicks

References: https://outsystemsrd.atlassian.net/browse/RMET-2387

* chore: update changelog

* feat: iOS | Click on Notification Action (#56)

Update the OSFirebaseMessagingLib and OSLocalNotificationsLib to add reaction to a Notification Action click.

* Feat: iOS | React to the Internal Route Event (#58)

Update both OSFirebaseMessagingLib and OSLocalNotificationsLib to the latest versions.
Add "internalRouteActionClick" to the list of possible events can be triggered.

* RMET-2215 FCM Plugin - Fix on hook for sound files (#61)

* test: test build without hook

* test: include hook

* test: change hook name

* test: remove defer.promise

* chore: update changelog

* Feat: iOS | React to the Web Route Event (#60)

Update OSLocalNotificationLib.xcframework and OSFirebaseMessagingLib.xcframework to the latest versions so that it can deal with Actions defined with a web route event.

* current implementation (#62)

Add to plugin.xml a new hook that reads Extensibility Configurations' APPLICATION_SCHEMES preference value, and adds it to Info.plist's LSApplicationQueriesSchemes property.

* RMET-2391 FCM Plugin - Notification action buttons (#64)

* chore: update lib versions

* chore: update lib version

* chore: update lib version

* chore: update gradle dependency

* feat: iOS | React to the App Route Event (#63)

Update OSLocalNotificationLib.xcframework and OSFirebaseMessagingLib.xcframework to the latest versions so that it can deal with Actions defined with a app route event.

* RMET-2555 :: Update error codes (#65)

* feat: update error codes

* chore: update changelog

* chore: Set Tag and Update iOS libraries

Set tag on the `CHANGELOG.md` file.
Update `OSFirebaseMessagingLib.xcframework` and `OSLocalNotificationsLib.xcframework` to the latest versions.

* chore: set missing Tags

Set Tags to `package.json` and `plugin.xml` files.

* chore: use correct OSFirebaseMessagingLib.xcframework

* chore: update android libraries

---------

Co-authored-by: Alexandre Jacinto <alexandre.jacinto@outsystems.com>
Co-authored-by: Nelson Lopes Silva <5671236+nflsilva@users.noreply.github.com>
Co-authored-by: Marta Carlos <marta.carlos@outsystems.com>
Co-authored-by: Marta Carlos <101343976+OS-martacarlos@users.noreply.github.com>
  • Loading branch information
5 people committed Apr 12, 2024
1 parent cf0ba59 commit cef9a21
Show file tree
Hide file tree
Showing 17 changed files with 290 additions and 100 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions hooks/android/sound/copySound.js
Original file line number Diff line number Diff line change
@@ -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);
});
}
}
77 changes: 77 additions & 0 deletions hooks/android/sound/utilities.js
Original file line number Diff line number Diff line change
@@ -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
};
7 changes: 7 additions & 0 deletions hooks/android/sound/utils.js
Original file line number Diff line number Diff line change
@@ -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();
}
};
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -14,8 +14,5 @@
"android"
]
},
"engines": [],
"dependencies": {
"adm-zip": "0.4.11"
}
"engines": []
}
11 changes: 5 additions & 6 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<plugin id="com.outsystems.firebase.cloudmessaging" version="2.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="com.outsystems.firebase.cloudmessaging" version="1.2.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>OSFirebaseCloudMessaging</name>
<description>Outsystems plugin for Firebase Cloud Messaging</description>
<author>OutSystems Inc</author>
<js-module name="OSFirebaseCloudMessaging" src="www/OSFirebaseCloudMessaging.js">
<clobbers target="cordova.plugins.OSFirebaseCloudMessaging"/>
</js-module>

<dependency id="cordova-outsystems-firebase-core" url="https://github.com/OutSystems/cordova-outsystems-firebase-core.git#2.0.0"/>
<dependency id="cordova-outsystems-firebase-core" url="https://github.com/OutSystems/cordova-outsystems-firebase-core.git#1.0.0"/>

<hook type="after_prepare" src="hooks/unzipSound.js" />
<hook type="after_prepare" src="hooks/cleanUp.js" />

<platform name="ios">

<config-file parent="/*" target="config.xml">
Expand All @@ -37,7 +34,6 @@
</config-file>

<!-- iOS Source Files -->
<source-file src="src/ios/OSFCMEventExtensions.swift" />
<source-file src="src/ios/OSFirebaseCloudMessaging.swift" />
<header-file src="src/ios/AppDelegate+OSFirebaseCloudMessaging.h" />
<source-file src="src/ios/AppDelegate+OSFirebaseCloudMessaging.m" />
Expand Down Expand Up @@ -65,6 +61,9 @@
<platform name="android">

<hook type="after_prepare" src="hooks/android/androidCopyChannelInfo.js" />

<hook type="before_plugin_install" src="hooks/android/sound/copySound.js" />

<config-file parent="/*" target="res/xml/config.xml">
<feature name="OSFirebaseCloudMessaging">
<param name="android-package" value="com.outsystems.firebase.cloudmessaging.OSFirebaseCloudMessaging"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 2 additions & 4 deletions src/ios/OSFirebaseCloudMessaging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/ios/frameworks/OSFirebaseMessagingLib.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OSFirebaseMessagingLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>OSFirebaseMessagingLib.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Loading

0 comments on commit cef9a21

Please sign in to comment.