@@ -107,6 +107,102 @@ data class InboxStyle (
107
107
)
108
108
}
109
109
}
110
+
111
+ /* *
112
+ * Corresponds to `androidx.core.app.Person`
113
+ *
114
+ * See: https://developer.android.com/reference/androidx/core/app/Person
115
+ *
116
+ * Generated class from Pigeon that represents data sent in messages.
117
+ */
118
+ data class Person (
119
+ val iconData : ByteArray? = null ,
120
+ val key : String ,
121
+ val name : String
122
+
123
+ ) {
124
+ companion object {
125
+ @Suppress(" LocalVariableName" )
126
+ fun fromList (__pigeon_list : List <Any ?>): Person {
127
+ val iconData = __pigeon_list [0 ] as ByteArray?
128
+ val key = __pigeon_list [1 ] as String
129
+ val name = __pigeon_list [2 ] as String
130
+ return Person (iconData, key, name)
131
+ }
132
+ }
133
+ fun toList (): List <Any ?> {
134
+ return listOf (
135
+ iconData,
136
+ key,
137
+ name,
138
+ )
139
+ }
140
+ }
141
+
142
+ /* *
143
+ * Corresponds to `androidx.core.app.NotificationCompat.MessagingStyle.Message`
144
+ *
145
+ * See: https://developer.android.com/reference/androidx/core/app/NotificationCompat.MessagingStyle.Message
146
+ *
147
+ * Generated class from Pigeon that represents data sent in messages.
148
+ */
149
+ data class MessagingStyleMessage (
150
+ val text : String ,
151
+ val timestampMs : Long ,
152
+ val person : Person
153
+
154
+ ) {
155
+ companion object {
156
+ @Suppress(" LocalVariableName" )
157
+ fun fromList (__pigeon_list : List <Any ?>): MessagingStyleMessage {
158
+ val text = __pigeon_list [0 ] as String
159
+ val timestampMs = __pigeon_list [1 ].let { num -> if (num is Int ) num.toLong() else num as Long }
160
+ val person = __pigeon_list [2 ] as Person
161
+ return MessagingStyleMessage (text, timestampMs, person)
162
+ }
163
+ }
164
+ fun toList (): List <Any ?> {
165
+ return listOf (
166
+ text,
167
+ timestampMs,
168
+ person,
169
+ )
170
+ }
171
+ }
172
+
173
+ /* *
174
+ * Corresponds to `androidx.core.app.NotificationCompat.MessagingStyle`
175
+ *
176
+ * See: https://developer.android.com/reference/androidx/core/app/NotificationCompat.MessagingStyle
177
+ *
178
+ * Generated class from Pigeon that represents data sent in messages.
179
+ */
180
+ data class MessagingStyle (
181
+ val user : Person ,
182
+ val conversationTitle : String? = null ,
183
+ val messages : List <MessagingStyleMessage ?>? = null ,
184
+ val isGroupConversation : Boolean
185
+
186
+ ) {
187
+ companion object {
188
+ @Suppress(" LocalVariableName" )
189
+ fun fromList (__pigeon_list : List <Any ?>): MessagingStyle {
190
+ val user = __pigeon_list [0 ] as Person
191
+ val conversationTitle = __pigeon_list [1 ] as String?
192
+ val messages = __pigeon_list [2 ] as List <MessagingStyleMessage ?>?
193
+ val isGroupConversation = __pigeon_list [3 ] as Boolean
194
+ return MessagingStyle (user, conversationTitle, messages, isGroupConversation)
195
+ }
196
+ }
197
+ fun toList (): List <Any ?> {
198
+ return listOf (
199
+ user,
200
+ conversationTitle,
201
+ messages,
202
+ isGroupConversation,
203
+ )
204
+ }
205
+ }
110
206
private object NotificationsPigeonCodec : StandardMessageCodec() {
111
207
override fun readValueOfType (type : Byte , buffer : ByteBuffer ): Any? {
112
208
return when (type) {
@@ -120,6 +216,21 @@ private object NotificationsPigeonCodec : StandardMessageCodec() {
120
216
InboxStyle .fromList(it)
121
217
}
122
218
}
219
+ 131 .toByte() -> {
220
+ return (readValue(buffer) as ? List <Any ?>)?.let {
221
+ Person .fromList(it)
222
+ }
223
+ }
224
+ 132 .toByte() -> {
225
+ return (readValue(buffer) as ? List <Any ?>)?.let {
226
+ MessagingStyleMessage .fromList(it)
227
+ }
228
+ }
229
+ 133 .toByte() -> {
230
+ return (readValue(buffer) as ? List <Any ?>)?.let {
231
+ MessagingStyle .fromList(it)
232
+ }
233
+ }
123
234
else -> super .readValueOfType(type, buffer)
124
235
}
125
236
}
@@ -133,6 +244,18 @@ private object NotificationsPigeonCodec : StandardMessageCodec() {
133
244
stream.write(130 )
134
245
writeValue(stream, value.toList())
135
246
}
247
+ is Person -> {
248
+ stream.write(131 )
249
+ writeValue(stream, value.toList())
250
+ }
251
+ is MessagingStyleMessage -> {
252
+ stream.write(132 )
253
+ writeValue(stream, value.toList())
254
+ }
255
+ is MessagingStyle -> {
256
+ stream.write(133 )
257
+ writeValue(stream, value.toList())
258
+ }
136
259
else -> super .writeValue(stream, value)
137
260
}
138
261
}
@@ -159,7 +282,8 @@ interface AndroidNotificationHostApi {
159
282
* https://developer.android.com/reference/kotlin/android/app/NotificationManager.html#notify
160
283
* https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder
161
284
*/
162
- fun notify (tag : String? , id : Long , autoCancel : Boolean? , channelId : String , color : Long? , contentIntent : PendingIntent ? , contentText : String? , contentTitle : String? , extras : Map <String ?, String ?>? , groupKey : String? , inboxStyle : InboxStyle ? , isGroupSummary : Boolean? , smallIconResourceName : String? )
285
+ fun notify (tag : String? , id : Long , autoCancel : Boolean? , channelId : String , color : Long? , contentIntent : PendingIntent ? , contentText : String? , contentTitle : String? , extras : Map <String ?, String ?>? , groupKey : String? , inboxStyle : InboxStyle ? , isGroupSummary : Boolean? , messagingStyle : MessagingStyle ? , number : Long? , smallIconResourceName : String? )
286
+ fun getActiveNotificationMessagingStyleByTag (tag : String ): MessagingStyle ?
163
287
164
288
companion object {
165
289
/* * The codec used by AndroidNotificationHostApi. */
@@ -187,9 +311,11 @@ interface AndroidNotificationHostApi {
187
311
val groupKeyArg = args[9 ] as String?
188
312
val inboxStyleArg = args[10 ] as InboxStyle ?
189
313
val isGroupSummaryArg = args[11 ] as Boolean?
190
- val smallIconResourceNameArg = args[12 ] as String?
314
+ val messagingStyleArg = args[12 ] as MessagingStyle ?
315
+ val numberArg = args[13 ].let { num -> if (num is Int ) num.toLong() else num as Long? }
316
+ val smallIconResourceNameArg = args[14 ] as String?
191
317
val wrapped: List <Any ?> = try {
192
- api.notify(tagArg, idArg, autoCancelArg, channelIdArg, colorArg, contentIntentArg, contentTextArg, contentTitleArg, extrasArg, groupKeyArg, inboxStyleArg, isGroupSummaryArg, smallIconResourceNameArg)
318
+ api.notify(tagArg, idArg, autoCancelArg, channelIdArg, colorArg, contentIntentArg, contentTextArg, contentTitleArg, extrasArg, groupKeyArg, inboxStyleArg, isGroupSummaryArg, messagingStyleArg, numberArg, smallIconResourceNameArg)
193
319
listOf (null )
194
320
} catch (exception: Throwable ) {
195
321
wrapError(exception)
@@ -200,6 +326,23 @@ interface AndroidNotificationHostApi {
200
326
channel.setMessageHandler(null )
201
327
}
202
328
}
329
+ run {
330
+ val channel = BasicMessageChannel <Any ?>(binaryMessenger, " dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getActiveNotificationMessagingStyleByTag$separatedMessageChannelSuffix " , codec)
331
+ if (api != null ) {
332
+ channel.setMessageHandler { message, reply ->
333
+ val args = message as List <Any ?>
334
+ val tagArg = args[0 ] as String
335
+ val wrapped: List <Any ?> = try {
336
+ listOf (api.getActiveNotificationMessagingStyleByTag(tagArg))
337
+ } catch (exception: Throwable ) {
338
+ wrapError(exception)
339
+ }
340
+ reply.reply(wrapped)
341
+ }
342
+ } else {
343
+ channel.setMessageHandler(null )
344
+ }
345
+ }
203
346
}
204
347
}
205
348
}
0 commit comments