Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a way to config locator to starts when device is restarted ? #41

Closed
wemersonrv opened this issue Apr 21, 2020 · 8 comments
Closed
Labels
enhancement New feature or request

Comments

@wemersonrv
Copy link

Hello.

There is a way to config locator to starts when device is restarted ?

My app is to count hours user is in a specific place, so; when mobile is restarted, need to continue capture locations, even if user forgot to open the app to start the captures.

@anirudhsharma392
Copy link

@wemersonrv did you found any solution for this ??

@gpibarra
Copy link
Contributor

This was written on another issue:

#34 (comment)

@wemersonrv
Copy link
Author

@wemersonrv did you found any solution for this ??

Hello. Nope. Unfortunately I couldn't.

This was written on another issue:

#34 (comment)

As @mehdok says on the quoted comment below, it don't has a way to do that... Will need to count on user to reopen app/service to restart captures.

@mehdok mehdok added the enhancement New feature or request label Apr 26, 2020
mehdok added a commit that referenced this issue Apr 26, 2020
* #34 #41 Restart locator service after reboot;

* #42 Fix triggering android notification callback with wrong notification;
@mehdok mehdok closed this as completed Apr 26, 2020
@mehdok
Copy link
Collaborator

mehdok commented Apr 26, 2020

@wemersonrv
Copy link
Author

wemersonrv commented Apr 29, 2020

Restart-service-on-device-reboot

@mehdok Not works here. Did i miss something?!

Below my AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="br.myapp">

    <!-- App permissions -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <!-- Background Location permissions -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>


    <application
        android:name="br.myapp.LocationService"
        android:label="My App"
        android:icon="@mipmap/ic_launcher">

        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
           android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <!-- Background Location configuration -->
        <receiver
            android:name="rekab.app.background_locator.LocatorBroadcastReceiver"
            android:enabled="true"
            android:exported="true"/>
        <service
            android:name="rekab.app.background_locator.LocatorService"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:exported="true"/>
        <service
            android:name="rekab.app.background_locator.IsolateHolderService"
            android:permission="android.permission.FOREGROUND_SERVICE"
            android:exported="true"/>
		<receiver android:name="rekab.app.background_locator.BootBroadcastReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>

        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

@wemersonrv
Copy link
Author

Sorry! My bad!

after about 40 seconds he started the background locator.

Is alive! bwahahahahahahah!

@pkuzco
Copy link

pkuzco commented May 4, 2020

Is relaunching the service on device reboot supported on iOS?

I see that this plugin calls startMonitoringSignificantLocationChanges on iOS which based on Apple's documentation, the service should be relaunched after a significant location change of 500m or more.
Has anybody tested that this feature works on iOS? I tried both on the emulator and real device - doesn't work on either.

@wemersonrv
Copy link
Author

Is relaunching the service on device reboot supported on iOS?

I see that this plugin calls startMonitoringSignificantLocationChanges on iOS which based on Apple's documentation, the service should be relaunched after a significant location change of 500m or more.
Has anybody tested that this feature works on iOS? I tried both on the emulator and real device - doesn't work on either.

This specific feature @mehdok make is for android only...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants