Skip to content

Commit 7cb6f1a

Browse files
author
zengzhiwu
committed
set the default push method to Notification
1 parent d3601e8 commit 7cb6f1a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/cn/jpush/example/JPushClientExample.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,19 @@ private static void testSend() {
7272
Map<String, Object> extra = new HashMap<String, Object>();
7373
IOSExtra iosExtra = new IOSExtra(10, "WindowsLogonSound.wav");
7474
extra.put("ios", iosExtra);
75+
76+
/*
77+
* 通知、消息 两者区别。请参考:http://docs.jpush.cn/pages/viewpage.action?pageId=3309701
78+
*/
7579

76-
//对所有用户发送通知, 更多方法请参考文档
77-
MessageResult msgResult = jpush.sendCustomMessageWithAppKey(sendNo,msgTitle, msgContent);
78-
//MessageResult msgResult = jpush.sendNotificationWithAlias(sendNo, "a", msgTitle, msgContent);
79-
80+
81+
//对所有用户发送通知。
82+
MessageResult msgResult = jpush.sendNotificationWithAppKey(sendNo, msgTitle, msgContent);
83+
84+
//对所有用户发送消息。
85+
//MessageResult msgResult = jpush.sendCustomMessageWithAppKey(sendNo,msgTitle, msgContent);
86+
87+
8088
//覆盖指定msgId的消息,msgId可以从msgResult.getMsgid()获取。
8189
//MessageResult msgResult = jpush.sendNotificationWithAppKey(sendNo, msgTitle, msgContent, 0, extra,msgResult.getMsgid());
8290

0 commit comments

Comments
 (0)