File tree Expand file tree Collapse file tree
src/main/java/com/huawei/push/examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public void sendToCondition() throws HuaweiMesssagingException {
5151 JSONObject titleKey = new JSONObject ();
5252 titleKey .put ("en" ,"好友请求" );
5353 JSONObject bodyKey = new JSONObject ();
54- titleKey .put ("en" ,"My name is %s, I am from %s." );
54+ bodyKey .put ("en" ,"My name is %s, I am from %s." );
5555 multiLangKey .put ("key1" , titleKey );
5656 multiLangKey .put ("key2" , bodyKey );
5757
@@ -66,9 +66,9 @@ public void sendToCondition() throws HuaweiMesssagingException {
6666 .setDefaultSound (true )
6767 .setTag ("tagBoom" )
6868 .setClickAction (ClickAction .builder ().setType (2 ).setUrl ("https://www.huawei.com" ).build ())
69- .setBodyLocKey ("M.String.body " )
69+ .setBodyLocKey ("key2 " )
7070 .addBodyLocArgs ("boy" ).addBodyLocArgs ("dog" )
71- .setTitleLocKey ("M.String.title " )
71+ .setTitleLocKey ("key1 " )
7272 .addTitleLocArgs ("Girl" ).addTitleLocArgs ("Cat" )
7373 .setChannelId ("Your Channel ID" )
7474 .setNotifySummary ("some summary" )
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public void sendNotification() throws HuaweiMesssagingException {
5252 JSONObject titleKey = new JSONObject ();
5353 titleKey .put ("en" ,"好友请求" );
5454 JSONObject bodyKey = new JSONObject ();
55- titleKey .put ("en" ,"My name is %s, I am from %s." );
55+ bodyKey .put ("en" ,"My name is %s, I am from %s." );
5656 multiLangKey .put ("key1" , titleKey );
5757 multiLangKey .put ("key2" , bodyKey );
5858
@@ -67,9 +67,9 @@ public void sendNotification() throws HuaweiMesssagingException {
6767 .setDefaultSound (true )
6868 .setTag ("tagBoom" )
6969 .setClickAction (ClickAction .builder ().setType (2 ).setUrl ("https://www.huawei.com" ).build ())
70- .setBodyLocKey ("M.String.body " )
70+ .setBodyLocKey ("key2 " )
7171 .addBodyLocArgs ("boy" ).addBodyLocArgs ("dog" )
72- .setTitleLocKey ("M.String.title " )
72+ .setTitleLocKey ("key1 " )
7373 .addTitleLocArgs ("Girl" ).addTitleLocArgs ("Cat" )
7474 .setChannelId ("Your Channel ID" )
7575 .setNotifySummary ("some summary" )
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public void sendTestMessage() throws HuaweiMesssagingException {
4646 JSONObject titleKey = new JSONObject ();
4747 titleKey .put ("en" ,"好友请求" );
4848 JSONObject bodyKey = new JSONObject ();
49- titleKey .put ("en" ,"My name is %s, I am from %s." );
49+ bodyKey .put ("en" ,"My name is %s, I am from %s." );
5050 multiLangKey .put ("key1" , titleKey );
5151 multiLangKey .put ("key2" , bodyKey );
5252
@@ -61,9 +61,9 @@ public void sendTestMessage() throws HuaweiMesssagingException {
6161 .setDefaultSound (true )
6262 .setTag ("tagBoom" )
6363 .setClickAction (ClickAction .builder ().setType (2 ).setUrl ("https://www.huawei.com" ).build ())
64- .setBodyLocKey ("M.String.body " )
64+ .setBodyLocKey ("key2 " )
6565 .addBodyLocArgs ("boy" ).addBodyLocArgs ("dog" )
66- .setTitleLocKey ("M.String.title " )
66+ .setTitleLocKey ("key1 " )
6767 .addTitleLocArgs ("Girl" ).addTitleLocArgs ("Cat" )
6868 .setChannelId ("Your Channel ID" )
6969 .setNotifySummary ("some summary" )
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public void sendToTopic() throws HuaweiMesssagingException {
5151 JSONObject titleKey = new JSONObject ();
5252 titleKey .put ("en" ,"好友请求" );
5353 JSONObject bodyKey = new JSONObject ();
54- titleKey .put ("en" ,"My name is %s, I am from %s." );
54+ bodyKey .put ("en" ,"My name is %s, I am from %s." );
5555 multiLangKey .put ("key1" , titleKey );
5656 multiLangKey .put ("key2" , bodyKey );
5757
@@ -66,9 +66,9 @@ public void sendToTopic() throws HuaweiMesssagingException {
6666 .setDefaultSound (true )
6767 .setTag ("tagBoom" )
6868 .setClickAction (ClickAction .builder ().setType (2 ).setUrl ("https://www.huawei.com" ).build ())
69- .setBodyLocKey ("M.String.body " )
69+ .setBodyLocKey ("key2 " )
7070 .addBodyLocArgs ("boy" ).addBodyLocArgs ("dog" )
71- .setTitleLocKey ("M.String.title " )
71+ .setTitleLocKey ("key1 " )
7272 .addTitleLocArgs ("Girl" ).addTitleLocArgs ("Cat" )
7373 .setChannelId ("Your Channel ID" )
7474 .setNotifySummary ("some summary" )
You can’t perform that action at this time.
0 commit comments