Я новичок в SFMC и в настоящее время учусь. Я пытаюсь показать push-уведомления в приложении.

Пока я могу сопоставить большинство полей, полученных как NotificationMessage, но я не смог найти поле message.

Уведомление

    package com.salesforce.marketingcloud.notifications

@kotlinx.android.parcel.Parcelize @com.salesforce.marketingcloud.MCKeep public final data class NotificationMessage internal constructor(id: kotlin.String, requestId: kotlin.String? /* = compiled code */, region: com.salesforce.marketingcloud.messages.Region? /* = compiled code */, alert: kotlin.String, sound: com.salesforce.marketingcloud.notifications.NotificationMessage.Sound, soundName: kotlin.String? /* = compiled code */, title: kotlin.String? /* = compiled code */, subtitle: kotlin.String? /* = compiled code */, type: com.salesforce.marketingcloud.notifications.NotificationMessage.Type, trigger: com.salesforce.marketingcloud.notifications.NotificationMessage.Trigger, url: kotlin.String? /* = compiled code */, mediaUrl: kotlin.String? /* = compiled code */, mediaAltText: kotlin.String? /* = compiled code */, customKeys: kotlin.collections.Map<kotlin.String, kotlin.String> /* = compiled code */, custom: kotlin.String? /* = compiled code */, payload: kotlin.collections.Map<kotlin.String, kotlin.String>? /* = compiled code */, notificationId: kotlin.Int /* = compiled code */) : android.os.Parcelable {
    public final val alert: kotlin.String /* compiled code */

    public final val custom: kotlin.String? /* compiled code */

    public final val customKeys: kotlin.collections.Map<kotlin.String, kotlin.String> /* compiled code */

    public final val id: kotlin.String /* compiled code */

    public final val mediaAltText: kotlin.String? /* compiled code */

    public final val mediaUrl: kotlin.String? /* compiled code */

    internal final var notificationId: kotlin.Int /* compiled code */

    public final val payload: kotlin.collections.Map<kotlin.String, kotlin.String>? /* compiled code */

    public final val region: com.salesforce.marketingcloud.messages.Region? /* compiled code */

    public final val requestId: kotlin.String? /* compiled code */

    public final val sound: com.salesforce.marketingcloud.notifications.NotificationMessage.Sound /* compiled code */

    public final val soundName: kotlin.String? /* compiled code */

    public final val subtitle: kotlin.String? /* compiled code */

    public final val title: kotlin.String? /* compiled code */

    public final val trigger: com.salesforce.marketingcloud.notifications.NotificationMessage.Trigger /* compiled code */

    public final val type: com.salesforce.marketingcloud.notifications.NotificationMessage.Type /* compiled code */

    public final val url: kotlin.String? /* compiled code */

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun alert(): kotlin.String { /* compiled code */ }

    public final operator fun component1(): kotlin.String { /* compiled code */ }

    public final operator fun component10(): com.salesforce.marketingcloud.notifications.NotificationMessage.Trigger { /* compiled code */ }

    public final operator fun component11(): kotlin.String? { /* compiled code */ }

    public final operator fun component12(): kotlin.String? { /* compiled code */ }

    public final operator fun component13(): kotlin.String? { /* compiled code */ }

    public final operator fun component14(): kotlin.collections.Map<kotlin.String, kotlin.String> { /* compiled code */ }

    public final operator fun component15(): kotlin.String? { /* compiled code */ }

    public final operator fun component16(): kotlin.collections.Map<kotlin.String, kotlin.String>? { /* compiled code */ }

    internal final operator fun component17(): kotlin.Int { /* compiled code */ }

    public final operator fun component2(): kotlin.String? { /* compiled code */ }

    public final operator fun component3(): com.salesforce.marketingcloud.messages.Region? { /* compiled code */ }

    public final operator fun component4(): kotlin.String { /* compiled code */ }

    public final operator fun component5(): com.salesforce.marketingcloud.notifications.NotificationMessage.Sound { /* compiled code */ }

    public final operator fun component6(): kotlin.String? { /* compiled code */ }

    public final operator fun component7(): kotlin.String? { /* compiled code */ }

    public final operator fun component8(): kotlin.String? { /* compiled code */ }

    public final operator fun component9(): com.salesforce.marketingcloud.notifications.NotificationMessage.Type { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun custom(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun customKeys(): kotlin.collections.Map<kotlin.String, kotlin.String> { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun id(): kotlin.String { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun mediaAltText(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun mediaUrl(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun notificationId(): kotlin.Int { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun payload(): kotlin.collections.Map<kotlin.String, kotlin.String>? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun region(): com.salesforce.marketingcloud.messages.Region? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun requestId(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun sound(): com.salesforce.marketingcloud.notifications.NotificationMessage.Sound { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun soundName(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun subTitle(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun title(): kotlin.String? { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun trigger(): com.salesforce.marketingcloud.notifications.NotificationMessage.Trigger { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun type(): com.salesforce.marketingcloud.notifications.NotificationMessage.Type { /* compiled code */ }

    @kotlin.Deprecated @kotlin.jvm.JvmName public final fun url(): kotlin.String? { /* compiled code */ }

    @com.salesforce.marketingcloud.MCKeep public final enum class Sound private constructor() : kotlin.Enum<com.salesforce.marketingcloud.notifications.NotificationMessage.Sound> {
        CUSTOM,

        DEFAULT,

        NONE;
    }

    @com.salesforce.marketingcloud.MCKeep public final enum class Trigger private constructor() : kotlin.Enum<com.salesforce.marketingcloud.notifications.NotificationMessage.Trigger> {
        PUSH,

        GEOFENCE,

        BEACON;
    }

    @com.salesforce.marketingcloud.MCKeep public final enum class Type private constructor() : kotlin.Enum<com.salesforce.marketingcloud.notifications.NotificationMessage.Type> {
        OPEN_DIRECT,

        CLOUD_PAGE,

        OTHER;
    }
}

Как получить доступ к полю message? Заранее спасибо.

0
Ahmed S. Durrani 6 Июл 2021 в 07:39

1 ответ

Лучший ответ
    public final val alert: kotlin.String /* compiled code */

См. alert

2
Bill Mote 6 Июл 2021 в 15:12