Page 1 of 2

Problame with send nothifiction from php

Posted: Mon Jun 03, 2013 10:23 am
by Meni Samet

Hi, i have a problame with send nothifiction from php

the function is:
function send_notification($message)
{

Code: Select all

     // Set POST variables 
     $url = '[url=https://api.appery.io/rest/push/msg/key]https://api.appery.io/rest/push/msg/key[/url]'; 

     $fields = array( 
         'channels' = 0000, 
         'message' = $message, 
'badge' = 0, 
'deviceID' = '' 
     ); 

     $headers = array( 
         'X-Appery-Push-Master-Key: MYMASTERKEY', 
         'Content-Type: application/json' 
     ); 
     // Open connection 
     $ch = curl_init(); 

     // Set the url, number of POST vars, POST data 
     curl_setopt($ch, CURLOPT_URL, $url); 

     curl_setopt($ch, CURLOPT_POST, true); 
     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 

     // Disabling SSL Certificate support temporarly 
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 

     curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); 

     // Execute post 
     $result = curl_exec($ch); 
     if ($result === FALSE) { 
         die('Curl failed: ' . curl_error($ch)); 
     } 

     // Close connection 
     curl_close($ch); 
     echo $result; 
 } 

the eror is:
{"code":"PNMM007","description":"Serialization error"}

some one can help me please?
thank you,
-Meni


Problame with send nothifiction from php

Posted: Mon Jun 03, 2013 11:12 am
by Maryna Brodina

Hello! We'll take a look.


Problame with send nothifiction from php

Posted: Mon Jun 03, 2013 11:44 am
by Maryna Brodina

Reproduced this problem, it's a bug. We'll fix it.


Problame with send nothifiction from php

Posted: Mon Jun 03, 2013 1:58 pm
by Meni Samet

Ok, thank you.


Problame with send nothifiction from php

Posted: Sun Jun 09, 2013 11:16 am
by Andre Pooschke

Hi,

do you know when the problem will be fixed?
Want to use it productive ...

Thank you !


Problame with send nothifiction from php

Posted: Sun Jun 09, 2013 11:30 am
by Illya Stepanov

Hi Andre - I'll ask our developers about the date hotfix. We'll update on this topic.


Problame with send nothifiction from php

Posted: Sun Jun 09, 2013 11:37 am
by Andre Pooschke

Ok thank you.
Is the bug a problem in cURL? Is it possible to use your push notification service with other requests?
Perhaps build the request manual and use fopen()?
What would be the correct source that should be submitted in the request?

Thank you for your answer ...

Andre


Problame with send nothifiction from php

Posted: Sun Jun 09, 2013 12:20 pm
by Illya Stepanov

Andre, our push notification service is working. You can check our documentations: http://docs.appery.io/documentation/b...


Problame with send nothifiction from php

Posted: Sun Jun 09, 2013 12:23 pm
by Andre Pooschke

Of course your notification service is working. But the explained tutorial for 3rd Party apps with cURL does not work.
So perhaps there is another possibility to request a push at your backend service.


Problame with send nothifiction from php

Posted: Sun Jun 09, 2013 12:29 pm
by Illya Stepanov

I'll update Andre.