Subversion Repositories SmartDukaan

Rev

Rev 15262 | Rev 15311 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15262 Rev 15263
Line 26... Line 26...
26
			}
26
			}
27
		}
27
		}
28
    }
28
    }
29
 
29
 
30
    private function send_push_notification($registatoin_ids, $message, $user_id) {
30
    private function send_push_notification($registatoin_ids, $message, $user_id) {
-
 
31
    	Configure::load('live');
31
		$msg = array(
32
		$msg = array(
32
		    'message'       => $message['message'],
33
		    'message'       => $message['message'],
33
		    'cid'       	=> $message['id'],
34
		    'cid'       	=> $message['id'],
34
		    'title'         => $message['title'],
35
		    'title'         => $message['title'],
35
		    'type'      	=> $message['type'],
36
		    'type'      	=> $message['type'],
Line 48... Line 49...
48
		);
49
		);
49
		$headers = array(
50
		$headers = array(
50
		    'Authorization: key=' . Configure::read('googleapikey'),
51
		    'Authorization: key=' . Configure::read('googleapikey'),
51
		    'Content-Type: application/json'
52
		    'Content-Type: application/json'
52
		);
53
		);
53
		//print_r($headers);
54
		// $this->out(print_r($headers,1));
54
		// Open connection
55
		// Open connection
55
		$ch = curl_init();
56
		$ch = curl_init();
56
 
57
 
57
		// Set the url, number of POST vars, POST data
58
		// Set the url, number of POST vars, POST data
58
		curl_setopt($ch, CURLOPT_URL, $url);
59
		curl_setopt($ch, CURLOPT_URL, $url);