FlutterGeofencing icon indicating copy to clipboard operation
FlutterGeofencing copied to clipboard

iOS callback not working

Open archithakkar21 opened this issue 4 years ago • 5 comments

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

archithakkar21 avatar Sep 17 '20 04:09 archithakkar21

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

jackmew avatar Sep 28 '20 15:09 jackmew

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 avatar Sep 28 '20 16:09 jackmew

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 avatar Sep 29 '20 04:09 jackmew

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

jackmew avatar Sep 29 '20 08:09 jackmew

@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.

evanblasband avatar Jan 05 '21 22:01 evanblasband