feat: FCM HTTP v1 API changes (#9629)

Fixes https://linear.app/chatwoot/issue/CW-3210/legacy-firebase-changes
This commit is contained in:
Muhsin Keloth
2024-06-18 10:38:06 +05:30
committed by GitHub
parent 7968e98529
commit 9046730206
7 changed files with 196 additions and 24 deletions

View File

@@ -77,8 +77,8 @@ class ChatwootHub
ChatwootExceptionTracker.new(e).capture_exception
end
def self.send_browser_push(fcm_token_list, fcm_options)
info = { fcm_token_list: fcm_token_list, fcm_options: fcm_options }
def self.send_push(fcm_options)
info = { fcm_options: fcm_options }
RestClient.post(PUSH_NOTIFICATION_URL, info.merge(instance_config).to_json, { content_type: :json, accept: :json })
rescue *ExceptionList::REST_CLIENT_EXCEPTIONS => e
Rails.logger.error "Exception: #{e.message}"