Comments (11)
I did this:
const bus = connect.core.getEventBus();
// get the agent init to set logged in
bus.subscribe(connect.AgentEvents.INIT, this.handleAgentLogin);
// handle shared worker terminated to set agent logged out
bus.subscribe(connect.EventType.TERMINATED, this.handleAgentLogout);
from amazon-connect-streams.
@k1p1l0 No, I haven't. Though instead of making a new thread I added a comment on my other login API thread. Still looking for login/logout callbacks.
from amazon-connect-streams.
@davidjosephhayes the log out solution is definitely working.
For those using ES5 or a script tag. This can help.
The following lines need to be after the ccp has been initiated initCCP()
// Get the event but
var eventBus = connect.core.getEventBus();
// Attach a handler to the login event
// connect.EventType.INIT is a constant containing the name of the event.
eventBus.subscribe(connect.EventType.INIT, function() {
// whatever you need your code to do here.
console.log('logged in');
});
// Attach a handler to the log out event
// connect.EventType.TERMINATED is a constant containing the name of the event.
eventBus.subscribe(connect.EventType.TERMINATED, function() {
// whatever you need your code to do here.
console.log('logged out');
});
from amazon-connect-streams.
Hey @sromocki! Did you find the answer?
from amazon-connect-streams.
@sromocki
Login ==> i would consider calling agent() from connect object would trigger after successful login, ex: connect.agent(callback);
Logout ==>
let bus = connect.core.getEventBus();
bus.subscribe(connect.EventType.AUTH_FAIL, () => {
//do something
}
hope this helps!
from amazon-connect-streams.
@naresh-talluri Yea, that's what I did for login. I haven't tried that logout solution though (just been living without being able to logout), I'll give it a shot.
from amazon-connect-streams.
Depending upon what you intend to solve here, the recently launched agent event stream may be handy - http://docs.aws.amazon.com/connect/latest/userguide/agent-event-streams.html
from amazon-connect-streams.
@saketag Just needed callbacks to be able to show in my application that the user is indeed logged in/out of connect and can/cannot place calls. I'm not sure how I'd do that with the agent event stream, looks like that's more for reporting.
from amazon-connect-streams.
@naresh-talluri I tried your logout strategy, but that AUTH_FAIL event does not appear to be triggered on logout. I also checked the TERMINATE and CLOSE events but those don't appear to trigger either.
from amazon-connect-streams.
When I authenticate with my amazon connect credentials on the other page and when i come to my web page, it is taking lot of time to trigger connect.agent(...). Is there something, I am missing. Any help on this would be appreciated.
from amazon-connect-streams.
On this note, is there a way to trigger a logout? (destroy the session)
For testing I have set up multiple accounts, but as you probably know, once a session is created, all browser tabs see the session. I would like to be able to logout, so I can log back in again as a different user
from amazon-connect-streams.
Related Issues (20)
- [Question] CCP for device settings HOT 1
- [Errors] When a supervisor is monitoring a call with multi party enabled, if an agent tries to swap or transfer to a quick connect, it fails HOT 4
- contact.onRejected is not available HOT 1
- Feature Request: use setEchoLevel and setLogLevel at the top level to change CCP logs HOT 2
- Agent mute button is stuck and wrongly showing unmute agent when agent is in a conference and silently monitored by a supervisor HOT 3
- Request to add Contact.getChannelContext to index.d.ts HOT 1
- WebRTC - Failing to join video session - AudioJoinedFromAnotherDevice HOT 2
- OnRefresh is invoked after a contact has ended showing both the initial and third party connections as active HOT 6
- ccp cannot initialized when disabled the third party cookie
- Unable to Login with amazon connect Streams (Periority High) HOT 4
- Pop-up warning message when an agent ON CALL attempts to logout HOT 3
- how to send and receive email in Amazon connect HOT 1
- Amazon connect Task flow stopped working HOT 1
- amazon instance integrate with SAML popup window can not close HOT 1
- connect.BaseConnection.getEndpoint() does not provide proper details of endpoint HOT 1
- onEnded no disconnectReason provided HOT 1
- Initialization Failed
- Auto Login & Login pop screen freezes with Amazon connect streams
- Listen in on conversations between agent and customer HOT 2
- [High Sev] Breaking Issue with Streams v2.14.2 and initApp() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-connect-streams.