简体   繁体   English

推送通知不适用于 android 代号one

[英]Push notification not working on android codenameone

I followed this tutorial https://www.codenameone.com/manual/push.html and registered my application with Display.getInstance().registerPush();我按照本教程https://www.codenameone.com/manual/push.html并使用 Display.getInstance().registerPush() 注册了我的应用程序;

I am doing tests with a rest post我正在使用 rest 帖子进行测试

curl --location --request POST 'https://push.codenameone.com/push/push?token=34C35DCB-XXX-4A56-XXXX-XXXXXX&device=cn1-fcm-e9Xvk0mdGdc:APAXXXXX-XXXXXXXXXX-7-z3Ax7HNkeEvcvCl3_1zQdBbxurWcUSMenXFJgM2w0UTRE0ziUz_N7TIzxOOblktGSPsEmCH7q09pJQJ1v0mQZO7LNvyP4UEOlsdRds&auth=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX&type=3&body=test' 

I am getting this answer:我得到这个答案:

[
    {
        "id": "XXXXXXXXXXXXXXXXXXXXXX",
        "status": "OK"
    }
]

But nothing on the phone.但是电话里什么都没有。 I have to mention that the app was installed as APK not from the play store我不得不提一下,该应用程序是作为 APK 安装的,而不是来自 Play 商店

Type 3 is a mix of hidden and visible types.类型 3 是隐藏类型和可见类型的混合。 Try type 1 which is 100% visible push notification or if you use type 3 use a semicolon to separate the hidden payload and the visible portion in your data.尝试类型 1,它是 100% 可见的推送通知,或者如果您使用类型 3,请使用分号分隔隐藏的有效负载和数据中的可见部分。

See this under "Push Types and Message Structure".参阅“推送类型和消息结构”下的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM