rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 328 forks source link

callbackhandle value was Int. #264

Open argo1 opened 3 years ago

argo1 commented 3 years ago

Hi.

I encountered a problem that my initCallback was not called when I registered for location updates. After some investigation, I found out that the number value for my callback was small enough (2102889447) that it was "Int" not "Long". So this code:

(args[Keys.ARG_INIT_CALLBACK] as? Long)?.let { initCallbackHandle ->

ended up as null and the callback was not initialized. For testing, I changed this code to as? Int and everything worked fine. Might be that same problem exists with other callbacks.

mehdok commented 3 years ago

Hi @argo1 Thank you for opening an issue.

The problem is really strange. In theory Int should be castable to Long without any problem. I'll try to find a fix for this