1 | <?php |
||
12 | class GcmComponent extends Component |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * Gcm property |
||
17 | * |
||
18 | * @var object |
||
19 | */ |
||
20 | protected $_gcm = null; |
||
21 | |||
22 | /** |
||
23 | * Initialize config data and properties. |
||
24 | * |
||
25 | * @param array $config Array of configuration settings |
||
26 | */ |
||
27 | public function initialize(array $config= []) |
||
32 | |||
33 | /** |
||
34 | * Send a downstream message to one or more devices |
||
35 | * |
||
36 | * @param mixed $ids Devices'ids |
||
37 | * @param array $payload The notification and/or some datas |
||
38 | * @param array $parameters Parameters for the GCM request |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function send($ids = null, array $payload = [], array $parameters = []) |
||
45 | |||
46 | /** |
||
47 | * Shortcut to send notification |
||
48 | * |
||
49 | * @param mixed $ids Devices'ids |
||
50 | * @param array $notification The notification |
||
51 | * @param array $parameters Parameters for the GCM request |
||
52 | * @return bool |
||
53 | */ |
||
54 | public function sendNotification($ids = null, array $notification = [], array $parameters = []) |
||
58 | |||
59 | /** |
||
60 | * Shortcut to send datas |
||
61 | * |
||
62 | * @param mixed $ids Devices'ids |
||
63 | * @param array $data Some datas |
||
64 | * @param array $parameters Parameters for the GCM request |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function sendData($ids = null, array $data = [], array $parameters = []) |
||
71 | |||
72 | /** |
||
73 | * Return the response of the push |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function response() |
||
81 | } |
||
82 |