We have other Mobile Services tutorials that demonstrate how to use tags to send push notifications to specific users, and I wanted to let folks know how do this also for PhoneGap clients. The basic process in a nutshell is this:
- Authenticate the client before registration. Because you need to lock-down the registration endpoint to only allow authenticated users, you will get a 401 if you try to register for push notifications before you authenticate the user. Follow Add authentication to your Mobile Services app see how this is done. Note that for a PhoneGap app, you must also add the following plugins to the project:
Just an FYI, you can get more info (which might make good tags) from the identity provider (e.g. Facebook) on the server-side. See Carlos’ blog post on the Enhanced Users feature for more about this.
Hope that helps PhoneGap folks move things forward. We will be providing more Azure content for PhoneGap in the near future.