Whenever the unread count changes in Textra SMS, it broadcasts an intent with the action set to "com.textra.UPDATE_UNREAD". The intent will have an integer extra called "count" with the unread count.
You can receive the broadcasts in the normal way, by either registering a receiver in the manifest of your app, or by programmatically registering a receiver.
The official documentation is here:
and a succinct tutorial is here:
Any queries please contact email@example.com.
Note: This broadcast is provided only from Textra SMS v3.22 onwards.