ivy-wallet
ivy-wallet copied to clipboard
[AUTOMATED SMS EXPENSES TRACKING]
Please confirm the following:
- [X] I've checked the current issues for duplicate issues.
- [X] I've requested a single (only one) feature/change in this issue. It complies with the One Request Per GitHub Issue (ORPGI) rule.
- [X] My issue is well-defined and describes how it should be implemented from UI/UX perspective.
What do you want to be added or improved?
As a user I want to track my expenses and incomes from sms automatically and not every time adding my expenses and income manually
Why do you need it?
- I need it because it will save my time
- it will make the application more useful and easier to use
How do you imagine it?
When a transaction message enters your phone, the application access the sms and use some key words which will help it to identify a transaction message from other messages and then it automatically add the details from the sms to the suitable category of transaction together with it's amount in the application
Thank you @Imruu99 for raising Issue #3232! 🚀 What's next? Read our Contribution Guidelines 📚.
Tagging @ILIYANGERMANOV for review & approval 👀
It's a good feature but hard to implement and opens the room for potential security/legal issues
Ok so this code snippet is for riding SMS when you receive it
class MySmsReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (Telephony.Sms.Intents.SMS_RECEIVED_ACTION != intent?.action) return
val messages = Telephony.Sms.Intents.getMessagesFromIntent(intent)
val app = context?.applicationContext as MyApplication
val address: String = "BANK"
var messageBody = ""
for (message in messages) {
val sender = message.displayOriginatingAddress
if(sender.contains(address)){
messageBody = messageBody.plus(message.messageBody)
}
}
if(messageBody.isEmpty()) return
// process messageBody
}
}
// You need to register it in the manifest but that it.
The hard part is extracting relevant information from it so you know how much you have spent and what kind of expanse it is.
For my own app I'm using regex to extract the amount, company and type. Here we have a problem because each bank sends different types of messages. This should be in setting to specify this regex strings.
For start, I think it should just add some default category. Because let's take a McDonald's for example every location will have a different company name in SMS because they are a franchise. So do we store separately all uncategorized companies and every user can categorize the company them self witch we later use. Or do we check the history of expanses and check if user has already recategorized any expanse from this company, but then we would need to store this in the expanse data. I'm not sure witch it's easier.
And another thing is how do we specify to witch account the expanse belongs to. The easiest way is to say SMS from company XYZ belongs to this account. Or better way is to add another regex to read from the SMS and then know witch account it belongs to.
For the regex the ones that I use for my bank are very simple, so I think a tutorial on how to modify the template to work for them will be enough.
And for the legal issue I don't see any problems because everything is done locally and instead of manually copying data from the SMS to the app its automated.
I can work on this future but I will need some help because I'm not so proficient in android development.