Removes Permission?

Hello,

I am getting a strange result using the Pura Vida App Inventor Wi-Fi Manager extension.

I'm using MIT App Inventor 2 with an Android 11 OnePlus 7T phone for development. I am developing an application that creates a notify listener service and then sends Wi-Fi commands to flash Wi-Fi connected bulbs upon receiving certain notifications.

The app works properly until I add the Wi-Fi Manager extension (along with the location sensor to get the Course Location permission).

When I first start my app the Notification Listener service asks me for a notification permission which I have to allow:

When I add just the location sensor control, my app continues to ask me to allow notifications upon first execution and works properly.

But when I add the Pura Vida Wi-Fi Manager control, even though I don't yet access any of its properties or methods, my app no longer gives me the option to allow notifications even though it still pops up that settings page.

The option to allow the notification permission for my app is completely missing!

This occurs when the only change to my app is adding the Wi-Fi Manager control on the App Inventor Designer page - without even accessing any of the control's properties or methods.

Of course my app, at this point, no longer works. Any idea what could be causing the permission request to be missing and how to fix it?

Ultimately I just need the SSID of the connected network so I can not send the network commands to flash the bulbs if I am not connected to a particular network. Is there any other way to get the SSID without using the Pura Vida Wi-Fi Manager control?

Thanks,

Barry.

I am getting a strange result using the Taifun WiFi Manager Extension that I downloaded from Pura Vida.

My app works well. Upon first execution after installation it asks for a permission to monitor notifications. A dialog pops up and I have to Allow this permission. As soon as I add the Wi-Fi Manager Extension from Taifun my app no longer shows the notification permission, although it still pops up the dialog that should contain it. I only need the Wi-Fi Manager to get the SSID.

I'm using MIT App Inventor 2 with an Android 11 OnePlus 7T phone for development. I am developing an application that creates a notify listener service and then sends Wi-Fi commands to flash Wi-Fi connected bulbs upon receiving certain notifications.

The app works properly until I add the Wi-Fi Manager extension (along with the location sensor to get the Course Location permission).

When I add just the location sensor control, after new install my app continues to ask me to allow notifications upon first execution and works properly.

But when I add the Taifun Wi-Fi Manager control, even though I don't yet access any of its properties or methods, my app no longer gives me the option to allow notifications even though it still pops up that settings page.

The option to allow the notification permission for my app is completely missing!

This occurs when the only change to my app is adding the Wi-Fi Manager control on the App Inventor Designer page - without even accessing any of the control's properties or methods.

Of course my app without the notification permission, at this point, no longer works. Any idea what could be causing the permission request to be missing and how to fix it?

Ultimately I just need the SSID of the connected network so I do not send the network commands to flash the bulbs if I am not connected to a particular network. Is there any other way to get the SSID without using the Taifun Wi-Fi Manager control?

Thanks,

Barry.

Be patient. No need to re-post Barry. Someone is lucky if they get an immediate response to their posts. Sometimes one has to wait a day or two. Usually questions about extensions can only be answered by the developer and most developers do not live in the forum 24/7.

Thanks. I tried to move this post to the "Bugs and Other Issues" sub-form while adding some information – thinking that might be a more-correct place for it. But, obviously I did not do that correctly.

We need to see the Manifest

  • before the WiFi ext. has been imported and
  • after it has been imported.

I know the issue that a service stops working after a certain extension is used (added).
(I had a similar issue e.g. with Taifun's AlarmManager ext. and the SideBar ext. from Andres Cortes.)

So decompile the APKs and post the Manifest of both versions:

Thanks. It's good to hear someone else confirm a similar issue.

I had been using essentially the same app developed with a different RAD tool (B4X) for years, but when all my devices upgraded themselves to Android 11 that app stopped working. That is why I gave App Inventor a try.

The app is only for my own personal use. By using a RAD tool I had hoped to avoid all this nonsense of maintaining half a dozen files in order to compile. I find it really strange that the Notification Permission Dialog pops up, but there is no entry to enable the notification permission – leads me to believe it's an android 11 thing or, as you say, a service thing rather than a lack of permission in the manifest thing.

I will try comparing the before-and-after manifests to isolate the differences. Editing the manifest with each compile is not a solution. Since I only need to get the SSID for the currently connected network, I wish there were something much simpler than the Wi-Fi Manager extension to do this.

I am only using the currently connected SSID to not send the UDP commands to control the bulbs if I'm not connected to a specific network. I don't think it will hurt anything if I send useless UDP commands on an unknown network or I can get 90% there by comparing the connection IP for "192.168.0.". Not having the SSID is not a showstopper.

Barry.

It takes less than 1 min. You only have to add the service again (to the version with WiFi).
How often do you have to compile your app?

Here is an example:
Left: without SideBar ext. / right: with SideBar

The yellow marked line is missing and has to be added again. That's all.

I can hardly imagine that you won't find something suitable on Ulli's website.
But there you were already, as it seems.

if you find a difference in the manifest, then as it seems to be, the build process somehow removes a relevant part and this should then be fixed by the MIT App Inventor team. You then could send me your project as personal message and I will forward it to the MIT App Inventor team so they can find out, what exactly needs to be fixed.

I agree... this is only a workaround...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thanks for agreeing to look at this. I hope I've done as much of the work as possible.

I created two test versions of my APK. I appended the name of the first one with "_LS", for Location Sensor and I appended the second one with "_LS_TW" for Location Sensor + Taifun WiFi.

I've attached text versions of the manifest for both APKs:
The _LS APK: AndroidManifest_LS.txt (3.0 KB)
and the _LS_TW APK: AndroidManifes_LS_TW.txt (2.7 KB)

I used Notepad++ to do a comparison of the two text APK's. Unfortunately I don't know how to output the colored version of the comparison – I could only take screenshots:

The_LS comparison window screenshot:


The_LS_TW comparison window screenshot:

Comparing the two screenshots:
Line 4 on the _LS manifest is missing the Change_Wi-Fi_State permission – that's to be expected.
On line 20 there is a name difference in the two manifests – also to be expected.
On lines 25-29 the _LS_TW manifest is missing the service declaration – Bingo

I would be willing to bet this is the problem. Do you agree?

Thanks,
Barry.

yes exactly... as @Anke already was assuming...
somehow these lines are removed while building the project...

@UsesServices(services = {
  @ServiceElement(
	name = "com.puravidaapps.TaifunNotificationListener.TaifunNotificationListener$NotificationService", 
    label = "NotificationService", 
    permission = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE", 
    intentFilters = {
      @IntentFilterElement(actionElements = {@ActionElement(name = "android.service.notification.NotificationListenerService")
    })
  })      
})

the MIT App Inventor team will have to find out, why that happens and fix that issue...
as already mentioned

Taifun

I had already sent you a project (aia) via PM with the same problem: TaifunAlarmManager and SideBar.

It is obviously not due to the AI2 build server, but to the development environment under which the extension was compiled. Because the problem also arises with my MyFonts extension and Ulli's MediaNotification. But @Ulrich_Bien then compiled MyFonts.java in his environment and the problem no longer occurs.

Maybe @ewpatton can say more about (the reason for) this issue.
I compiled MyFonts with Evan's Extension Template. But Taifun doesn't use it, as he told me.

I have uploaded the two projects (aia files) that produce the manifests shown above. The _LS version works correctly, but the _LS_TW does not work. Upon further inspection of the text manifests we find that the notification description is missing in the_LS_TW version. The only difference between the two projects is the addition of the Taifun Wi-Fi extension to the Designer.

One comment mentions differences in the build environment. I'm using the latest updated public versions of Chrome on a Windows 10 machine. I haven't made any changes to the default settings of the App Inventor IDE. I originally signed up with App Inventor years ago (don't know how many), but only used it for a few hours until several days ago to develop this app.

[example projects containing paid extension removed by Taifun]

There is nothing proprietary about these projects – in fact they were developed mostly using freely available examples from Taifun and Ulli.

In case anybody is interested in what I'm doing: this app flashes LED Wi-Fi addressable light bulbs when an Android phone receives certain notifications; for example a phone call, text message, Skype call… I am deaf so unless I'm sitting next to my phone, of course I don't hear it ring, and I may not feel it vibrate. The bulbs I use are LifX LED Wi-Fi addressable bulbs (in the US I buy ones that cost about $10 each). LifX has a public LAN API that allows you to send UDP commands over the network to have the bulbs do things. Deriving the UDP commands leads to a string of bytes (developing the strings is another story. You have to follow the LifX documentation). You need to use the public (available in Google Play) LifX app to add the bulbs to your network. You can look at your router DHCP table to find the IP address assigned to the bulbs.

Barry.

:question:
I don't understand the context of your statement to my statement (if there is one at all).

OOh… I just reread your comment more carefully and I now understand you're talking about the environment the extension was compiled under. As Rosanne Rosanna-Danna would say: "Never mind". :grin:

By development environment I thought you were referring to the browser I was using and the operating system I'm working from. Were you referring to something different?

Since AI2 is hosted online, I don't believe I have control of anything other than which browser I use and which operating system I'm working under. The device I use should not matter since the manifest is created before I install to my device. I think I read that AI2 targets android versions above 4 or so. My device runs Android 11, but again that should not matter because the manifest is created and app compiled before it knows the version of Android on my device.

Barry.

As you can easily see, my post is addressed at Taifun and Evan.
There is nothing you can do to solve / fix the problem.

I removed the uploaded projects from your thread...
as mentioned earlier, you should have sent them by PM...
see also my terms and conditions for paid extensions...

@ewpatton might want to take a look...

I'm using the default development environment

Taifun

Are you talking about the standard MIT environment from github? Is there maybe any other?

Thanks, which is the same as I use. I thought there was another one.