json - Message notifications produce "This content can't be displayed" - TagMerge
4Message notifications produce "This content can't be displayed"Message notifications produce "This content can't be displayed"

Message notifications produce "This content can't be displayed"

Asked 5 months ago
84
4 answers

There are multiple "text"properties in the message structure. I believe the doc is referring to the top-level one outside all blocks definitions.

Example:

{
  "channel": "C1H9RESGL",
  "text": "Text here for notifications",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Danny Torrence left the following review for your property:"
      }
    }
  ]
}

Source: link

0

If you're using the slack api .chat_postMessage() python method to post blocks content you can get around the "This content can't be displayed" message by doing the following.

client = slack.WebClient(token=SLACK_API_KEY)

review_message = [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Danny Torrence left the following review for your property:"
      }
    }
  ]

client.chat_postMessage(channel=f'@{user_id}', text="New Review", blocks=review_message)

I know this is sort of outside of the scope here since the original poster used curl. But its not immediately clear how to get around this same problem if you are using the python .chat_postMessage() method.

Source: link

0

/opt/SUNWmsgsr/examples/jmqsdk/
'/opt/SUNWmsgsr/lib/libjmqnotify$plug-in_name'
configutil -o local.store.notifyplugin.jmqnotify.NewMsg.enable -v 1
configutil -o local.store.notifyplugin.jmq1.NewMsg.enable -v 1
configutil -o local.store.notifyplugin.jmq2.NewMsg.enable -v 1

Source: link

0

Groovy
val core_version = "1.6.0"
dependencies {
    implementation "androidx.core:core:$core_version"
}
Kotlin
val core_version = "1.6.0"
dependencies {
    implementation("androidx.core:core-ktx:$core_version")
}
Kotlin
var builder = NotificationCompat.Builder(this, CHANNEL_ID)
        .setSmallIcon(R.drawable.notification_icon)
        .setContentTitle(textTitle)
        .setContentText(textContent)
        .setPriority(NotificationCompat.PRIORITY_DEFAULT)
Java
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID)
        .setSmallIcon(R.drawable.notification_icon)
        .setContentTitle(textTitle)
        .setContentText(textContent)
        .setPriority(NotificationCompat.PRIORITY_DEFAULT);
Kotlin
var builder = NotificationCompat.Builder(this, CHANNEL_ID)
        .setSmallIcon(R.drawable.notification_icon)
        .setContentTitle("My notification")
        .setContentText("Much longer text that cannot fit one line...")
        .setStyle(NotificationCompat.BigTextStyle()
                .bigText("Much longer text that cannot fit one line..."))
        .setPriority(NotificationCompat.PRIORITY_DEFAULT)

Source: link

Recent Questions on json

    Programming Languages