50ButtonsEach/flic2lib-ios

button isReady state

Closed this issue · 9 comments

Hi,

After pairing the flic button the isReady becomes true as it should be. But the after i close the app and restart it again and connect to the button. I see that the function buttonIsReady is called but if i check button.isReady it stays false.

So isReady is only working the first time you pair the button after that it's always false and doesn't change anymore.

Yes, you are in fact correct! I verified this now myself. I already know what the issue is, so I'll make sure to include a fix in the next release.

Thank you for reporting this!

/A

Okey good to know. This also applies for android i think. But for now i fixed it by looking at connection state.

Emill commented

Hi. What issues did you notice in the Android library? Anything regarding getConnectionState?

Hi,

After pairing the flic button the isReady becomes true as it should be. But the after i close the app and restart it again and connect to the button. I see that the function buttonIsReady is called but if i check button.isReady it stays false.

So isReady is only working the first time you pair the button after that it's always false and doesn't change anymore.

Exactly this, but for now i've fixed it in my app by looking at connectionstate, that one is correct. So for the android lib isReady also stays false

Emill commented

Hello. In the Android lib for Flic 2 there is no isReady, so could you please clarify or write the line of code that does not work?

Thanks for the fast reply.

Oke i think i got confused because right now i'm working with both android and ios lib. There are some differences between the two. I was assuming that both work the same way. Is there a possibility that it could work exactly the same way? I can imagine this would be confusing for others to. This would help a lot when people are trying to get this working for both platforms.

Yes, it is true that iOS and Android have some slight differences in behavior. On Android the "Ready" state is represented by CONNECTION_STATE_CONNECTED_READY in the connection state, while on iOS it is a separate property isReady.

I don't think this will be changed right now.

Oke good to know thanks for the reply

This should be fixed with release 1.0.2.