1 | <?php |
||
13 | class GcmComponent extends Component |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Response of the request |
||
18 | * |
||
19 | * @var object |
||
20 | */ |
||
21 | protected $_gcm = null; |
||
22 | |||
23 | /** |
||
24 | * Constructor |
||
25 | * |
||
26 | * @param ComponentRegistry $registry A ComponentRegistry |
||
27 | * @param array $config Array of configuration settings |
||
28 | */ |
||
29 | public function __construct(ComponentRegistry $registry, array $config = []) |
||
33 | |||
34 | /** |
||
35 | * Send a downstream message to one or more devices |
||
36 | * |
||
37 | * @param mixed $ids Devices'ids |
||
38 | * @param array $payload The notification and/or some datas |
||
39 | * @param array $parameters Parameters for the GCM request |
||
40 | * @throws Exception |
||
41 | * @return bool |
||
42 | */ |
||
43 | public function send($ids = null, array $payload = [], array $parameters = []) |
||
47 | |||
48 | /** |
||
49 | * Shortcut to send notification |
||
50 | * |
||
51 | * @param mixed $ids Devices'ids |
||
52 | * @param array $notification The notification |
||
53 | * @param array $parameters Parameters for the GCM request |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function sendNotification($ids = null, array $notification = [], array $parameters = []) |
||
60 | |||
61 | /** |
||
62 | * Shortcut to send datas |
||
63 | * |
||
64 | * @param mixed $ids Devices'ids |
||
65 | * @param array $data Some datas |
||
66 | * @param array $parameters Parameters for the GCM request |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function sendData($ids = null, array $data = [], array $parameters = []) |
||
73 | |||
74 | /** |
||
75 | * Return the response of the push |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function response() |
||
83 | } |
||
84 |