-
Notifications
You must be signed in to change notification settings - Fork 111
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
not working in deep sleep #132
Comments
Hi!
From: Shashi Kiran Katkam ***@***.***>
Sent: luni, 26 august 2024 14:16
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
hi @sd-timaru <https://github.com/sd-timaru> can you show me your AndroidManifest.xml file ?
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABGXRXT2N6U57URDXNDZTMFADAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBZHE2TSNBRGU> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
hi @sd-timaru can you show me your AndroidManifest.xml file ? |
Hi !
This is my your AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.ganisdev.ganispro">
<!-- Required for sending SOS -->
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
<uses-permission android:name="android.permission.SEND_SMS" />
<!-- Required for others -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="com.android.vending.BILLING"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE"/>
<uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<!-- de vazut daca ajuta la prevenirea hibernarii -->
<uses-permission android:name="android.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS"
tools:ignore="ProtectedPermissions"/>
<queries>
<package android:name="com.google.android.apps.maps"/>
<package android:name="com.here.app.maps"/>
<package android:name="com.nng.igoprimong.nextgen"/>
<package android:name="com.nng.igoprimong.gift"/>
<package android:name="com.nng.igo.primong.igoworld"/>
<package android:name="menion.android.locus.pro"/>
<package android:name="menion.android.locus"/>
<package android:name="com.mapswithme.maps.pro"/>
<package android:name="com.sygic.aura"/>
<package android:name="com.waze"/>
<package android:name="com.google.android.gms"/>
</queries>
<application
tools:replace="android:label"
android:label="Ganis Pro"
android:name="${applicationName}"
***@***.***/ic_launcher"
android:allowBackup="false"
android:requestLegacyExternalStorage="true"
android:preserveLegacyExternalStorage="true"
android:fullBackupContent="false">
<!--Set activity launchMode to singleTask, if you want to prevent creating new activity instance everytime there is a new intent.-->
<!--a fost singleInstance; daca nu e in regula de anulat import kml si json pt >=10-->
<activity
android:name=".MainActivity"
android:showWhenLocked="true"
android:turnScreenOn="true"
android:exported="true"
android:launchMode="singleTask"
android:taskAffinity=""
***@***.***/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
***@***.***/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/*"/>
</intent-filter>
<!-- pt ganisdev.com://-->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="ganisdev.com"
android:pathPrefix="/addFriend"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="ganisdev.com"
android:pathPrefix="/addToGroup"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="ganisdev.com"
android:pathPrefix="/addPoint"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="www.google.com"
android:pathPrefix="/maps"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="geo"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/json" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/json" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<service android:name="yukams.app.background_locator_2.IsolateHolderService"
android:permission="android.permission.FOREGROUND_SERVICE"
android:exported="true"
android:stopWithTask="true"
android:foregroundServiceType = "location"/>
<service android:name="yukams.app.background_locator_2.LocatorService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="true"
android:stopWithTask="true"/>
<!-- 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>
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
<intent>
<action android:name="android.action.start.flutter.activity" />
</intent>
</queries>
</manifest>
From: Shashi Kiran Katkam ***@***.***>
Sent: marți, 27 august 2024 15:01
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
hi @sd-timaru <https://github.com/sd-timaru> can you show me your AndroidManifest.xml file ?
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABHA7SOMIMNWJ72EAM3ZTRTBTAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGM3TCOBQGA> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AKRKABFGB4YGDFL7OOZSXUTZTRTBTA5CNFSM6AAAAABM7Y6B52WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUJ2P7FQ.gif> Message ID: ***@***.*** ***@***.***> >
|
how u are requesting user using |
With the package permission_handler: ^11.0.1
and requesting Permission.locationAlways
From: Shashi Kiran Katkam ***@***.***>
Sent: marți, 27 august 2024 15:16
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
how u are requesting user using
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABGQGFQJKXKD24BS43DZTRUXLAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGQYDEMBYGI> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AKRKABG3SJADQOT2BL3FIHTZTRUXLA5CNFSM6AAAAABM7Y6B52WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUJ2R2KE.gif> Message ID: ***@***.*** ***@***.***> >
|
what is ur |
The default, 60 min:
androidSettings: AndroidSettings(
accuracy: LocationAccuracy.NAVIGATION,
interval: 1,
distanceFilter: 0,
client: locationClient,
androidNotificationSettings: const AndroidNotificationSettings(
notificationChannelName: 'GanisPro_BackGps',
notificationTitle: 'Ganis Pro',
notificationMsg: 'Requesting GPS location...',
notificationBigMsg:
'Retreiving background location...', //
notificationIcon: 'app_icon',
notificationIconColor: Colors.grey,
notificationTapCallback: notificationCallback)
)
From: Shashi Kiran Katkam ***@***.***>
Sent: marți, 27 august 2024 15:24
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
what is ur
wakeLockTime how much u given ?
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABB7QCZIT2PGBMMTOSDZTRVVFAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGQYTQOBQHE> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AKRKABGCR7CNYP3Z7V6HKSTZTRVVFA5CNFSM6AAAAABM7Y6B52WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUJ2S27S.gif> Message ID: ***@***.*** ***@***.***> >
|
have you tried using wakeLockTime = 1440 |
No!
But why do I need 24 hours to expect the gps data?
From: Shashi Kiran Katkam ***@***.***>
Sent: marți, 27 august 2024 15:28
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
have you tried using wakeLockTime = 1440
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABCHIGCBXCSCJF5UWI3ZTRWGJAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGQZDQMRVGA> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
if you have to keep alive the plugin, But the default wakelocktime is 60, we can't set wakeLockTime=0 using these plugin and can you explain what is use of setting The default 60 min: |
I know!
But now, with the default setting, the wakelocktime is 60. Which means 60 minutes. More than enough time to receive de gps data.
From my testing, if the device is inside a building, it takes only couple minutes to retrieve de gps location (even if the app is in background).
The problem is when the device is in deep sleep (it was not used at all for hours). The app receives the “command” to get the location, but, I think, the device (for some reason) is not starting to retrieve the location…
From: Shashi Kiran Katkam ***@***.***>
Sent: marți, 27 august 2024 15:35
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
if you have to keep alive the plugin,
But the default wakelocktime is 60, we can't set wakeLockTime=0 using these plugin
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABD47GCDYAFHYVYE2QDZTRXA3AVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGQ2DGMBYG4> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I tried with wakeLockTime = 1440
Still not working when the device is in deep sleep.
From: Shashi Kiran Katkam ***@***.***>
Sent: marți, 27 august 2024 15:28
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
have you tried using wakeLockTime = 1440
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABCHIGCBXCSCJF5UWI3ZTRWGJAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGQZDQMRVGA> .
You are receiving this because you were mentioned.
|
Hi @sd-timaru, to prevent your device from entering deep sleep mode, you can visit Don't Kill My App. Some mobile phones have an 'Advanced Optimization' feature that includes a setting called 'Sleep Standby Optimization.' Ensure this is turned off to prevent your app from being affected. Also, could you let me know the name of the device you're using? . |
Hi!
I know that page for a long time and I did everything possible that my app meets all those conditions.
As result, my app is never killed by Android. Even when the device is in deep sleep for days, the app receives all the Firebase messages and processes them. It even send’s back data to other users!
These are the logs from my app:
1.When the app is in background, but the device IS NOT in deep sleep:
2024-08-28 19:00:43.375238
Message received from isolate: {createdAt: 2024-08-28T16:00:45.426Z, gpsId: 1kP8gqJhpW_P1HfJgH2OF, fcmId: RmzN5Ux69dBLFz5, awaitingTime: 300, fcmName: HPwxOolnWW, fcmEmail: 77600903b39264fe37b19ec7d5fd296a1c9696, creatorData: 321220116585063200128258, type: friend}
2024-08-28 19:00:43.379399
origin: isolate, fcmAction: send_location
2024-08-28 19:00:43.396700
origin: isolate, handleSendLocation, type: friend
2024-08-28 19:00:43.498881
origin: isolate, handleSendLocation, starting timer, timerSeconds: 595, awaiting until: 2024-08-28 19:10:45.426
2024-08-28 19:00:43.558555
origin: isolate, getBackgroundGpsLocation, from handleSendLocation, functWaitingTimeSec: 600
2024-08-28 19:00:43.570844
origin: isolate, getBackgroundGpsLocation, accuracy: 100
2024-08-28 19:00:43.589793
origin: isolate, starting BackGpsService, locationClient: LocationClient.google
2024-08-28 19:00:56.476765
origin: isolate, Gps location retreived after awaiting 12sec. (acc received: 20.8700008392334, positionAccuracyEspected: 100, lat, long: 47.159075, 27.6182036, locationsReceived: 3).
2024-08-28 19:00:56.486581
origin: isolate, stopping BackGpsService from requestGpsLocationForGroup....
2024-08-28 19:00:57.503239
origin: isolate, BackGpsService stopped
2024-08-28 19:00:57.610337
f_handleGpsLocationRetreived: locationWaitingList is not empty, delivering....
2024-08-28 19:00:57.639170
origin: isolate, f_handleGpsLocationRetreived: Deliver coordinates to GROUP, MEMBER, FRIEND!
2024-08-28 19:00:57.643443
origin: isolate, deliverCurrentLocation to friend: position!
2024-08-28 19:00:57.823985
origin: isolate, deliverCurrentLocationAsFriend, type: friend, requesterId: RmzN5Ux69dBLFz5, gpsId: 1kP8gqJhpW_P1HfJgH2OF
2024-08-28 19:00:58.444537
handleReceivedLocationAsFriend fcm sent ()!
As you can see, it took only 12 sec to retrieve 3 consecutive gps locations!
2.When the app is in background, but the device IS in deep sleep:
2024-08-28 21:45:43.251397
Message received from isolate: {createdAt: 2024-08-28T18:45:45.174Z, gpsId: 1kP8gqJhpW_cwjP15MluM, fcmId: RmzN5Ux69dBLFz5, awaitingTime: 300, fcmName: RhHGnS2Oml, fcmEmail: 77600903b39264fe37b19ec7d5fd296a1c9696, creatorData: 367016798041434015654, type: friend}
2024-08-28 21:45:43.255982
origin: isolate, fcmAction: send_location
2024-08-28 21:45:43.281239
origin: isolate, handleSendLocation, type: friend
2024-08-28 21:45:43.385575
origin: isolate, handleSendLocation, starting timer, timerSeconds: 595, awaiting until: 2024-08-28 21:55:45.174
2024-08-28 21:45:43.444180
origin: isolate, getBackgroundGpsLocation, from handleSendLocation, functWaitingTimeSec: 600
2024-08-28 21:45:43.453128
origin: isolate, getBackgroundGpsLocation, accuracy: 100
2024-08-28 21:45:43.469526
origin: isolate, starting BackGpsService, locationClient: LocationClient.google
2024-08-28 21:55:38.900369
origin: isolate, startTimerForSendLocation: after timer expired, fcmPrefs containsKey(GanisPro_1kP8gqJhpW_cwjP15MluM_timer
2024-08-28 21:55:38.934165
origin: isolate, stopping BackGpsService from startTimerForSendLocation....
2024-08-28 21:55:39.955909
origin: isolate, BackGpsService stopped
2024-08-28 21:55:40.073758
origin: isolate, deliverCurrentLocation to friend, error: retrieval_timeout2
2024-08-28 21:55:40.374198
origin: isolate, deliverCurrentLocationAsFriend, type: friend, requesterId: RmzN5Ux69dBLFz5, gpsId: 1kP8gqJhpW_cwjP15MluM
2024-08-28 21:55:40.837864
handleReceivedLocationAsFriend fcm sent ()!
As you can see, in 10 minutes no location! But the application sent a response to the user who made the request that it failed to obtain the GPS location in the maximum available time! And that message was received by the requester.
(For functionality reasons, the app can wait maximum 10 minutes for a gps location with maximim 100m accuracy).
I must repeat myself: the app is working very well, the background_locator2 plugin is not able to make the Android to retrieve the location when the device is in deep sleep! Not even a single location in 10 minutes!
From: Shashi Kiran Katkam ***@***.***>
Sent: miercuri, 28 august 2024 08:18
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
hi @sd-timaru <https://github.com/sd-timaru> to avoid this deep sleep mode you can visit : https://dontkillmyapp.com/.
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABAW5YEQQUPLD26QQU3ZTVMRDAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJUGMZTMMRWGY> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
hi @sd-timaru without |
Without
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
the app could not request permission location always
From: Shashi Kiran Katkam ***@***.***>
Sent: miercuri, 4 septembrie 2024 09:04
To: Yukams/background_locator_fixed ***@***.***>
Cc: sd-timaru ***@***.***>; Mention ***@***.***>
Subject: Re: [Yukams/background_locator_fixed] not working in deep sleep (Issue #132)
hi @sd-timaru <https://github.com/sd-timaru> without these <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/> permission these plugin won't work ?
—
Reply to this email directly, view it on GitHub <#132 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKRKABCI5JNXUSS2YATI7IDZU2PFPAVCNFSM6AAAAABM7Y6B52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRXHE4TAMJQGY> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi!
I have an app that sends the device location upon request. If the location is not retrieved in an specified amount of time, the app sends an notification message.
All works fine if the app is in foreground or background (even after device restart). But, if the device is in deep sleep (not used at all for hours) the app always send the message that the location was not retrieved in the specified time.
In the app logs I see that the background service is started, but no gps data is retrieved.
Any idea on how to solve this?
Thanks!
The text was updated successfully, but these errors were encountered: