Salesforce LWC Locker Compliant <> Twilio Javascript SDK - api

thank you for reading
I'm creating a Computer Telephony Integration with Twilio and Salesforce
I need to call to a (customer) Phone using the microphone of my computer and the browser to handle the call
I already achieved it with HTML, CSS and JS in local and hosted webpage
I'm trying to achieve this with LWC (Lightning Web Components) of Salesforce to handle this in an app inside Salesforce.
I'm not sure but I'm having troubles trying to use the library (added as Static Resource: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.js_third_party_library)
I think it's the Locker Compliant https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.js_third_party_guidance
`import { loadScript } from 'lightning/platformResourceLoader';
import Twilio from '#salesforce/resourceUrl/twilio2';
loadScript(this, Twilio)
`
Everything seems good but then I have
'Error setting up Twilio device: Cannot read properties of undefined (reading 'setup')'
So library is not being included I think
Thank you very much
Happy coding
I've achieved to handle the call with a local/hosted webpage but not inside Salesforce homepage using my LWC component

Related

How to get access to Vuex store of parent Vue app from iframed child app?

I'm coding a main web app (with VueJS & VueCLI, as SPA) with only some foundation features. I aim at providing a platform where other developers could independently build add-ons by coding & deploying their own web app (with any framework) at it's specific domain, then the main web app have a page to load the add-on URL in iframe tag.
It's sound like micro-frontends architecture. And here's what missing: if the main web app handles login process and keeps user account object in Vuex, then how coud I efficiently get access to Vuex of the main web app from the add-ons web app?
If iframe it not a suitable solution, so what's the best strategy for me?
I open to discussion & really appreciate any help!

RingCentral two way communication

I am building a React Native application for calling using RingCentral APIs.First of all I tried using the webphone RTC via web browser: https://github.com/ringcentral/ringcentral-web-phone. It works perfectly fine in web browsers. But the thing I need is to call via react-native application I am building.
I tried calling via RingCentral using 'ring out call' POST API and 'call control- make callout' post api(beta version).But the problem i am facing is when i integrate these apis to react-native applications : To have a two way communication I need to be online in the web phone .Then when i call from react native it goes to the web phone first.And then when I dial 'answer' it redirects to the number i want to call to.Then only I can have a two-way communication.
So, what do I do if I want to directly call via react-native application to the recipient directly?
P.s. If I am not online in the web phone from browser the call automatically goes to the voicemail.
So hard to understand your question from the title and the detailed description.
I guessed that you want to implement a functional phone using react native where you want to use the RingCentral WebRTC SDK to handle incoming and outgoing phone calls.
First of all, please mind the browser compatibility supported by the WebPhone SDK. Secondly, it is not trivial and I cannot support you on the react-native part. However, RingCentral provides an easy way to embed a RingCentral embeddable phone to any webpage and that app is an open source project. You can use the embeddable as such or clone the project and learn from the code or modify it to meet your requirements.
Click on the links above to find further information.

Error on "Crypto" to use Twilio (for SMS)

I'm developing an application in React Native for iOS and I'm using Twilio to send a text message (SMS).
To use Twilio I added 2 nodes: Util and Crypto.
In my app, I only added react-native-ble-manager over util, twilio, crypto, and the basic nodes.
Adding the last node Crypto, when I include Twilio in the code, I get an error:
in detail:
Can you help me?
Twilio developer evangelist here.
The Twilio Node.js library is not intended to be used in client side applications. That would require you to store or retrieve your account credentials within the app, which would make them available for a malicious user to steal and use.
Instead, we recommend you set up a server that can perform the API requests and you make calls to that server from your application. Here's how we recommend you do that with Swift on iOS for example. We don't have an example for React Native, but as long as you can make a request to your own server from the application, then that's what you need to do.

How to set a friendly name using native API IOS/Android in MFP server

As documented in the link: https://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WL.Device.html , The WL.Device class in MFP JavaScript client API has methods setFriendlyName/getFriendlyName for setting/getting friendly name to/from MFP server.
However these to methods are not there in the MFP iOS/Android native API (i.e. class WLDevice in both platforms).
So, is there any way I can set friendly name using iOS/Android native API?
No, setting friendly name is only included in JavaScript. You could always make a portion of your app Web and set the friendly name there and run the rest of your app in Native.
If you want this to be a native API you may submit a feature request: https://www.ibm.com/developerworks/rfe/execute?use_case=submitRfe

Is it possible to use Firebase with a Windows 8 app?

I'm hoping to use Firebase in my Windows 8 app made using WinJS. Here is how I am trying to write to the root of my Firebase:
var dataRef = new Firebase("https://<firbaseName>.firebaseio.com");
dataRef.set("I am now writing data into Firebase!");
However, this gives me the following error in the JavaScript console:
Can’t load <https://<firebaseName>.firebaseio.com/.lp?start=t&ser=66595697&cb=2&v=5>. An app can’t load remote web content in the local context.
I've tried to add https://[firebaseName].firebaseio.com/* to my Content URIs in my app manifest but that doesn't seem to be the solution. Does anyone know if it's possible to get Firebase working inside of a Windows 8 app?
You should be able to use firebase.js natively in a Windows 8 (WinJS) app. Just download a copy, and embed it with your app. If you run into any issues, please email support#firebase.com.
I wanted to add that is not possible to use the regular firebase.js file alone. (5/5/15 and firebase.js 2.2.4)
The issue is firebase by default tries to do long polling and calls a script from firebase which violates CSP.
Firebase.js has a function called isWindowsStoreApp() but in my tests it doesn't work.
What #Michael Lehenbauer said in an earlier comment triggers it to only use websockets which is local and CSP safe.. Just call
Firebase.INTERNAL.forceWebSockets();
early and it works...