watch-connectivity / react-native-watch-connectivity

Enable communication between apple watch app and react native
http://mtford.co.uk/react-native-watch-connectivity/
MIT License
713 stars 92 forks source link

Can I determine when the transfer info queue has finished processing? #124

Open cip123 opened 9 months ago

cip123 commented 9 months ago

First of all, thank you for creating this library.

I receive items from the watch using transferUserInfo, so I added a watch events listener.

The problem is that another operation depends on the items I receive. That operation runs when the application becomes active.

So, I would like to delay that operation until I make sure that the transfer info queue has finished processing or has no items.

Is there any way to check if there are any items in that queue?

cip123 commented 8 months ago

I guess what would be helpful is to have an async method called getPendingUserInfo()

cip123 commented 8 months ago

Looking at the code, I found _getMissedUserInfo; it looks like this is what I needed although it is marked private. I am going to give it a try.