From 7ea3f96711d89d8e39dcd2eeb5a89f1cbcd0257d Mon Sep 17 00:00:00 2001 From: Ashish Jajoria Date: Mon, 10 Apr 2023 15:53:47 +0530 Subject: [PATCH 1/2] added option to validate notification --- lib/fcm.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fcm.rb b/lib/fcm.rb index 08980ce..5a8e5e7 100644 --- a/lib/fcm.rb +++ b/lib/fcm.rb @@ -47,10 +47,10 @@ def initialize(api_key, json_key_path = "", project_name = "", client_options = # fcm.send_v1( # { "token": "4sdsx",, "to" : "notification": {}.. } # ) - def send_notification_v1(message) + def send_notification_v1(message, validate_only = false) return if @project_name.empty? - post_body = { 'message': message } + post_body = { 'message': message, 'validate_only': validate_only } extra_headers = { 'Authorization' => "Bearer #{jwt_token}" } From 0b631872cf5ff73456eac4f30c0952469f899c13 Mon Sep 17 00:00:00 2001 From: Ashish Jajoria Date: Mon, 10 Apr 2023 15:57:27 +0530 Subject: [PATCH 2/2] fixed violation --- lib/fcm.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/fcm.rb b/lib/fcm.rb index 5a8e5e7..158c304 100644 --- a/lib/fcm.rb +++ b/lib/fcm.rb @@ -49,7 +49,6 @@ def initialize(api_key, json_key_path = "", project_name = "", client_options = # ) def send_notification_v1(message, validate_only = false) return if @project_name.empty? - post_body = { 'message': message, 'validate_only': validate_only } extra_headers = { 'Authorization' => "Bearer #{jwt_token}"