File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ class ExpoMessage
13
13
*/
14
14
protected $ title ;
15
15
16
+ /**
17
+ * The message subtitle (iOS).
18
+ *
19
+ * @var string
20
+ */
21
+ protected $ subtitle ;
22
+
16
23
/**
17
24
* The message body.
18
25
*
@@ -100,6 +107,19 @@ public function title(string $value): ExpoMessage
100
107
return $ this ;
101
108
}
102
109
110
+ /**
111
+ * Set the message subtitle (iOS).
112
+ *
113
+ * @param string $value
114
+ * @return $this
115
+ */
116
+ public function subtitle (string $ value ): ExpoMessage
117
+ {
118
+ $ this ->subtitle = $ value ;
119
+
120
+ return $ this ;
121
+ }
122
+
103
123
/**
104
124
* Set the message body.
105
125
*
@@ -230,6 +250,9 @@ public function toArray(): array
230
250
'data ' => $ this ->jsonData ,
231
251
'priority ' => $ this ->priority ,
232
252
];
253
+ if (! empty ($ this ->subtitle )) {
254
+ $ message ['subtitle ' ] = $ this ->subtitle ;
255
+ }
233
256
if (! empty ($ this ->channelId )) {
234
257
$ message ['channelId ' ] = $ this ->channelId ;
235
258
}
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ public function it_can_set_the_title()
44
44
$ this ->assertEquals ('Title ' , Arr::get ($ this ->message ->toArray (), 'title ' ));
45
45
}
46
46
47
+ /** @test */
48
+ public function it_can_set_the_subtitle ()
49
+ {
50
+ $ this ->message ->subtitle ('Subtitle ' );
51
+ $ this ->assertEquals ('Subtitle ' , Arr::get ($ this ->message ->toArray (), 'subtitle ' ));
52
+ }
53
+
47
54
/** @test */
48
55
public function it_can_set_the_body ()
49
56
{
You can’t perform that action at this time.
0 commit comments