When I try to send a push from parse or from a dev

2019-08-29 07:05发布

问题:

I am trying to send push notifications from one user to another. I tried sending a push notification form parse's dashboard, but just like the segmented pushes it says success but does not actually send.

 func pushNotifications(){


    let userQuery: PFQuery = PFUser.query()!
    userQuery.whereKey("objectId", containedIn: Array(setOfSelectedFriends)) 
    let pushQuery: PFQuery = PFInstallation.query()!
    pushQuery.whereKey("user", matchesQuery: userQuery)

    let push = PFPush()
    push.setQuery(pushQuery)
    push.setMessage("Hello, World!")

    push.sendPushInBackgroundWithBlock {
        success, error in

        if success {
            print("The push succeeded.")
        } else {
            print("The push failed.")
        }
    }

    }