Juan Redondo
Juan Redondo

Reputation: 173

Mobile Services Tags seems not to work on Cordova app

I'm following the examples of MSDN for using the Push Mobile Web Services:

`// Template registration.
 var template = "{ \"data\" : {\"title\":\"$(title)\",\"message\":\"$(message)\",\"image\":\"$(image)\", \"additionalData\":\"$(additionalData)\"}}";
var tags = "tag";
// Register for notifications.
nomasticketsmobileClient.
  push.gcm.
  registerTemplate(data.registrationId,
                          tags, template, null)
  .done(function () {
                 console.log('Registered template with Azure!: User:' +                localStorage['username'] + ' - ID: ' + data.registrationId );
                 });`

The code works well when i send a broadcast push, but when I try to send to the tag "tag", the azure debug show me this message:

No records were found with the label "tag" for the selected platform

and the push never arrived

what am i doing wrong in the registration? Is there another way to register the tags in Azure Mobile Services?

Upvotes: 0

Views: 90

Answers (1)

phillipv
phillipv

Reputation: 1717

Your parameters are incorrect, you are passing the "tags" variable as the template name. See: https://github.com/Azure/azure-mobile-services/blob/master/sdk/Javascript/src/Push/Push.Web.js#L242-L259

Tags should be an array passed in as the fourth parameter.

Upvotes: 1

Related Questions