Skip to content

Commit ad2e977

Browse files
committed
Update to FCM URLs for device groups features
1 parent 9fdc66a commit ad2e977

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/fcm.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class FCM
88
FORMAT = :json
99

1010
# constants
11-
GROUP_NOTIFICATION_BASE_URI = 'https://android.googleapis.com'
1211
INSTANCE_ID_API = 'https://iid.googleapis.com'
1312
TOPIC_REGEX = /[a-zA-Z0-9\-_.~%]+/
1413

@@ -49,8 +48,8 @@ def create_notification_key(key_name, project_id, registration_ids = [])
4948
'project_id' => project_id
5049
}
5150

52-
for_uri(GROUP_NOTIFICATION_BASE_URI, extra_headers) do |connection|
53-
response = connection.post('/gcm/notification', post_body.to_json)
51+
for_uri(BASE_URI, extra_headers) do |connection|
52+
response = connection.post('/fcm/notification', post_body.to_json)
5453
build_response(response)
5554
end
5655
end
@@ -65,8 +64,8 @@ def add_registration_ids(key_name, project_id, notification_key, registration_id
6564
'project_id' => project_id
6665
}
6766

68-
for_uri(GROUP_NOTIFICATION_BASE_URI, extra_headers) do |connection|
69-
response = connection.post('/gcm/notification', post_body.to_json)
67+
for_uri(BASE_URI, extra_headers) do |connection|
68+
response = connection.post('/fcm/notification', post_body.to_json)
7069
build_response(response)
7170
end
7271
end
@@ -81,8 +80,8 @@ def remove_registration_ids(key_name, project_id, notification_key, registration
8180
'project_id' => project_id
8281
}
8382

84-
for_uri(GROUP_NOTIFICATION_BASE_URI, extra_headers) do |connection|
85-
response = connection.post('/gcm/notification', post_body.to_json)
83+
for_uri(BASE_URI, extra_headers) do |connection|
84+
response = connection.post('/fcm/notification', post_body.to_json)
8685
build_response(response)
8786
end
8887
end
@@ -99,8 +98,8 @@ def recover_notification_key(key_name, project_id)
9998
'project_id' => project_id
10099
}
101100

102-
for_uri(GROUP_NOTIFICATION_BASE_URI, extra_headers) do |connection|
103-
response = connection.get('/gcm/notification', params)
101+
for_uri(BASE_URI, extra_headers) do |connection|
102+
response = connection.get('/fcm/notification', params)
104103
build_response(response)
105104
end
106105
end

0 commit comments

Comments
 (0)