Reputation: 1331
I have create an account in parse.com. I am using this single account for my three project.
I need to send notifications. Each application having different app name and package name.
my contents are in parse:
Here there are some channels are common this account. So the notification will send two projects at a time. Now i need to send notification for particular project with particular channel.
For example Now i need to send notification for physics in App1. How can i segregate that one.
My questions are:
Any body can tell me? Thanks in advance.
Upvotes: 2
Views: 409
Reputation: 453
Yes. Try This.
ParseQuery<ParseInstallation> query = ParseInstallation.getQuery();
query.whereEqualTo("appIdentifier", "com.example.app1");
query.whereEqualTo("channels", "physics");
push.setQuery(query);
push.setMessage("Hello");
push.sendInBackground();
Upvotes: 1
Reputation: 522
Yes you can use same Parse Account for multiple apps and send push directed for some specific app. In parse installation table there is an attribute (column ) appIdentifier which stores package name of app. So you can write query like this:
var query = new Parse.Query(Parse.Installation);
query.equalTo('appIdentifies', "App Package name")
query.equalTo('channels', 'your channel');
Parse.Push.send({
where: query, // Set our Installation query
data: {
alert: "Willie Hayes injured by own pop fly."
}
}, {
success: function() {
// Push was successful
},
error: function(error) {
// Handle error
}
});
Upvotes: 2