Qt Notifier example app does not work
-
I am using Qt 5.15.16.
To run this on my android device with a higher sdk version, I had to comment out the following in AndroidManifest.xml:
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>
But then the application failed to compile with this error in AndroidManifest.xml Error:
android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
I fixed the above error by adding android:exported="true" to the activity node in AndroidManifest.xml.
Now the compilation succeeded.
Next, I deployed and ran the application on my android arm64-v8a device.
It runs okay but does not do what the example is intended to do, i.e. display andorid notification when you click on the icons :-(
In summary, I think Qt need to upgrade this example application so that it works with the later versions of android.
btw, I use notifications in my own app. I based my implementation on this example. It used to work. But it does not work any longer.
Any advice would be appreciated.
-
I found the solution.
Add android.permission.POST_NOTIFICATIONS to AndroidManifest.xml.
This is a requirement as of Android 13. -
S SGaist has marked this topic as solved on