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

Android screen does not turn on when alarm goes off #257

Open
emanuelmarlon opened this issue Oct 17, 2024 · 28 comments
Open

Android screen does not turn on when alarm goes off #257

emanuelmarlon opened this issue Oct 17, 2024 · 28 comments
Assignees
Labels
android For Android only bug Something isn't working

Comments

@emanuelmarlon
Copy link

emanuelmarlon commented Oct 17, 2024

quando o alarme dispara que o aparelho ta bloqueado e a tela inativa(apagada) eu gostaria que ativasse a tela (ascender) mas nao conseguir fazer isso qual a configuração que faz com que a tela acorde ao disoparar o alarme? tentei isso android:showWhenLocked="true"
android:turnScreenOn="true" nao funcionou

@emanuelmarlon emanuelmarlon added the bug Something isn't working label Oct 17, 2024
@gdelataillade
Copy link
Owner

Hi @emanuelmarlon

Have you tried to enable androidFullScreenIntent ? Also make sure you carefully followed the Android installation steps: https://github.com/gdelataillade/alarm/blob/main/help/INSTALL-ANDROID.md

Let me know.

@gdelataillade
Copy link
Owner

Please write in English so everybody can understand.

@emanuelmarlon
Copy link
Author

quando o alarme dispara que o aparelho ta bloqueado e a tela inativa(apagada) eu gostaria que ativasse a tela (ascender) mas não conseguir fazer isso qual a configuração que faz com que a tela acorde ao disoparar o alarme? tentei isso android:showWhenLocked="true"
android:turnScreenOn="true" não funcionou

@emanuelmarlon
Copy link
Author

Oi@emanuelmarlon

Você tentou habilitar androidFullScreenIntent? Certifique-se também de ter seguido cuidadosamente os passos de instalação do Android: https://github.com/gdelataillade/alarm/blob/main/help/INSTALL-ANDROID.md

Avise.

yes I enabled

@emanuelmarlon
Copy link
Author

I just can't do that

Step 6
If you want to use the androidFullScreenIntent feature, some OEM (Samsung, Honor, Huawei, Xiaomi, Oppo, Asus, etc...) will require to grant the auto_start_flutter permission.

@gdelataillade
Copy link
Owner

I just can't do that

Step 6 If you want to use the androidFullScreenIntent feature, some OEM (Samsung, Honor, Huawei, Xiaomi, Oppo, Asus, etc...) will require to grant the auto_start_flutter permission.

Why not ?

@emanuelmarlon
Copy link
Author

Eu simplesmente não consigo fazer isso
Etapa 6 Se você quiser usar o recurso androidFullScreenIntent, alguns OEMs (Samsung, Honor, Huawei, Xiaomi, Oppo, Asus, etc...) exigirão a concessão da permissão auto_start_flutter .

Por que não ?

but I get this permission when the application is locked with the screen turned on the screen will activate (light up) I think I got the permission when I installed the apk to test it first the screen turned on but then it stopped I need that when the alarm goes off the screen turns on

@emanuelmarlon
Copy link
Author

image

@emanuelmarlon
Copy link
Author

Help me please, it's been over a month and I can't do it.

@gdelataillade
Copy link
Owner

First thing you could do is to try the example app of the package. If it works fine then it'd probably mean that the issue is from your code. Else, it'd mean that the error comes from the package or from the Android device.

Let me know.

@gdelataillade
Copy link
Owner

Clone the package repository and run the example Flutter app located in the example folder.

@emanuelmarlon
Copy link
Author

Clone o repositório de pacotes e execute o aplicativo Flutter de exemplo localizado na pasta de exemplo.

I cloned it and the behavior is the same when the cell phone is locked and the screen is off and the alarm goes off, the screen does not turn on (lights up). What I want to do on mine is that the screen turns on (lights up) when the alarm goes off and the screen is locked and turned off.

@gdelataillade
Copy link
Owner

  1. Have you granted auto-start permission ?
  2. What device do you use ?

@gdelataillade gdelataillade changed the title Ativação de tela Android screen does not turn on when alarm goes off Oct 18, 2024
@emanuelmarlon
Copy link
Author

  1. Você concedeu permissão de inicialização automática?
  2. Que dispositivo você usa?

What permission? What do you mean? What do I need to do so that when the alarm goes off and the screen is off, the screen turns on? What are the steps? I cloned the application the way I cloned it, I tested the alarm, everything works fine, just like mine, but the alarm goes off and the screen stays off. I tested it on several devices, several Androids 8,9,10,11,12,13,14.

@gdelataillade
Copy link
Owner

  1. Follow the android setup steps.
  2. Make sure AlarmSettings.androidFullScreenIntent is set to true.
  3. Set an alarm and turn you screen off. When alarm starts to ring, the screen turns on and ring screen is shown.

The auto-start permission package makes sure your device allows auto-start and fixes background problems.

@gdelataillade
Copy link
Owner

Demo of the example app:

trim.C6305039-A70E-4180-A02D-2100159C6E6E.MOV

@emanuelmarlon
Copy link
Author

Demo of the example app:

trim.C6305039-A70E-4180-A02D-2100159C6E6E.MOV
That's what I'm talking about, mine works that way because you didn't close the application completely, when the application is closed it doesn't come up like you left it minimized, see the link
https://drive.google.com/file/d/1amKJy3NiSDNR3yg99iUKreBYew6M0orv/view?usp=sharing

@gdelataillade
Copy link
Owner

It works even if app was killed:

trim.1AAA1DE7-AEFD-4D4A-B4CB-823C866CB22C.MOV

@emanuelmarlon
Copy link
Author

Funciona mesmo se o aplicativo for encerrado:

trim.1AAA1DE7-AEFD-4D4A-B4CB-823C866CB22C.MOV

That's what I want to do, I can't, the screen only turns on when I don't close the application completely, help me out

@gdelataillade
Copy link
Owner

I’m sorry to hear that you’re still experiencing this issue. This is the first time it’s been reported, so it might be specific to your setup.

Please double-check that both your app and device are properly configured. You might also want to try different troubleshooting steps to see if anything changes. Let me know if the problem persists, and I’ll do my best to assist further.

@gdelataillade gdelataillade added the android For Android only label Oct 21, 2024
@emanuelmarlon
Copy link
Author

Lamento saber que você ainda está enfrentando esse problema. Esta é a primeira vez que isso é relatado, então pode ser específico da sua configuração.

Por favor, verifique novamente se tanto seu aplicativo quanto seu dispositivo estão configurados corretamente. Você também pode tentar diferentes etapas de solução de problemas para ver se algo muda. Avise-me se o problema persistir, e farei o meu melhor para ajudar mais.

Thank you very much for your help and attention, just give me a light, I'm a beginner, what makes the light come on, where should I start, because I've already done so much, I'm already lost.

@emanuelmarlon
Copy link
Author

the auto start package doesn't work, is there another one I can use?
image

@gdelataillade
Copy link
Owner

You mean flutter_fgbg package ?

@emanuelmarlon
Copy link
Author

this how should i use?

@gdelataillade
Copy link
Owner

Can you send the error message as a text here please ?

@emanuelmarlon
Copy link
Author

I have this function

import 'package:flutter_fgbg/flutter_fgbg.dart';

Future segundoPlano1() async {
// Add your function code here!
// Add your logic here that should be executed in the background
// For example, you can perform a task like saving data, calling an API, etc.

print('Function segundoPlano1 called in the background.');

// Example: Simulating an asynchronous operation
await Future.delayed(Duration(seconds: 2)); // Simulating a task
print('Background task completed.');
} that I call in main is correct

@gdelataillade
Copy link
Owner

I think when I'll have the time I'll add the permission request directly in the package code so you can use it directly and it will stay up to date. Same for flutter_fgbg.

@emanuelmarlon
Copy link
Author

Thank you! It would be great to have these permissions and other things directly in the package because there are a lot of no-code people who come from Flutterflow and others who do not have full access to the source code and know nothing about code or almost nothing. For example, I use Flutterflow and it does not give full access to the code, so I have to export the code to Android Studio to be able to configure the package, but thank you for your attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android For Android only bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants