Git Product home page Git Product logo

Comments (9)

TahaMalas avatar TahaMalas commented on July 18, 2024 1

Thanks for your kind response.

Actually while I was working on a sample to show you the code @mehdok I found the issue.

The issue was with my activity, it was extending FlutterActivity but the wrong one

So this was the import of the FlutterActivity:

import io.flutter.app.FlutterActivity

I changed it to the correct one:

import io.flutter.embedding.android.FlutterActivity

Also thanks @harsha-sira for contributing.

@mehdok I just have a question if I'm allowed to ask, is it possible to use another plugin like SharedPreferences while the device's location is updated from the background?

I tried to using this, but causing an error, that the plugin I'm using is not present because the app is terminated.

static void callback(LocationDto locationDto) async {
    print('location in dart: ${locationDto.toString()}');
    print('test long ${locationDto.longitude}, ${locationDto.latitude}');

    SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
    final SendPort send = IsolateNameServer.lookupPortByName(_isolateName);
    send?.send(locationDto);
  }

from background_locator.

TahaMalas avatar TahaMalas commented on July 18, 2024 1

Do you want me to open another issue for that?

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

Do you get compile time error or ide error?

from background_locator.

TahaMalas avatar TahaMalas commented on July 18, 2024

Do you get compile time error or ide error?

Sorry for not clarifying the issue, this is the issue I'm getting:

(No implementation found for method LocatorPlugin.initializeService on channel app.rekab/locator_plugin)

I'm getting it in runtime as soon as I call this function:

await BackgroundLocator.initialize();

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

Can you make a simple repository with this code? So I can run and see what is happening.

from background_locator.

harsha-sira avatar harsha-sira commented on July 18, 2024

@TahaMalas I also got the same error you got. but then I run the example code as it is and works like a charm. So this should be something wrong with your code.
I'll post again if I found the local issue which I face. it could be the same reason for both of us.

from background_locator.

harsha-sira avatar harsha-sira commented on July 18, 2024

@TahaMalas, Thanks for pointing out the solution. It was the same reason for me as well.

from background_locator.

mehdok avatar mehdok commented on July 18, 2024

@TahaMalas Glad to see the problem solved. Yes you can use other plugins while app is in background or terminated, follow the steps in Use other plugins in callback and let me know if you have any problem.

from background_locator.

TahaMalas avatar TahaMalas commented on July 18, 2024

@mehdok That's great it worked, thanks for your precious time and valuable package.

Also one last question the app sometimes crashes completely and shows this error from the android logcat not flutter's
Unable to start service rekab.app.background_locator.IsolateHolderService@5e93951 with null: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter intent

Any ideas?

from background_locator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.