Meni Samet
Posts: 0
Joined: Mon Jun 03, 2013 10:23 am

Problame with send nothifiction from php

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Problame with send nothifiction from php

Hello! We'll take a look.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Problame with send nothifiction from php

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

Meni Samet
Posts: 0
Joined: Mon Jun 03, 2013 10:23 am

Problame with send nothifiction from php

Ok, thank you.

Andre Pooschke
Posts: 0
Joined: Sun Jun 09, 2013 11:16 am

Problame with send nothifiction from php

Hi,

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

Thank you !

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Problame with send nothifiction from php

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

Andre Pooschke
Posts: 0
Joined: Sun Jun 09, 2013 11:16 am

Problame with send nothifiction from php

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Problame with send nothifiction from php

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

Andre Pooschke
Posts: 0
Joined: Sun Jun 09, 2013 11:16 am

Problame with send nothifiction from php

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Problame with send nothifiction from php

I'll update Andre.

Return to “Issues”