Azure/azure-notificationhubs-java-backend

[BUG] Can not send message to Baidu PNS server.

Opened this issue · 0 comments

Describe the bug
We are using 21v Azure China, and use Notification hub to push messages to Baidu PNS.
Now, we can use following code to push messages to Baidu PNS, and Android devices can received notifications:

        BaiduNotification messageType1 = new BaiduNotification("{\"title\":\"test title\", \"description\":\"test description\"}");
        Notification messageType2 = Notification.createBaiduNotification("{\"title\":\"test title\", \"description\":\"test description\"}");

But actually, we want to use template send, as we need to both support to push notifications to APNS.
So I write the following codes:

        Map<String, String> prop =  new HashMap<String, String>();
        prop.put("title", "测试2023");
        prop.put("description", "测试描述2023");
        Notification messageType3 = Notification.createTemplateNotification(prop);
        
        NotificationOutcome outcome = hub.sendNotification(messageType3);

But refer to my testing, can not use template to send messages to Baidu PNS.

Exception or Stack Trace
Add the exception log and stack trace if available

No error, but my device can not receive notifications.

To Reproduce
Steps to reproduce the behavior:

Please see my codes.

Expected behavior
A clear and concise description of what you expected to happen.

My android device can receive notifications.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. Windows 10, macOS 10.15] Win 11
  • IDE : [e.g. IntelliJ 2020.2] Android Studio + IntelliJ
  • Version of the Library used: latest 1.1.0

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issue as an incomplete report. Please do not provide any private information in this bug report.

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added