gpt4 book ai didi

android - 检索 GCM 消息 Intent 的 "content"。

转载 作者:搜寻专家 更新时间:2023-11-01 09:00:56 25 4
gpt4 key购买 nike

这是从服务器发送消息的方式:

        //Queue Android GCM Notification
_pushService.QueueNotification(NotificationFactory.AndroidGcm()
.ForDeviceRegistrationId(device)
.WithCollapseKey("LATEST")
.WithJson("{\"alert\":\"" + message + "\",\"badge\":\"7\"}"));

我收到了 Intent,我该如何获取消息?我试过了:

    Log.d(TAG, "" + intent.getStringExtra("{\"alert\":\""));
Log.d(TAG, "" + intent.getStringExtra("LATEST"));
Log.d(TAG, "" + intent.getStringExtra("data"));

都是null,消息文本值的key是什么?

最佳答案

明白了

Bundle b = intent.getExtras();
Set<String> allThatsInThere = b.keySet();

关于android - 检索 GCM 消息 Intent 的 "content"。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15021238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com