Plugin PWA TURN/STUN Support Request Install

“Messenger Add-on For WoWonder” ” v1.7


“Messenger Plugin For WoWonder”

Created: 22/04/2020
By: Vanea Young
Support: Help Desk
Version: v1.7 [06.02.2025]

Thank you for purchasing my item. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

How to install Guide

Attach the plugin to WoWonder.
Step 1
Copy all the files & folders from Plugin folder to your /home/ directory.

[kontackt]
*vy-messenger-cmd.php
*messenger-add-stickers.php

Step 2
If you use apache, Open your .htaccess file, and find the code from below.

RewriteCond %{REQUEST_FILENAME} !-d

After this add the following code.

# Messenger
RewriteRule ^vyuser/(.*)$ vy-messenger-cmd.php?cmd=openuser&id=$1 [NC,QSA]
RewriteRule ^vypage/(.*)$ vy-messenger-cmd.php?cmd=openpage&id=$1 [NC,QSA]
Redirect 301 /messages /messenger
RewriteRule ^messenger$ vy-messenger-cmd.php [QSA]
RewriteRule ^messenger/([^\/]+)(\/|)$ vy-messenger-cmd.php?userid=$1 [NC,QSA]
RewriteRule ^messenger/g/([^\/]+)(\/|)$ vy-messenger-cmd.php?userid=1&group_id=$1 [NC,QSA]
RewriteRule ^messenger/([^\/]+)/([^\/]+) vy-messenger-cmd.php?userid=$1&page_id=$2 [NC,QSA]
RewriteRule ^msn/call/([^\/]+)/([^\/]+) vy-messenger-cmd.php?cmd=reqcall&recipient=$1&type=$2 [NC,QSA]
RewriteRule ^msn/answer/([^\/]+)/([^\/]+)/([^\/]+)/([^\/]+) vy-messenger-cmd.php?cmd=incomingcall&recipient=$1&type=$2&room=$3&invitation=$4 [NC,QSA]

If you use nginx, Open your nginx.conf file, and add the code from below.

# Messenger
location = /messages { return 301 /messenger; } 
rewrite ^/vyuser/(.*)$ /vy-messenger-cmd.php?cmd=openuser&id=$1;
rewrite ^/vypage/(.*)$ /vy-messenger-cmd.php?cmd=openpage&id=$1;
rewrite ^/messenger$ /vy-messenger-cmd.php;
rewrite ^/messenger/([^\/]+)(\/|)$ /vy-messenger-cmd.php?userid=$1;
rewrite ^/messenger/g/([^\/]+)(\/|)$ /vy-messenger-cmd.php?userid=1&group_id=$1;
rewrite ^/messenger/([^\/]+)/([^\/]+) /vy-messenger-cmd.php?userid=$1&page_id=$2;
rewrite ^/msn/call/([^\/]+)/([^\/]+) /vy-messenger-cmd.php?cmd=reqcall&recipient=$1&type=$2;
rewrite ^/msn/answer/([^\/]+)/([^\/]+)/([^\/]+)/([^\/]+) /vy-messenger-cmd.php?cmd=incomingcall&recipient=$1&type=$2&room=$3&invitation=$4;

Step 3
Open your wowonder container.phtml file. You can find it here:

 /themes/YOUR_THEME/layout/container.phtml

Go to end of file.. and above of below code:

   </body>
</html>

Add this code:


	<?php 
	if ($wo['loggedin'] == true) {
		// Messenger
		include(getcwd().'/kontackt/MSN/frontend/assets.html');
	}
	?>
	

Step 4
Now please open /themes/YOUR_THEME/javascript/script.js file to stop getting messages notifications from ajax, Find the code from below:


    if(typeof (data.messages) != "undefined" && data.messages > 0) {
      messages_notification_container.find('.new-update-alert').removeClass('hidden');
      messages_notification_container.find('.sixteen-font-size').addClass('unread-update');
      messages_notification_container.find('.new-update-alert').text(data.messages).show();
      if(data.messages != current_messages_number) {
        if (data.notifications_sound == 0) {
          document.getElementById('message-sound').play();
        }
        current_messages_number = data.messages;
      }
    }  else {
      messages_notification_container.find('.new-update-alert').hide();
      messages_notification_container.find('.sixteen-font-size').removeClass('unread-update');
      current_messages_number = 0;
    }


Please isolate the code like /* CODE MENTIONED ABOVE */ or replace by code from below, see example from below:


   /*  Disabled regadring to the new messenger
   if(typeof (data.messages) != "undefined" && data.messages > 0) {
      messages_notification_container.find('.new-update-alert').removeClass('hidden');
      messages_notification_container.find('.sixteen-font-size').addClass('unread-update');
      messages_notification_container.find('.new-update-alert').text(data.messages).show();
      if(data.messages != current_messages_number) {
        if (data.notifications_sound == 0) {
          document.getElementById('message-sound').play();
        }
        current_messages_number = data.messages;
      }
    }  else {
      messages_notification_container.find('.new-update-alert').hide();
      messages_notification_container.find('.sixteen-font-size').removeClass('unread-update');
      current_messages_number = 0;
    }
	*/


Step 6
Open file /assets/init.php and add the following line of code at the end of the file:
// include messenger
if( file_exists(getcwd().'/kontackt/MSN/backend/script/classes/class.messenger.php'))
require_once(getcwd().'/kontackt/MSN/backend/script/classes/class.messenger.php');

Step 7
Now please go to your phpmyadmin and upload the SQL file
database.sql

Step 8
The last step, you have to go to https://msnplugin.kontackt.de/setup.html to generate and download your application.
https://msnplugin.kontackt.de/setup.html

PWA Configuration.
Step 1
Copy all the files & folders from PWA folder to your subdomain directory.

[assets]
[img]
[sources]
[themes]
[kontackt]
*.htaccess
*app.js
*checklogin.php
*favicon.ico
*index.php
*login.php
*logout.php
*manifest.json
*vy-messenger-cmd.php
*redir.php
*sw.js
*takelogin.php

Step 2
Open the file manifest.json and edit it, required to be edited "name", "scope", "url", "manifestUrl".

{
    "theme_color": "#000000",
    "background_color": "#ffffff",
    "display": "standalone",
    "scope": "https://pwa.kontackt.net/",
    "start_url": ".",
    "name": "WoWonder Messenger",
    "short_name": "Messenger",
    "description": "A demo app for Real-Time Messenger For WoWonder Social Network PHP Script",
    "orientation": "portrait",
    "icons": [
        {
            "src": "./img/icons/icon-192x192.png",
            "sizes": "192x192",
            "type": "image/png"
        },
        {
            "src": "./img/icons/icon-256x256.png",
            "sizes": "256x256",
            "type": "image/png"
        },
        {
            "src": "./img/icons/icon-384x384.png",
            "sizes": "384x384",
            "type": "image/png"
        },
        {
            "src": "./img/icons/icon-512x512.png",
            "sizes": "512x512",
            "type": "image/png"
        }
    ],
  "url": "https://pwa.kontackt.net",
  "manifestUrl": "https://pwa.kontackt.net/manifest.json",
  "lang": "",
  "screenshots": []
}

Step 3
Open the file assets/std_config.php and add your WoWonder database credentials.

// SQL connection
define('DBHOST', ''); # MySQL host
define('DBUSER', ''); # MySQL user
define('DBPASS', ''); # MySQL password
define('DBNAME', ''); # MySQL database name

Step 4
Open the file kontackt/MSN/backend/script/ini/config.ini and replace the default configuration with the config.ini file from the main plugin.

NO CODE

Step 5
Open the file kontackt/MSN/backend/script/ini/pwa/config.ini change all values with yours, e.g.: SITE_URL = "https://your-PWA-subdomain-name.com"


[STANDALONE MESSENGER URL]
SITE_URL = "https://pwa.kontackt.net"; # Change this with your subdomain

[WOWONDER WEBSITE URL]
WOWONDER_URL = "https://wo.kontackt.net"; # Change this with your wowonder website url

[WOWONDER WEBSITE URL]
WOWONDER_API_KEY = ""; # Add your wowonder server api key

[WOWONDER WEBSITE ROOT DIRECTORY]
WOWONDER_ROOT_DIR = ""; # Your Wowonwder website ROOT DIRECTORY PATH 

[THEME NAME]
THEME = "standalone-vy-messenger";

[TITLE]
TITLE = "Standalone Messenger";

[META DESCRIPTION]
META_DESCRIPTION = "Play with Standalone Messenger";

[META KEYWORDS] 
META_KEYWORDS = "messenger, websocket, ...";

[META ICON] 
META_ICON = "wo.kontackt.net/inline-messenger.png"; # WITHOUT http:// or https://


STUN/TURN SERVER CONFIGURATION.
We Recommend to configure your own STUN/TURN SERVER, to do this you must run at least VPS.

Full Documentation URL: https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html#top