bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to prevent a user from sending push notification to All

I am implementing Push Notification for peer to peer communications notification. I have a few implementation questions.

1) How do you securely prevent the user from sending a notification to all devices?

2) Are there any good examples of peer to peer communications that are available for a newbie?

3) How to send notification to multiple devices where the same user is logged in?

4) How to track what devices a user is logged into, so only notifications for that user are delivered to all the right devices.

Thanks

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to prevent a user from sending push notification to All

Hello,

  1. You can use "server script" with logic you need to restrict users to send something wrong...

  2. Unfortunatly nope.

  3. Here is example of how to set filter to serveral devices:

    pre

    "deviceID": {
    $in: [
    //Here you can specify all deviceIDs that you need.
    "358979040767405;b0489c8c13a6c9a9",
    "990001174896910;578019b178efcda1"
    ]
    }

    /pre

  4. there is no build in ability to do it.. But you can implement you own logic.. Like update current user information with some delay..

    Regards.

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to prevent a user from sending push notification to All

Thank you for your responses.

However on question 1, using server scripts would be extremely limiting for any consumer oriented application, since server scripts in Appery are limited to VERY low levels of traffic. Or am I missing something?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to prevent a user from sending push notification to All

Hello,

You will not have any problems with server script in accordance to push notifications data.

Regards.

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to prevent a user from sending push notification to All

I am not sure if I understand. Are you saying, there is a way in which Appery knows that a Server Script is for Push vs Something else. If so, how?

Thanks

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to prevent a user from sending push notification to All

Nope,

Push requires list bit of data.. So to send this little bit of data you will not have any problems in implementation with server script.

It means - you can not send via push notifications a big bulk of data.. There is limitations. See details here: http://stackoverflow.com/questions/63...

Regards.

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to prevent a user from sending push notification to All

I understand that.

However, the problem is on Appery's side. Appery, only allows 3-5 server script calls per second, which by any means is impractical for a commercial application that may have 1000s for users pushing message at the same time. Or am I missing something?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to prevent a user from sending push notification to All

You can manage it on client part. So when service return error - you can reinvoke this service.

Regards.

Return to “Issues”