Skip to content
欢迎扫码关注公众号

快应用小米推送消息 IOException

后台服务使用 MixPush 发送推送消息,VIVO 是可以正常发送的,但是在发送小米推送消息时总是报如下错误:

java.io.IOException: Failed to send http request after 4 attempts: remote server api.xmpush.xiaomi.com(118.26.252.219)

起初以为是网络问题或者 HTTPS 协议的问题,最终在官方文档上发现快应用调用的接口是不一样的。

快应用发送 RegId 消息时必须使用 sendHybridMessageByRegId(message, regids, retries) 方法,另外发送 Topic 消息时需使用 broadcastHybridAll(message, retries) 方法。

代码 fork 下来,把 MiPushProvider 中对应的方法修改为快应用对应的方法就可以了。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.