Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

SMS deletion #33

Open
chrisrohitbrendan opened this issue Sep 26, 2018 · 15 comments
Open

SMS deletion #33

chrisrohitbrendan opened this issue Sep 26, 2018 · 15 comments

Comments

@chrisrohitbrendan
Copy link

Library is great for querying, reading and sending messages but completely skipped deletion.
Also a broadcast receiver would be needed to show SMS notifications.

Could the SmsMessage.id be used to access the content provider to remove the specific message?

Also was getting a deprecated notification for the Telephony Manager, not able to reproduce. Will add when I can.

@babariviere
Copy link
Owner

Yes you can use SmsMessage.id to remove a specific message

I working on message deletion, I will do it when I have time

@chrisrohitbrendan
Copy link
Author

/flutter/.pub-cache/hosted/pub.dartlang.org/sms-0.2.2/android/src/main/java/com/babariviere/sms/telephony/TelephonyManager.java uses or overrides a deprecated API.

@babariviere
Copy link
Owner

which version of android are you using?

@chrisrohitbrendan
Copy link
Author

I'm on Pie

@babariviere
Copy link
Owner

And there is already a broadcast receiver

@babariviere babariviere changed the title SMS deletion and Broadcast Receiver SMS deletion Sep 26, 2018
@chrisrohitbrendan
Copy link
Author

I'm a little confused about that, I know there's an SmsReceiver() but isn't that useful only during the lifecycle of my application?

Like any other SMS app I want to get the SMS when it comes while my application is closed, process it if I have to and show the user a notification. Also be able to make it the default app.

@babariviere
Copy link
Owner

I create a broadcast receiver, it should work in background. If it does not when you close the app it's because you have to spawn a background thread or launch your app on start

@chrisrohitbrendan
Copy link
Author

Got it, will try something today. Also fetching all threads is slow cause of the findContact() call.
Would make sense to get threads, and then leave it to the consumer of your library to do a lookup for contact information

@babariviere
Copy link
Owner

You are right, I will optimize these things with my rewrite

@chrisrohitbrendan
Copy link
Author

I have to manually append messages to a list since the queries aren't streams, is this desired behaviour?

@babariviere
Copy link
Owner

How are you using it ? It's a stream

@chrisrohitbrendan
Copy link
Author

chrisrohitbrendan commented Sep 27, 2018

Stream is only provided by SmsReceiver.
Right now to get threads, I'm using queryThreads which returns a Future.

I want to be able to get an updated List<SmsThread> instead through a Stream that I can listen to.

@babariviere
Copy link
Owner

I may have to change some of my code to do this but if you want to implement it you can

@chrisrohitbrendan
Copy link
Author

chrisrohitbrendan commented Sep 27, 2018 via email

@babariviere
Copy link
Owner

Why not

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants