rostopira / flutter_nearby_messages

Flutter Nearby Messages plugin
Do What The F*ck You Want To Public License
10 stars 8 forks source link

adding Subscribe #1

Closed toklok closed 5 years ago

toklok commented 5 years ago

https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/Strategy

I'm enjoying your package and learning a lot, how could you go about adding a Strategy? It looks like Android just extends MessageListener but what if you wanted to do scanning in the background? It look's like iOS can use the Strategy Params, any light you can shed on this?

rostopira commented 5 years ago

Flutter actually doesn't support background very well, but yep, I can do that on weekend

rostopira commented 5 years ago

In case you want to do it yourself, here is reference for background work on Android: https://developers.google.com/nearby/messages/android/get-beacon-messages#subscribe_in_the_background

toklok commented 5 years ago

https://medium.com/flutter-io/executing-dart-in-the-background-with-flutter-plugins-and-geofencing-2b3e40a1a124

I've read this article, and I'm trying to slowly put the pieces together...

rostopira commented 5 years ago

Yeah, I've started with this article as well, but it's not universal and I actually did nearly the same in different way

toklok commented 5 years ago

In case you want to do it yourself, here is reference for background work on Android: developers.google.com/nearby/messages/android/get-beacon-messages#subscribe_in_the_background

thanks, It was as simple as just to passing a second parameter to the subscribe method.

Yeah, I've started with this article as well, but it's not universal and I actually did nearly the same in different way

I don't fully understand this part but I will try to ponder on this, otherwise, this resolves my question.