Notification Listener for 3rd Party app

Would I have to go to the Maven repo and add it to the lib folder? Or would it already be included?

1 Like

Should be already inside the sources. No need to add it.

2 Likes

OK, Iā€™ve included it, how would I name the service?

<service android:name="io.kodular.arg6063.NotificationReader" android:label="NotificationAlertAccess" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
      	  <intent-filter>
            	<action android:name="android.service.notification.NotificationListenerService" />
       	 </intent-filter>
 </service>

Like what would I put in android:labelā€¦ Would it be the class that I created? Is it even required?

1 Like

Not sure if you really need the label.
Just google it.

But donā€™t forget that you have to use as name the package name of the app.
Like:

<service android:name=ā€œYOUR_PACKAGE_NAME.NotificationReaderā€

It must be the location of your created service class

2 Likes

The android:label stands for what it should show as when allowing Notification Access, for example I named mine .Listener and it showed up as .Listener, which means it would be your app name or I think you should be able to leave it empy.

1 Like

It is required this is the name which appear in notification listener service settings like this

This should be same as our app name so user can easily understand. who they are allowing to access notifications.

Thereā€™s an issue behind your claim.

Removing it defaults to your app nameā€¦ meaning itā€™s not required. Try it for yourselfĀ :)

okk may be. if you got registered in Notification Service then itā€™s fine.
have you tried why this error showing Error:
Attempt to invoke virtual method ā€˜java.lang.stringorg.json.JSONArray.toString()ā€™ on a null object reference

No, the parameter is not required as I said before because I tried it.

I did not, because this is an issue with getting Notifications. Iā€™m having an issue listening for incoming Notifications, hence ā€œNotification Listener.ā€ You know if you want it done faster, you can always help yourself ^^

1 Like

Yes. but iā€™m not a java developer/extension developer. I have taken help of other developer to develop this extension. he is not from app inventor community. but he didnā€™t got result that time means when i created this topic. we tried for almost 8-10 days for it but not got output then hi give-up on this. and I donā€™t understand java so i stopped working on this because i donā€™t have any way.

I now accepted the challenge and prepared an extension to listen for all notifications, which works fine in MIT App Inventor, for details see here App Inventor Extensions: Notification Listener | Pura Vida Apps

Notification Listener Extension to listen to all notifications of your device. Packagename, title and text of all notifications will be stored in TinyDB. Also of course works if your app is not running and also survives a reboot of the device.
Minimum API level is 21 (Android 5).

However Iā€™m using an AndroidX library and therefore it will not run in Kodular as it is. But I additionally provided the source code of the extension, so feel free to adjust it to your needs to get it running in Kodular. Please respect my license if you like to do this. You only have to replace one library or just remove the Local Broadcast Manager assuming the services annotation already works in the Kodular Extension IDE. You also can get an idea what needs to be done to get a service running in an extension.

Taifun
PS: I donā€™t think, that a lot of users will like to use it, because of the following message, which needs to be granted by the userā€¦ you might want to convince me from the contraryā€¦ :wink:

Unbenannt

8 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Great Job. :clap: :clap:. can you please tell when this this extension to be released? :relieved:
Happy new year 4 all :two: :zero: :two: :one:

1 Like

3 posts were split to a new topic: App Inventor question concerning Notification Listener Exension

Asking a profficnal deloveper will give you the right answer thanks Atom-Deloveper for giving me the solution here is the source code working for Kodular (also many thanks to Taifun for his kind shared code which made that possible)
NotificationListener.java (9.4 KB)

And the modification includes also parsing the stacked notification

1 Like

blocks (2)
dont forget to use the name space as per extension as Taifun made it clear
and also notice that parsing stacked notification only works on android 7 +

1 Like

com.atomdeveloper.NotificationListener.aix (11.3 KB)
here is the aix Enjoy
Atom-Deloveper Thanks again

2 Likes

thank you @Atom_Developer
my understanding was, the services annotation still is not available in Kodular?
which means, someone who likes to use the modified extension in Kodular needs to additionally modify the manifest for this to work?

Taifun

2 Likes

The annotation which was added in appinventor sources would not work in kodular because they compile and generate the extension in a different form but I do not use that version to compile the extension, I use a modified version of extension template which eventually adds the required manifest elements to the activities array in the json inside extension,and the appinventor compiler does not do anything with activities string inside json so at last the activities array text is directly added to the app, so it means that if you give any text inside the array, it would be added to the manifest , same goes for broadcastReciever array in the json

So the @UsesServices annotation works differently in my extension template

According to the answer above, no.

3 Likes