$data = array(
            'application' => env('PUSHWOOSH_APPLICATION'),
            'auth' => env('PUSHWOOSH_AUTH'),
            'notifications' => array(
                array(
                    'send_date' => 'now',
                    'content' => $this->sender_name . ' has viewed your profile.',
                    'data' => array('custom' => 'json data'),
                    'android_header' => 'New Profile View',
                    'devices' => $this->push_tokens
                )
            )
        );

    // Pushwoosh createMessage API
    $url = 'https://cp.pushwoosh.com/json/1.3/createMessage';
    $request = json_encode(['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);
    $response = explode("\r\n", $response);
    $response = json_decode($response[13], true);
asked 09 Aug, 13:12
armash's gravatar image

armash
111

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×431
×314
×32

question asked: 09 Aug, 13:12

question was seen: 98 times

last updated: 09 Aug, 13:12