Skip to content

Instantly share code, notes, and snippets.

View devashishmamgain's full-sized avatar

Devashish Datt Mamgain devashishmamgain

View GitHub Profile
//NOTE: Replace "appId" value with your APP_ID from https://dashboard.kommunicate.io/settings/install
// and height, width value under classSettings
(function(d, m){
var kommunicateSettings = {"appId":"kommunicate-support","popupWidget":true,"automaticChatOpenOnNavigation":true, onInit: function() {
var style = document.createElement('style');
var classSettings = ".change-kommunicate-iframe-height{height:80%!important;width: 590px!important;box-shadow: rgba(0, 0, 0, 0.3) 0px 1.5rem 2rem!important;max-height:calc(100% - 30px) !important;}";
style.type = 'text/css';
style.innerHTML = classSettings;
document.getElementsByTagName('head')[0].appendChild(style);
@devashishmamgain
devashishmamgain / gist:54b45b005c67a27cf0d7adcad4e23eec
Created March 5, 2020 11:41
Dialogflow fulfillment rich message
'use strict';
const functions = require('firebase-functions');
const {
WebhookClient
} = require('dialogflow-fulfillment');
const {
Card,
Suggestion
} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
Enable encryption:
Add the following script:
<script src="https://cdn.applozic.com/applozic/applozic.aes.js"></script>
Add it before:
<script src="https://cdn.applozic.com/applozic/applozic.chat-5.8.min.js"></script>
function MckCallingService(u,h,m,b,c,t,f,g,s,j){var q=this;var n=$applozic("#mck-vid-icon");var e=$applozic("#mck-sidebox");q.callStartTime=t;q.mckMessageService=f;q.identity=u;q.token=h;q.callId=m;q.isCallHost=c;q.toUserImage=g;q.toUserDisplayName=b;q.isAudioCall=s;q.disconectedByHost;q.rejectedByReceiver;q.twilioService;console.log("is AudioCall:"+s);q.ringTone=j;var r=$applozic("#mck-msg-to");var i=$applozic(".applozic-vid-container");var l=$applozic("#mck-sidebox");var k=$applozic("#mck-video-call-indicator");var a=$applozic("#mck-unmute-icon");var o=$applozic("#mck-mute-icon");var p=$applozic("#mck-microfone-mute-btn");$applozic("#mck-microfone-mute-btn").off("click").on("click",function(){var v=r.val();var y=q.twilioService.activeRoom;if(y){var x=y.localParticipant.media;if(x.isMuted){a.addClass("vis").removeClass("n-vis");o.addClass("n-vis").removeClass("vis");p.addClass("mck-unmuted").removeClass("mck-muted");x.unmute()}else{o.addClass("vis").removeClass("n-vis");a.addClass("n-vis").removeClass("vis")
Add the following script reference in your html page:
<script src="https://cdn.applozic.com/applozic/applozic.chat-6.1.min.js"></script>
## Login
Replace APP_ID, USER_ID, PASSWORD with actual values in the below function:
Applozic.ALApiService.login(
{
data: {
baseUrl: 'https://chat.kommunicate.io',
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kommunicate Chat</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px Helvetica, Arial; }
@devashishmamgain
devashishmamgain / apploziccontacts.html
Created June 28, 2018 07:26
Applozic loadContacts and loadTab example
<html>
<head>
<script type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
var contactsJSON = [{"userId": "USER_1", "displayName": "Devashish",
UserLoginTask.TaskListener listener = new UserLoginTask.TaskListener() {
@Override
public void onSuccess(RegistrationResponse registrationResponse, Context context) {
//After successful registration with Applozic server the callback will come here
ApplozicSetting.getInstance(context).showStartNewButton();//To show contact list.
//ApplozicSetting.getInstance(context).enableRegisteredUsersContactCall();//To enable the applozic Registered Users Contact Note:for disable that you can comment this line of code
}
@Override