This is a migrated thread and some comments may be shown as answers.

Send push notification with php - filter problem

1 Answer 152 Views
Push Notifications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Teo
Top achievements
Rank 1
Teo asked on 01 Nov 2014, 11:59 PM
Hello :) 

I'm trying to send push notifications with everlive and php. This is my code:
$curl_url = 'http://api.everlive.com/v1/api-key-id/Push/Notifications';
   $fields = array(
      'Android' => array(
          'data' => array(
          'title' => 'Push Title',
          'message' => 'Push message for Android',
          'customData' => 'Custom data for Android',
      ),
   ),
);

Everything works perfect, but when I set Filter option, it doesn't work:

'Filter' => array(
   'Parameters'=> array(
       'Age' => '15',
   ),
),

I tryed to set it before Android filtering ( 2nd row), also as a property into the Android array. What I'm doing wrong :) 

Thank you :)


1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 03 Nov 2014, 12:56 PM
Hello Teo,

Could you please try with "stringifying" the filter object before sending the notification payload to the server? In addition - the Filter property should be on the same level as the Android key, but in order to be interpreted properly by the server you need to pass it as a JSON string.

You can read more about how to construct the Filter in this documentation article (JavaScript example).

Let me know if you have further questions.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
Push Notifications
Asked by
Teo
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or