Reputation: 187
I am trying to use Huawei Location Kit(Fused Location Service) to get longitude and latitude. But the response I get back are all null.
Then, I call the requestLocationUpdates() method to obtain the device location and update the cache. But I got PlatformException. May I know why?
My current code to use Huawei Location Kit:
Upvotes: 2
Views: 1182
Reputation: 34027
In the new Location kit 6.0.0 version, Non-Huawei Android phones support only Fused location capability. See Docs.
In addition, only some interfaces are supported. Docs link.
The requestLocationUpdates
interface you use here is not supported by Non-Huawei Android phones. You are advised to use the requestLocationUpdatesCb
interface instead.
Or you could use version 5.1.0.303
of the Flutter plug-in.
Upvotes: 0
Reputation: 51
I tried your code in the project, it seems working.
Can you check whether agconnect-services.json and key file is put in correct place like this:
Project screenshot:
and the API has been enabled in AppGallery Connect:
AGConnect Screenshot:
Upvotes: 2