Skip to content

Commit 6c98c01

Browse files
supermar1010Mario Jacobi
andauthored
Fixed wrong usage of contentAvailable for iOS push notifications via firebase (#165)
Co-authored-by: Mario Jacobi <[email protected]>
1 parent aa6f25c commit 6c98c01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GCM.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ GCM.prototype.send = function(data, devices) {
7070
}, {});
7171

7272
let deviceTokens = Object.keys(devicesMap);
73-
73+
7474
const resolvers = [];
7575
const promises = deviceTokens.map(() => new Promise(resolve => resolvers.push(resolve)));
7676
let registrationTokens = deviceTokens;
@@ -132,8 +132,8 @@ function generateGCMPayload(requestData, pushId, timeStamp, expirationTime) {
132132
push_id: pushId,
133133
time: new Date(timeStamp).toISOString()
134134
}
135-
const optionalKeys = ['content_available', 'notification'];
136-
optionalKeys.forEach((key, index, array) => {
135+
const optionalKeys = ['contentAvailable', 'notification'];
136+
optionalKeys.forEach((key) => {
137137
if (requestData.hasOwnProperty(key)) {
138138
payload[key] = requestData[key];
139139
}

0 commit comments

Comments
 (0)