File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -120,17 +120,25 @@ class OSCreateNotification extends JSONStringRepresentable {
120120 this .deliveryTimeOfDay
121121 });
122122
123+ OSCreateNotification .silentNotification ({
124+ @required this .playerIds,
125+ this .additionalData,
126+ this .sendAfter,
127+ this .delayedOption,
128+ this .deliveryTimeOfDay
129+ }) {
130+ this .contentAvailable = true ;
131+ }
132+
123133 Map <String , dynamic > mapRepresentation () {
124134 if (this .languageCode == null ) this .languageCode = "en" ;
125135
126- var json = {
127- "include_player_ids" : this .playerIds,
128- "contents" : {
129- this .languageCode : this .content
130- }
136+ var json = < String , dynamic > {
137+ "include_player_ids" : this .playerIds
131138 };
132139
133140 // add optional parameters to payload if present
141+ if (this .content != null ) json['contents' ] = { this .languageCode : this .content };
134142 if (this .heading != null ) json['headings' ] = { this .languageCode : this .heading };
135143 if (this .subtitle != null ) json['subtitle' ] = { this .languageCode : this .heading };
136144 if (this .contentAvailable != null ) json['content_available' ] = this .contentAvailable;
You can’t perform that action at this time.
0 commit comments