1 | <?php |
||
7 | class Options |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * This parameter identifies a group of messages. |
||
12 | * |
||
13 | * @var null|string |
||
14 | */ |
||
15 | protected $collapseKey; |
||
16 | |||
17 | /** |
||
18 | * Sets the priority of the message. |
||
19 | * |
||
20 | * @var null|string |
||
21 | */ |
||
22 | protected $priority; |
||
23 | |||
24 | /** |
||
25 | * When a notification or message is sent and this is set to true, |
||
26 | * an inactive client app is awoken. |
||
27 | * |
||
28 | * @var bool |
||
29 | */ |
||
30 | protected $contentAvailable = false; |
||
31 | |||
32 | /** |
||
33 | * This parameter specifies how long (in seconds) the message should be kept |
||
34 | * in FCM storage if the device is offline. |
||
35 | * |
||
36 | * @var null|int |
||
37 | */ |
||
38 | protected $timeToLive; |
||
39 | |||
40 | /** |
||
41 | * This parameter specifies the package name of the application where the registration |
||
42 | * tokens must match in order to receive the message. |
||
43 | * |
||
44 | * @var null|string |
||
45 | */ |
||
46 | protected $restrictedPackageName; |
||
47 | |||
48 | /** |
||
49 | * This parameter, when set to true, allows developers to test a request without |
||
50 | * actually sending a message. |
||
51 | * |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $dryRun = false; |
||
55 | |||
56 | /** |
||
57 | * Options constructor. |
||
58 | * |
||
59 | * @param array|\ker0x\Push\Adapter\Fcm\Message\OptionsBuilder $optionsBuilder Options for the push. |
||
60 | */ |
||
61 | public function __construct($optionsBuilder) |
||
74 | |||
75 | /** |
||
76 | * Return options as an array. |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | public function build() |
||
93 | |||
94 | /** |
||
95 | * Build options from an array. |
||
96 | * |
||
97 | * @param array $optionsArray Array of options for the push. |
||
98 | * @return \ker0x\Push\Adapter\Fcm\Message\OptionsBuilder |
||
99 | * @throws \ker0x\Push\Adapter\Fcm\Message\Exception\InvalidOptionsException |
||
100 | */ |
||
101 | private function fromArray(array $optionsArray) |
||
116 | } |
||
117 |