Close app if group name not in the list

Hi, I am creating this app which loads webview of whatsapp. I want it to check after pageload if a group name called Car Repairs is in the list, if not close the app. Here is the block


But this is not closing the app, even if the group name not in the list. Can you tell me on what I am doing wrong here?

Thanks,
Nilin

In order check

  1. Page loaded correctly?
  2. How you get list of gruop

I think you have to pass the web page in the java script block and after evaluate you can set the if control

You might need to get a list of the group names via an API instead of scraping the WebViewer, which may be buggy if the site changes or if it redirects to other websites.

Your code does not detect the group name, it just checks the variable instead of really detecting the group name.

1 Like

Yeah page loaded correctly. This app would be used by two employees and both would scan and login into the Car Repairs whatsapp number, which is not part of any other whatsapp group except Car Repairs whatsapp group. SO, this would receive messages in Car Repairs whatsapp group apart from messages from other individuals.

Sorry I didn't use webviwer so much :sweat_smile:
Probably the evaluate block is correct but you have to move the if control under the After JS Evaluated block.

I moved the if control under the After JS Evaluated bloc, but still not closing the app if the whatsapp group name is not in the whatsapp list. See here -


@Gordon_Lu There is only one whatsapp group in the whatsapp number which I want my people to scan and login. So, can we do the check in any other way?

  • Your code still does not work because global group_name was never changed.

  • Also, call CustomWebView. EvaluateJavaScript runs JavaScript in the WebViewer. Running the group name in the web viewer shouldn't have any effect.

As I said, you might need to access an API in order to retrieve a list of groups.

2 Likes

My fault :sweat_smile: It was a tried waiting an user with more experience :muscle:t2:

Ok. Group Name is just an identifier I thought of using for access, it need not be group name. Supposing if our people logged into Car Repairs Whatsapp number 1234567890 using this app, can we do an if check that the app to close if the logged in whatsapp number is different from 1234567890 without using business API?

Thanks