Turning iMessages off and on again in my iPhone settings fixed the problem for me.
The link between the phone number in an iOS device and the iMessage account on that device usually happens automatically, e.g. during setup of an iPhone, and usually only has to happen once. While they are linked, your other iMessage devices can “see” and “use” that number.
Under certain circumstances (and for good reasons[1]) the number may unlink from the iMessage account. When you go into the Preferences for “Messages” on your computer, you will no longer see the phone number listed under the sources.
To fix:
- On the iPhone open the “Settings” app then the “Messages” page.
- Turn off the “iMessages” switch.
- Wait for a few seconds, or exit the page then go back into it.
- Turn on the “iMessages” switch. You should see some notices over the next few seconds about “Identifying” and/or “Authenticating”
- Accept the link from other devices.
On your computer and/or other iDevices, you will be prompted if you want to allow a new number and a new iPhone to be associated with your account. You should say Yes/OK to allow the link on every device where you get the question. Yes, I know it is your same number and your same iPhone but for whatever reason[1], they got unlinked. The old link is gone, not broken, gone. You have to accept it (again) from another device that is signed in to that account.
[1] For obvious reasons, an iMessage account and phone number should only be linked while there is an active device authenticated to that iMessage account, that currently also contains an active SIM with that phone number. Privacy not withstanding, the ability to receive an authentication code or reply to an SMS at a given number is now widely used to secure financial and email accounts. A phone number is equivalent to identity for many apps, websites and services.
A service provider authorizes a SIM to use a number when activating it. Possession of an activated SIM as evidenced by its presence in the phone authenticates its use, and thusly the associated phone number. Providing the username and password for an iMessage account as happens during iPhone setup authenticates access to the account. The link between the two is authenticated by an entity with simultaneous authentication and access to both.
Even if you don’t remember doing something that could have broken the link e.g. a SIM swap, there may have been an account change, or suspension, or reactivation, or setting change, or a failure, or a reset, or a power loss or a reboot - even a bug - somewhere that destroyed the link. Just turn the setting off and on again. It shouldn’t happen often.