Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #7

Closed
wants to merge 1 commit into from
Closed

fix bug #7

wants to merge 1 commit into from

Conversation

undeadking
Copy link

安卓平台不能设置推送标题,原因是json结构错了

http://docs.jpush.cn/display/dev/Push-API-v3#Push-API-v3-android

before:

  "notification": {
    "platform": "android",
    "alert": "alert",
    "title": "title"
  }

after:

  "notification": {
    "android": {
      "alert": "alert",
      "title": "title"
    }
  }

can't set title in android,json structure wrong

http://docs.jpush.cn/display/dev/Push-API-v3#Push-API-v3-android

before:

```
  "notification": {
    "platform": "android",
    "alert": "alert",
    "title": "title"
  }
```

after:

```
  "notification": {
    "android": {
      "alert": "alert",
      "title": "title"
    }
  }
```
@xiezefan
Copy link
Contributor

你好,这并不是BUG,而是你在构建Notification的时候写错了。
构建Notification的时候,应该是这样
···
->setNotification(M\notification('Hi, JPush', M\android('Hi, android'), M\ios('Hi, ios', 'happy', 1, true)))
···
M\notification 的第一个参数为缺省的alert必填,其余参数为 M\android(), M\ios(), M\winphone()返回的对象,顺序无要求。

我猜你可能写成这样
···
->setNotification(M\android('Hi, android', 'Hi, Title'))
···
才回构建错误的JSON。在这点上,构建没有报错,的确算是个缺陷,在下一个版本将会修复这个缺陷。
感谢您的反馈与支持。
Ths。

@undeadking
Copy link
Author

明白了,我确实是这样写的.

这设计有点绕,文档的例子我没看明白,所以误会了用法

@undeadking undeadking closed this Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants