From 4d241b05c927ef961a246fb3d9decf88ce39464d Mon Sep 17 00:00:00 2001 From: pcamilojunior Date: Wed, 2 Oct 2024 16:16:56 +0200 Subject: [PATCH 1/3] set the color and icon to push local notification --- .../cloudmessaging/OSFirebaseCloudMessaging.kt | 14 +++++++++++++- www/OSFirebaseCloudMessaging.js | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/android/com/outsystems/firebase/cloudmessaging/OSFirebaseCloudMessaging.kt b/src/android/com/outsystems/firebase/cloudmessaging/OSFirebaseCloudMessaging.kt index 307d5fa..2534d14 100755 --- a/src/android/com/outsystems/firebase/cloudmessaging/OSFirebaseCloudMessaging.kt +++ b/src/android/com/outsystems/firebase/cloudmessaging/OSFirebaseCloudMessaging.kt @@ -300,8 +300,20 @@ class OSFirebaseCloudMessaging : CordovaImplementation() { val text = args.get(2).toString() val channelName = args.get(3).toString() val channelDescription = args.get(4).toString() + val color = args.get(5).toString() + val icon = args.get(6).toString() + + val result = controller.sendLocalNotification( + number = badge, + title = title, + text = text, + image = null, + color = color, + icon = icon, + channelName = channelName, + channelDescription = channelDescription + ) - val result = controller.sendLocalNotification(badge, title, text, null, channelName, channelDescription) if (result.first) { sendSuccess(callbackContext) } else { diff --git a/www/OSFirebaseCloudMessaging.js b/www/OSFirebaseCloudMessaging.js index 2167ac9..0254f97 100644 --- a/www/OSFirebaseCloudMessaging.js +++ b/www/OSFirebaseCloudMessaging.js @@ -28,8 +28,8 @@ exports.getBadge = function (success, error) { exec(success, error, 'OSFirebaseCloudMessaging', 'getBadge'); }; -exports.sendLocalNotification = function (badge, title, body, channelName, channelDescription, success, error) { - exec(success, error, 'OSFirebaseCloudMessaging', 'sendLocalNotification', [badge, title, body, channelName, channelDescription]); +exports.sendLocalNotification = function (badge, title, body, channelName, channelDescription, color, icon, success, error) { + exec(success, error, 'OSFirebaseCloudMessaging', 'sendLocalNotification', [badge, title, body, channelName, channelDescription, color, icon]); }; exports.registerDevice = function (success, error) { From deac44d31462cd29f44551888d528e9cf515fdad Mon Sep 17 00:00:00 2001 From: pcamilojunior Date: Wed, 2 Oct 2024 16:18:25 +0200 Subject: [PATCH 2/3] set the color and icon to push local notification --- .../com/outsystems/firebase/cloudmessaging/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/com/outsystems/firebase/cloudmessaging/build.gradle b/src/android/com/outsystems/firebase/cloudmessaging/build.gradle index f6a64b4..b79a58e 100644 --- a/src/android/com/outsystems/firebase/cloudmessaging/build.gradle +++ b/src/android/com/outsystems/firebase/cloudmessaging/build.gradle @@ -23,8 +23,8 @@ apply plugin: 'kotlin-kapt' dependencies { implementation("com.github.outsystems:oscore-android:1.2.0@aar") implementation("com.github.outsystems:oscordova-android:2.0.1@aar") - implementation("com.github.outsystems:osfirebasemessaging-android:1.2.2@aar") - implementation("com.github.outsystems:oslocalnotifications-android:1.0.0@aar") + implementation("com.github.outsystems:osfirebasemessaging-android:1.2.2.1@aar") + implementation("com.github.outsystems:oslocalnotifications-android:1.1.0.1@aar") implementation("com.google.code.gson:gson:2.8.9") From ed03cdba2a5d6ac35442402a79642c27164df4c7 Mon Sep 17 00:00:00 2001 From: pcamilojunior Date: Fri, 4 Oct 2024 17:57:48 +0200 Subject: [PATCH 3/3] added the CHANGELOG and also the update versions of lib localnotifications & firebasemessaging --- CHANGELOG.md | 4 ++++ .../com/outsystems/firebase/cloudmessaging/build.gradle | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc04f40..ebee468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ 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. +## [Unreleased] +### 04-10-2024 +- Feat: Handle icon and color parameters in setupNotificationBuilder for Android 12+ compatibility + ## [Version 2.3.2] ### Features diff --git a/src/android/com/outsystems/firebase/cloudmessaging/build.gradle b/src/android/com/outsystems/firebase/cloudmessaging/build.gradle index b79a58e..d4e76cb 100644 --- a/src/android/com/outsystems/firebase/cloudmessaging/build.gradle +++ b/src/android/com/outsystems/firebase/cloudmessaging/build.gradle @@ -23,8 +23,8 @@ apply plugin: 'kotlin-kapt' dependencies { implementation("com.github.outsystems:oscore-android:1.2.0@aar") implementation("com.github.outsystems:oscordova-android:2.0.1@aar") - implementation("com.github.outsystems:osfirebasemessaging-android:1.2.2.1@aar") - implementation("com.github.outsystems:oslocalnotifications-android:1.1.0.1@aar") + implementation("com.github.outsystems:osfirebasemessaging-android:1.2.2.2@aar") + implementation("com.github.outsystems:oslocalnotifications-android:1.1.0.3@aar") implementation("com.google.code.gson:gson:2.8.9")