Php 显示从GCM发送的多行通知

Php 显示从GCM发送的多行通知,php,android,Php,Android,我正在使用下面的PHP函数向android设备发送通知。我收到一行通知。如果有更多内容,如何将其修改为多行。android应用程序中没有通知布局或任何内容 public function send_notification($registatoin_ids, $message) { // Set POST variables $url = 'https://android.googleapis.com/gcm/send'; $fields = array(

我正在使用下面的
PHP
函数向android设备发送通知。我收到一行通知。如果有更多内容,如何将其修改为多行。android应用程序中没有通知布局或任何内容

public function send_notification($registatoin_ids, $message) {
    // Set POST variables
    $url = 'https://android.googleapis.com/gcm/send';

    $fields = array(
        'registration_ids' => $registatoin_ids,
        'data' => $message,
    );

    $headers = array(
        'Authorization: key=' . GOOGLE_API_KEY,
        'Content-Type: application/json'
    );
    // Open connection
    $ch = curl_init();

    // Set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    // Disabling SSL Certificate support temporarly
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));

    // Execute post
    $result = curl_exec($ch);
    if ($result === FALSE) {
        die('Curl failed: ' . curl_error($ch));
    }

    // Close connection
    curl_close($ch);
    echo $result;
}

BigTextStyle
设置为生成器

NotificationCompat.Builder notification = new NotificationCompat.Builder(context)
        ....set other stuff ....
        .setTicker(title)
        .setContentText(message)
        .setStyle(new NotificationCompat.BigTextStyle().bigText(message))
        .setContentText(message);

如果我理解了您的要求,那么您要查找的可能是wordwrap()函数。只需将发送给你的客户端的字符串包装起来。在你的android应用程序中,你正在构建通知。-(很可能是广播接收器)