shounakmulay / Telephony

Flutter plugin for telephony features like query device sms directory, listen for incoming messages, retrieve various network parameters, etc.
https://telephony.shounakmulay.dev
MIT License
138 stars 126 forks source link

I can't receive SMS in the background #150

Closed JesterVZ closed 1 year ago

JesterVZ commented 2 years ago

Hi. On the emulator and during usb debugging, they are accepted in the background, however, NOTHING happens on the release. The onBackgroundMessage function doesn't even fire. Thanks in advance for your reply.

hamsadev commented 1 year ago

Hi. On the emulator and during usb debugging, they are accepted in the background, however, NOTHING happens on the release. The onBackgroundMessage function doesn't even fire. Thanks in advance for your reply.

I faced the same problem. Did you find a solution for it?

EngOmarDr commented 1 year ago

Hi. On the emulator and during usb debugging, they are accepted in the background, however, NOTHING happens on the release. The onBackgroundMessage function doesn't even fire. Thanks in advance for your reply.

I faced the same problem. Did you find a solution for it?

I faced the same problem. Did you find a solution for it ?

hamsadev commented 1 year ago

Hi. On the emulator and during usb debugging, they are accepted in the background, however, NOTHING happens on the release. The onBackgroundMessage function doesn't even fire. Thanks in advance for your reply.

I faced the same problem. Did you find a solution for it?

I faced the same problem. Did you find a solution for it ?

As I found out, If you exit the app, it will be killed and no longer exist in the background. I created a background service using the flutter_background_service package, and with this, the app was no longer killed and correctly received SMS in the background.

msaadev commented 1 year ago

@hamsaco how you fix it could you share

JesterVZ commented 1 year ago

Hi. On the emulator and during usb debugging, they are accepted in the background, however, NOTHING happens on the release. The onBackgroundMessage function doesn't even fire. Thanks in advance for your reply.

I faced the same problem. Did you find a solution for it?

Yes, I rewrote everything in kotlin, since the task was small)) And so, this is a flutter problem, which cannot normally launch and maintain background processes. Well, either I don't know something :)