Download Viber .AppImage file
Download the latest Viber from https://download.cdn.viber.com/desktop/Linux/viber.AppImage
mkdir -p ~/Applications
wget -O ~/Applications/viber.AppImage https://download.cdn.viber.com/desktop/Linux/viber.AppImage
chmod +x ~/Applications/viber.AppImage
To run AppImages you may need to install libfuse
sudo apt install libfuse2t64
Create .desktop launcher
You can do this manually or use AppImageLauncher.
For Ubuntu 24.04 the maintainer of AppImageLauncher recommends installing the .deb from the continuous build https://github.com/TheAssassin/AppImageLauncher/releases/tag/continuous.
Replace appimagelauncher_2.2.0-gha111.d9d4c73+bionic_amd64.deb with what is the latest version for you.
# Download the pre-compiled .deb build
wget -O appimagelauncher.deb https://github.com/TheAssassin/AppImageLauncher/releases/download/continuous/appimagelauncher_2.2.0-gha111.d9d4c73+bionic_amd64.deb
Install the .deb build
sudo dpkg -i appimagelauncher.deb
Fix dependancy problems if you get errors about missing libraries
sudo apt --fix-broken install -y
May also be needed
sudo systemctl restart systemd-binfmt
Delete the installation file
rm appimagelauncher.deb
Start the viber.AppImage file and when the AppImageLauncher pops up, click on Integrate and Run. This will automatically create the required .desktop file in ~/.local/share/applications.

Associate running instance with the .desktop launcher
You need to add the StartupWMClass to the .desktop file of the launcher of the AppImage. Otherwise your running instance will not get associated with the .desktop launcher.
The .desktop files are located at ~/.local/share/applications. The file you are looking for should look somethinge like this: appimagekit_1b8ef8b1293fa7f66ca83453aa2da417-Viber.desktop. Open it and add the following new line after Type=Application:
StartupWMClass=Viber