I start from this sample :
https://www.b4x.com/android/forum/t...er-library-notificationlistenerservice.35630/
I installed both NotificationListener library and Erel's exemple.
Please note that Erel indicates that exemple was updated to support B4XPages and Android leveltargetSdkVersion=34 (#103 and #104).
My configuration is B4A level 13.4 / android-36 and my Xiaomi phone is running Android 14
1°) First of all, I get an IDE error in Service_Start Sub in NotificationService
If listener.HandleIntent(StartingIntent) Then Return
Is there an issue with the library as "listener" does not know "HandleIntent" ?
2°) If I comment this line, compilation/execution are fine BUT log contains nothing when notifications are received on the phone.
FYI, manifest contains following additional lines
AddApplicationText(
<service android:name="anywheresoftware.b4a.objects.NotificationListenerWrapper"
android:label="Notification Listener"
android:exported="false"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>)
Maybe the new declarations (hereafter for the music player) for declaring a service (starting from Andoid14) should be added in the manifest ????.
AddPermission(android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK)
SetServiceAttribute(MyMusicService, android:foregroundServiceType, "mediaPlayback")
3°) If yes, what is the type of service to declare ?