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
137 stars 124 forks source link

Help request #186

Open jalys opened 1 year ago

jalys commented 1 year ago

Hello all dev,

I need some clue using this package, I would like to build an application that forward automatically received SMS Eveythings works perfectly in the foreground. I am struggling to access my data in the background context in his function :

onBackgroundMessage(SmsMessage message) { debugPrint("onBackgroundMessage called"); // i would like to get a list of phone numbers store in foreground. }

Could not figure out how to get some data from my app in this function . I tried riverpod, i tried singleton, i tried sharedpreference , i allways get null values.

i am new to flutter and android dev. seems the forground an background are "isolated" ... i feel lost. Any hints appreciated. Thanks all

jalys commented 1 year ago

is there a way communicationg using sendPort and receivePort between the main and background process ?

jalys commented 1 year ago

yes got it working with SendPort an receive port