How do I send a browser notification without warning?
I am sending push notification from parsing using cloud code. The problem is that I don't want any notification because I am using push notification to trigger a method in other peoples' apps.
How can I send a push notification without any kind of notification I want it to be cleanly in the background?
Any help would be greatly appreciated.
Here is my current code, how can I do it without any warning?
PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"userId" containedIn:friendArray];
// Send push notification to query
PFPush *push = [[PFPush alloc] init];
[push setQuery:pushQuery]; // Set our Installation query
[push setMessage:nil];
[push sendPushInBackground];
source to share
I understood that.
-
If you set
[push setMessage:""];
to look exactly like this, the notification will not appear outside of the app. -
Comment or get rid of
[PFPush handlePush:userInfo];
so that the notification doesn't appear in the app.
Push notifications will now still fire the method - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
, but there will be no warnings that this is always the case :)
You can now call methods silently using push notifications.
source to share