Traditional doorbell needs an electrically powered button on the exterior.
Phone needs visitor to have your private contact info or you would need to publicly add a note with that to your door.
If you don't want to use electricity, you can have a knock.
What reason would you want to be notified of unknown visitors knocking on your doors when you're away? The only people I can see fitting this description are delivery drivers & salesmen?
Further, what if you're home and your phone is in another room, is on silent, or is dead?
What is you have a spouse or housemate? Do both of you get notified?
And there's also a subset of people who get frustrated by having to use QR codes in restaurants, who I suspect would be equally frustrated by this.