android - How can I receive pending messages using google nearby API? -


i able send message 1 user using google nearby api. however, according guidelines having device in subscribe/publish state uses 2.5-3.5 times more battery usual. therefore recommend subscribe/publish once activity enters foreground. means, unless 2 devices have app on screen @ same time, not able send/receive messages 1 another. user enter foreground, send message, , when user b enters foreground, them see message.

the ideal scenario perform firechat (https://play.google.com/store/apps/details?id=com.opengarden.firechat&hl=en). send/receive messages real time. leaving subscribing/publishing in background time regardless of battery consumption?

i add ultimate goal able make frictionless (no pairing necessary) chat between people nearby 1 (capable of reaching 30m distance). if there better way in general interesting hear.

i user enter foreground, send message, , when user b enters foreground, them see message. 

that's how works. each message has ttl (time live) attribute set 300 seconds default (see: strategy). long message live (meaning ttl still valid and user didn't unpublish it), user b able find after subscribes.

the whole concept of messaging nearby api should perceived publish-discover flow rather standard send-receive communication.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -