我怎样才能收到使用GCM多个通知,而无需替换precedent吗? [英] How can I receive multiple notifications by using GCM without replacing the precedent one?
问题描述
我正在从GCM服务器接收通知的项目。
我已经得到了从GCM服务器的注册ID,我将其发送到我的服务器应用程序,将其保存在数据库中。
我的设备收到消息,但是当我尝试发送一个又一个,在precedent被替换。
我知道,我们已经2类型的消息:
- 在可折叠发送到同步
- 非可折叠
因此,没有改变消息的名字,我怎么能得到两个信息发送给在不同的时间?
更新1:
在我的设备处于脱机状态(例如机场模式激活),我尝试 派例如,从我的应用程序服务器,以谷歌2个消息 服务器(我读的谷歌存储所有的消息)。但是,当我 desactivate这种模式下,我只收到的最后一条消息发送。
我用不同的collapse_key针对不同的消息,我收到的所有 他们中的(当然,当设备在线)。
时的任何人知道我该如何解决这个问题?
您需要确保该collapse_key'字段的每个消息中的值是不同的。
I'm working on a project which receive notification from GCM server.
I've got the registration ID from GCM server and i send it to my server application which save it in the database.
My device receive the message but when I try to send another one, the precedent is replaced.
I know that we've 2 types of message:
- Collapsible "send to sync"
- Non-Collapsible
So without changing the name of the message, how can I get two message send at different time?
UPDATE 1:
When my device is offline (for example airport mode activated), I try to send for example 2 messages from my application server to Google server (I read that Google stores all the messages). But when I desactivate this mode, I receive only the last message sent.
I use different collapse_key for different message and I receive all of them (of course when the device online).
Is anybody knows how can I fix this?
You need to make sure that the value of the 'collapse_key' field in each message is different
这篇关于我怎样才能收到使用GCM多个通知,而无需替换precedent吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!