{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap-build/PushPlugin/issues/498","labels_url":"https://api.github.com/repos/phonegap-build/PushPlugin/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/phonegap-build/PushPlugin/issues/498/comments","events_url":"https://api.github.com/repos/phonegap-build/PushPlugin/issues/498/events","html_url":"https://github.com/phonegap-build/PushPlugin/pull/498","id":58508577,"number":498,"title":"Add support for BigPictureStyle","user":{"login":"ajoyoommen","id":2990410,"avatar_url":"https://avatars.githubusercontent.com/u/2990410?v=3","gravatar_id":"","url":"https://api.github.com/users/ajoyoommen","html_url":"https://github.com/ajoyoommen","followers_url":"https://api.github.com/users/ajoyoommen/followers","following_url":"https://api.github.com/users/ajoyoommen/following{/other_user}","gists_url":"https://api.github.com/users/ajoyoommen/gists{/gist_id}","starred_url":"https://api.github.com/users/ajoyoommen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajoyoommen/subscriptions","organizations_url":"https://api.github.com/users/ajoyoommen/orgs","repos_url":"https://api.github.com/users/ajoyoommen/repos","events_url":"https://api.github.com/users/ajoyoommen/events{/privacy}","received_events_url":"https://api.github.com/users/ajoyoommen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-22T16:35:50Z","updated_at":"2015-08-12T19:53:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/phonegap-build/PushPlugin/pulls/498","html_url":"https://github.com/phonegap-build/PushPlugin/pull/498","diff_url":"https://github.com/phonegap-build/PushPlugin/pull/498.diff","patch_url":"https://github.com/phonegap-build/PushPlugin/pull/498.patch"},"body":"To send a BigPicture Notification (large image in notification), send a url in 'bigPicture'"},"comment":{"url":"https://api.github.com/repos/phonegap-build/PushPlugin/issues/comments/130426065","html_url":"https://github.com/phonegap-build/PushPlugin/pull/498#issuecomment-130426065","issue_url":"https://api.github.com/repos/phonegap-build/PushPlugin/issues/498","id":130426065,"user":{"login":"eros2187","id":5880552,"avatar_url":"https://avatars.githubusercontent.com/u/5880552?v=3","gravatar_id":"","url":"https://api.github.com/users/eros2187","html_url":"https://github.com/eros2187","followers_url":"https://api.github.com/users/eros2187/followers","following_url":"https://api.github.com/users/eros2187/following{/other_user}","gists_url":"https://api.github.com/users/eros2187/gists{/gist_id}","starred_url":"https://api.github.com/users/eros2187/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eros2187/subscriptions","organizations_url":"https://api.github.com/users/eros2187/orgs","repos_url":"https://api.github.com/users/eros2187/repos","events_url":"https://api.github.com/users/eros2187/events{/privacy}","received_events_url":"https://api.github.com/users/eros2187/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T19:53:42Z","updated_at":"2015-08-12T19:53:42Z","body":"Example Code GCM php That however does not work and can price an example PHP page and plug-in ?? HELPMEEEEEEE!!!\r\n\r\nPAGE PHP------------------------------------------------------------------------------------------------------------------------\r\n<?php\r\nclass GCMPushMessage {\r\n    var $url = 'https://android.googleapis.com/gcm/send';\r\n    var $serverApiKey = \"\";\r\n    var $devices = array();\r\n    \r\n    function GCMPushMessage($apiKeyIn){\r\n        $this->serverApiKey = $apiKeyIn;\r\n    }\r\n    function setDevices($deviceIds){\r\n    \r\n\t\t  if(is_array($deviceIds)){\r\n            $this->devices = $deviceIds;\r\n        } else {\r\n            $this->devices = array($deviceIds);\r\n        }\r\n    \r\n    }\r\n    function send($message, $data = false){\r\n        \r\n        if(!is_array($this->devices) || count($this->devices) == 0){\r\n            $this->error(\"No devices set\");\r\n        }\r\n        \r\n        if(strlen($this->serverApiKey) < 8){\r\n            $this->error(\"Server API Key not set\");\r\n        }\r\n        \r\n        $fields = array(\r\n            'registration_ids'  => $this->devices,\r\n\t\t\t'data' => array( \"message\" => $message ),\r\n            //'data' => array(\"message\" => $message,\"count\" => $count,\"BigPicture\" => $BigPicture ),\r\n        );\r\n        \r\n        if(is_array($data)){\r\n            foreach ($data as $key => $value) {\r\n                $fields['data'][$key] = $value;\r\n            }\r\n        }\r\n        $headers = array( \r\n            'Authorization: key=' . $this->serverApiKey,\r\n            'Content-Type: application/json'\r\n        );\r\n        $ch = curl_init();\r\n        \r\n        curl_setopt( $ch, CURLOPT_URL, $this->url );\r\n        \r\n        curl_setopt( $ch, CURLOPT_POST, true );\r\n        curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);\r\n        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\r\n        \r\n        curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fields ) );\r\n        \r\n        curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false);\r\n        curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false);\r\n        \r\n        $result = curl_exec($ch);\r\n        \r\n        curl_close($ch);\r\n        \r\n        return $result;\r\n    }\r\n    \r\n    function error($msg){\r\n        echo \"Android send notification failed with error:\";\r\n        echo \"\\t\" . $msg;\r\n        exit(1);\r\n    }\r\n}\r\n\r\nif(isset($_POST) && !empty($_POST)){\r\n\t$apiKey = $_POST[\"apiKey\"]; // CAPI Key GCM ...\r\n    $devicesToken = explode(\",\",$_POST[\"devices\"]); // Tokens dispositivo\r\n\t$gcpm = new GCMPushMessage($apiKey);\r\n\t$gcpm->setDevices($devicesToken);\r\n\r\n\t$title = $_POST[\"title\"];\r\n\t$BigPicture = $_POST[\"BigPicture\"];\r\n\t$message = $_POST[\"message\"]; // Messaggio contenuti PUSH ...\r\n\t$response = $gcpm->send($message, array('title' => $title,'BigPicture' => $BigPicture)); // Titolo spinta ...\r\n    //$response = $gcpm->send($message, array('title' => $title));\r\n\techo $response;\r\n}\r\n?>\r\n------------------------------------------------------------------------------------------------------------------------------------\r\n\r\nSCRIPT --------------------------------------------------------------------------------------------------------------------------\r\n<script type=\"text/javascript\">\r\n            var pushNotification;\r\n            var tokenID;\r\n            \r\n            function onDeviceReady() {\r\n                \r\n                $(\"#console\").append('<p>-> funzione push avviata!</p>');\r\n                \r\n                // Instanciando plugin Push...\r\n                pushNotification = window.plugins.pushNotification;\r\n\r\n                // Iniciar serviço de Push no aplicativo...\r\n                pushNotification.register(\r\n                    function (result) {\r\n                        $(\"#console\").append('<p>-> SUCESSO: '+ result+'</p>');\r\n                    }, \r\n                    function (error) {\r\n                        $(\"#console\").append('<p>-> ERRO: '+error+'</p>');\r\n                    }, \r\n                    {\r\n                        \"senderID\":\"786971128159\",\r\n                        \"ecb\":\"capturarEventos\"\r\n                    }\r\n                );\r\n                \r\n            }\r\n            \r\n           \r\n            \r\n            // capturar notificações recebidos da API Google Cloud Messaging (GCM)...\r\n            function capturarEventos(e) {\r\n                \r\n                $(\"#console\").append('->-> evento catturato:' + e.event);\r\n                //alert(e.event); // riguarda se il dispositivo e registrato a no da google\r\n                \r\n                switch( e.event )\r\n                {\r\n                    // Dispositivo registrado no GCM!!!\r\n                    case 'registered':\r\n                            \r\n                        $(\"#console\").append('<p>-> dispositivo registrato' + e.regid+'</p>');\r\n                        console.log(\"TOKEN = \" + e.regid);   //ricevi il token id//   \r\n                        tokenID = e.regid;\r\n                        break;\r\n                        //invio tokenID tramite £post//\r\n                        \r\n                       \r\n                    \r\n                     // rivevuto push!!!\r\n                    case 'message':\r\n\t\t\t\r\n\t\t\t             // Verificare messaggio push è arrivato con l'applicazione aperta (in primo piano) ...\r\n                         // Se è così, abbiamo lanciato un allarme (suono, finestre, ecc) per attirare l'attenzione ...\r\n\t\t\tif (e.foreground)\r\n\t\t\t{\r\n                $(\"#console\").append('<p> PUSH CATTURATO CON APP APERTA!</p>');\r\n                intel.xdk.notification.alert(e.payload.message + \" \" + e.payload.BigPicture + \" \", e.payload.title + \" \", \"Conferma\");\r\n                \r\n                \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\t\r\n\t\t\t\t// In caso contrario sono stati rilasciati perché l'utente ha toccato una notifica nella barra di notifica ...\r\n                            if (e.coldstart)\r\n                                $(\"#console\").append('<p>-> CAPTURADO PUSH COM APP EM COLDSTART!</p>');\r\n                            else\r\n                                $(\"#console\").append('<p>-> CAPTURADO PUSH COM APP EM BACKGROUND!</p>');\r\n                        }\r\n\r\n                        // Compondo mensagem...\r\n                        //alert('message = '+e.message+' msgcnt = '+e.msgcnt);\r\n                        $(\"#console\").append('<p>-> MENSAGEM: ' + e.payload.message + '</p>');\r\n                        $(\"#console\").append('<p>-> MENSAGEM: ' + e.payload.title + '</p>');\r\n                        $(\"#console\").append('<p>-> MENSAGEM: ' + e.payload.count + '</p>');\r\n                        $(\"#console\").append('<p>-> MENSAGEM: ' + e.payload.sound + '</p>');\r\n                        $(\"#console\").append('<p>-> MENSAGEM: ' + e.payload.BigPicture + '</p>');\r\n                        break;\r\n                    \r\n                    case 'error':\r\n\t\t\t\t\t\t  $(\"#console\").append('<p>-> ERRO:' + e.msg+'</p>' );\r\n                          alert(e.msg);\r\n                        break;\r\n                    \r\n                    default:\r\n\t\t\t\t\t\t  $(\"#console\").append('<p>-> EVENTO: Desconhecido, um envento estranho foi capturado.</p>');\r\n                        break;\r\n                }\r\n            }\r\n            \r\n\t\t\tdocument.addEventListener('app.Ready', onDeviceReady, true);\r\n        </script>\r\n-------------------------------------------------------------------------------------------------------------------------------------"}}