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
Post a Comment