iOS端如何让推送内容自动换行?

问题详述

iOS端如何让推送内容自动换行?

示例图如下:png

问题解答

在 body 里的字符串中添加 \n 达到换行的效果 ,代码示例如下 :

  1. {
  2. "aps": {
  3. "alert": {
  4. "title": "title",
  5. "subtitle": "subtitle",
  6. "body": "This is some fancy message. \nThis is some fancy message. \nThis is some fancy message. \nThis is some fancy message. "
  7. },
  8. "badge": 1,
  9. "sound": "default",
  10. "category": "test_category",
  11. "mutable-content": 1
  12. },
  13. "key1":"value1",
  14. "key2":"value2"
  15. }