bkonyi / FlutterGeofencing

Rough work for Flutter geofencing plugin
BSD 3-Clause "New" or "Revised" License
337 stars 219 forks source link

iOS callback not working #68

Open archithakkar21 opened 3 years ago

archithakkar21 commented 3 years ago

In iOS callback method is not working so unable to send data to IsolateNameServer port and retrieve data

jackmew commented 3 years ago

same problem here. Android work well. but iOS doesn't response anything.

jackmew commented 3 years ago

oh... i got it. For Android, if you are inside the geofencing, Android will trigger enter. For iOS, if you are inside geofencing, iOS doesn't trigger. You need to really outside the geofencing area, than enter the geofencing area, than it can trigger..!

How to test:

  1. iOS simulator in the beginning, set your current location far away, at least outside geofencing area.
  2. set your custom location inside the geofencing area.

version: geofencing-0.1.0

Screen Shot 2020-09-29 at 00 25 10
jackmew commented 3 years ago

The comment above is about running example and the different geofencing behavior in iOS & Android.

I still encounter problem how to install geofencing plugin in my ios flutter.

This is how i solve:

Info.plist -

Screen Shot 2020-09-29 at 11 58 51

AppDelegate - I choose swift.. but official example is Objective-c. I am not familiar with both. just try and success.

Screen Shot 2020-09-29 at 12 00 12

success

Screen Shot 2020-09-29 at 11 53 57
jackmew commented 3 years ago

example android working well.

But have problem install android..

The Readme about how to install geofencing plugin in android mislead me.

At first, i try to create Application.kt. but encounter same problem here: pluginregistry-cannot-be-converted-to-flutterengine

and i find that geofencing plugin doesn't follow the new flutter plugin style plugin-api-migration.

This is what i did: add geofencing ^0.1.0 into pubspec.yaml pub get it will automatically add geofencing plugins:

Screen Shot 2020-09-29 at 16 17 57

add broadcasReceiver & GeofencingService:

Screen Shot 2020-09-29 at 16 12 31

encounter a problem:

Screen Shot 2020-09-29 at 16 00 21

fix it by modify geofencing dependency : com.google.android.gms:play-services-location:17+ to 17.0.0

origin:

Screen Shot 2020-09-29 at 15 58 30

after:

Screen Shot 2020-09-29 at 15 58 19

success

2020-09-29 16 14 53

Screen Shot 2020-09-29 at 16 03 39
evanblasband commented 3 years ago

@jackmew having a similar issue on android regarding the plugin registry flutter engine conflict. What exactly was your fix? did you add anything to the Application.java (or .kt) like in the README? aside from changing the play services location version in the build.gradle.

UPDATE: nvm this did it for me.