Azure / azure-mobile-services-cordova

Apache License 2.0
23 stars 25 forks source link

Tags for Android push notifications is not working. #11

Closed vinceliao closed 4 years ago

vinceliao commented 8 years ago

After tracing the source code of azure mobile service plugin, I found that gcm.prototype.registerTemplate = function (deviceId, name, bodyTemplate, tags) is missing the "expiryTemplate" parameter. Changing it to gcm.prototype.registerTemplate = function (deviceId, name, bodyTemplate, expiryTemplate, tags) fix the problem.

phvannor commented 8 years ago

From what I can tell: https://msdn.microsoft.com/en-us/library/azure/dn223265.aspx, Notification Hub's GCM API doesn't take an Expiry Template, it only applies to APNS.

Is there a need to expose an expiry template in this API?

The code in question here, should work as is from what I can tell: https://github.com/Azure/azure-mobile-services-cordova/blob/master/www/MobileServices.Web.js#L10872-L10893

gcm.prototype.registerTemplate = function (deviceId, name, bodyTemplate, tags) { return this._push._registerTemplate('gcm', deviceId, name, bodyTemplate, null, tags); }