I am creating a chat application and sending push notification on new message-
-(void)methodName{
PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"user" containedIn:objectIds];
PFPush *push = [[PFPush alloc] init];
push setQuery:pushQuery];
NSDictionary *pushData=@{
@"alert" : self.messageTxt.text,
@"Message" : self.messageTxt.text,
@"FirstGroup" : [GroupData valueForKey:@"GroupsOneId"],
@"SecondGroup" : [GroupData valueForKey:@"GroupsTwoId"],
@"GroupId" : groupObjectIdSend,
@"Type" : @"MutualMessage"
};
[push setData:pushData];
[push sendPushInBackground];
}
Please help me why i am not getting notification every time.