Sending push messages with a new line character - Forum - Mobile - Progress Community

Sending push messages with a new line character

 Forum

Sending push messages with a new line character

  • It looks like that it we cannot send messages with a "enter"/new line character. What is the best way to achieve this? Replacing with \\n ?

  • If user sends Push via Rest API he/she should use symbol “\n"

    For example:

    POST:  https://api.<progress-domain>/rest/push/msg

    Headers:

    Content-Type:application/json

    X-Progress-Push-API-Key:<PUSH-API-KEY>

    Body:

    {

    "payload": {"badge": 2, "message": "line-1\nline-2"},

    "status": "sent",

    "schedule": {"scheduledTime": 0, "timeZone": 0}  

    }

    If user is trying to send message from admin push-page (“Mobile Applications Monitoring Dashboard”)

    he/she should just divide string using “Enter” key, f.e.:

    screencast.com/.../v1VOvv8QKOq

    If it does not work, please let me know what device do you use and its OS version.

  • For all the others, it is working with:

    message.replace(/(?:\r\n|\r|\n)/g, '\\n');

  • Hi Bal,

    I am sorry I don't understand what you mean under "for all the others"?

  • I mean the other readers here on the forum. Good to know for everybody how to handle these kind of issues. Thanks also for your support!