push notification not getting on device? why? did anybody knows about this

Comments

2 comments

  • Avatar
    noumancm

    function pwCall($method, $data) {

    $url = 'https://cp.pushwoosh.com/json/1.3/' . $method;

    $request = json_encode(array ('request' => $data));
    
    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    
    if (defined('PW_DEBUG') && PW_DEBUG) {
        print "[PW] request: $request\n";
        print "[PW] response: $response\n";
        print "[PW] info: " . print_r($info, true);
    }
    

    }

    pwCall('createMessage', array(

    'application' => PW_APPLICATION,

    'auth' => PW_AUTH,

    'notifications' => array(

            array(
    
                'send_date' => 'now',
    
                'content' => 'hw r u',
    
                'data' => array('custom' => 'json data'),
    
                'link' => 'http://pushwoosh.com/'
    
            )
        )
    )
    

    );

  • Avatar
    Gayview Mahat

    Hi,

    I could not locate any messages sent via API in your Push History, which means that your request doesn't seem to go through. What does our server respond to your request?

Please sign in to leave a comment.