I have read several questions in stackoverflow including this, this and this, but they did not help me to fix my problem.
I have described my broadcast receiver in android manifest to receive incoming SMSs, but it does not work on version 6.0(Marshmallow) and 7.0(Noughat) altought it works in lower versions like 4.0.
My application have permission to read and receive SMS both in manifest and by granting permissions in run-time however onReceive off my Broacast receiver is never fired. I also tried to set priority to MAX_INT
(i.e. 2147483647) but it did not help.
Here is my brodcast receiver description in manifest:
<receiver
android:name="com.package.receiver.IncomingSms"
android:enabled="true"
android:permission="android.permission.READ_SMS">
<intent-filter android:priority="999">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>