Azure Communication Services Web Calling in MVC - azure-communication-services

All of the examples for ACS are using Nodejs and VS Code... and thats fine if you're building a new app, and if you have some kind of background with React. I do not... and I'm willing to bet most web devs maintaining and builing MVC apps don't.
I'm not so daft that I can't get a Nodejs app working, I can get the web calling hero sample to run without any issues...
However, I think for MVC we probably should be looking at this solution
https://github.com/Azure/communication-ui-library/tree/main/samples/StaticHtmlComposites
and I can't get it going... Not only that... but even if I did get it running how would one implement into an existing MVC app...
Has anyone successfully implemented ACS web calling/video into an existing MVC app, and how did you do it? ...the internet is currently a barren wasteland when it comes to this topic.

ANSWER as of 7/7/2021
Step 1: Follow all of the steps from here
https://github.com/Azure/communication-ui-library/tree/main/samples/StaticHtmlComposites
Step 2: Take the newly created/bundled callComposite.js file and add it to your existing or new MVC web project. I added mine to wwwroot/js...
Step 3: Create a view (however you choose to do that...) and copy the html and javascript from the index page in the project I linked to above. (if you don't care about chat you can remove all the related js). You'll need to replace the callComposite.js script link with the newly added one.
Step 4: You need a controller that will generate the token and userId.
I created a web api controller so that a new token and userId was generated essentially when the page was loaded. NOTE: make sure you're using async javascript OR just put the callAdapter code block in a timeout (mine is 2 seconds with a loading screen) Secondary Note: I got all of the code from the Web Calling Hero Sample out of the calling/controllers/UserTokenController.cs
Final step: say a small prayer, cross your fingers, grab a rabbits foot and rub it. then run it and it could/might/probably/possibly work the first time... but probably not. you'll need to adjust for your own set up.
For you future people. Please post an updated solution. This is literally the only resource for Azure Communication Services Web Calling on MVC on the internet (as of the time of this posting). Be a hero, tell us a better, easier way.

Related

Flutter/Dart: Communication between features in Clean Architecure

I'm new to flutter/dart and I'm trying to create a little application using a Clean Architecture design.
I read some blogs and several presentations of Uncle Bob's Clean Architecture before starting to code to get the most of it and now it's time to implement it.
I guess my application could be divided in 3 main features :
authentication
classes (get access to lessons/quizzes on specific subjects)
admin (manage user, create lessons etc..)
I started to implement the authentication feature following the clean pattern, that's to say with a domain, data and presentation layer and I guess I did it quite well. It's (almost) fully tested (I'm trying to do some TDD) and seems to work as I wanted.
Now comes the problem. I want to implement the classes feature. I wish it could be independent of the authentication but it's not the case... The classes feature need to get the authenticated user from the authentication feature. I searched a lot on the internet but I can't find how to implement Clean Architecture with multiple features that need to share some data.
So there are my 2 questions:
How to pass data from a feature to another ?
How to inject dependency in a feature that need data from another feature ? (I used get_it for the authentication feature and inject all dependencies in the main() method before building the app. Since it did not need any external data it worked well. Now it's seem not possible to do the same for the classes feature since it first needs to get some data from the authentication feature).
Thanks in advance for your answers.
Along with your 3 features you should add another called core and inside that folder you can add stuffs that need to be shared. It worked for me . Good luck
One option is if you instantiate classes after the user has already logged in, you can pass that data in as a constructor parameter.
More generally, Provider is probably the best dependency injection tool for flutter. If you "provide" the authentication class to the widget tree for the rest of the app, you can say at any point below it, Provider.of(context) to access it and any public field it has.
Hope you're still working on Flutter projects after that long time.
I've been fiddling around with Uncle Bob's Clean architecture, and I managed to implement it in Flutter few months ago.
It's perfect, it separates your code into components (modules if you're coming from a native Android development environment) and isolates your data sources, so if you want to change the way you make API requests for example, you'll only need to change the remote data source part in your app, and all your application should work as expected.
I have made a test app using Clean Architecture I just uploaded on github and added a humble readme that describes the basic architecture and components of the app, I'll work on written articles describing the code very soon.
For now you can access the repo from here
I'm trying to find an answer to this for some time now... My solution was to create some transformation methods in the model class. For example, I have an ProductModel in the home feature file (from where i can add products to the cart), and an ProductInOrderHistoryModel in the order history feature file. So in the ProductInOrderHistoryModel file I have a method called toProductModel that gets an instance of ProductInOrderHistoryModel and transform to a ProductModel. That way I can add a product to the cart directly from my history order page.
Probably it's not the best solution, and the Uncle Bom would be really mad at me. But it was how I manage to solve my problem...

A/B Test a Page Step in a Single Page without a new URL

I am trying to figure out how to run an A/B Test for a change on a Page Step for a Single Page. The idea is we have a payment flow with several page steps each containing a form. We'd like to swap out forms and test how our users react. We are trying to avoid changing the URL.
I looked into tools such as Google Analytics, but that requires a different URL to run the A/B test. The hesitation about creating a new URL is because our users are known to bookmark them, and we don't want to keep a backlog of redirects from invalid URLs, also we'd like to avoid constantly deploying new URLs for our tests.
I cannot seem to find any tool to do this, so I've tried to think of a few solutions but I'm not having a lot of luck.
My best idea is to build both a and b forms into the page, and when a user accesses the flow, the session randomly(based on a preset%) stores a value that dictates whether the user is in test a or b. Then when they step into that form, the server will serve the proper form to them. If they abandon their session, we'd track that, and if they complete the action, we'd track that.
I feel like there should be a better solution, but I just cannot come up with one.
My results online were either blogs showing how to approach it from a high level, and all of them used different URLs, I have found almost no developer resources.
Thanks.
We're using ExtJS 4.2.2, and .NET as our server.
Whenever you need the server to be involved, you need server-side instrumentation. No free tools offer that, but you could consider Optimizely "full-stack" (has support for C#) or Variant (does not yet).

Connect existing Drupal page with PhoneGap iOS App

Case:
I have an existing page based on Drupal and going to develop a phoneGap iOS App. That means I just need the information of the existing page and want to fill these data in the new app.
My Question is now, do somebody know weather there is a work around or work flow to do so resp. how can I connect the existing page with another page or in my case phoneGap to get just the data? I'm new with Drupal and phoneGap so maybe you have some pages with information, tutorials or some help how to do this.
Thanks in advance yves
Drupal offers a module called "Services" which will allow you to get data or services from your website. You may need to create your own methods on that module to get the information you want to retrieve.
As for the iOS side, you can retrieve the data via XML-RPC, Rest or whatever communication protocol you choose at the server side, or go all the way with drupal-ios.
https://github.com/workhabitinc/drupal-ios-sdk/
You should start looking for the Services module and play with it. You will have an embedded console on that module to test the methods.
Once you're finish with that, take a look at drupal-ios or go deep with your own implementation via XML-RPC or whatever.

Facebook Application Design Question

Iam coding a dating application for facebook. The application has to have a standalone web application part and a Iframe based part which runs inside facebook canvas.
I want to know good ways to design the application. Iam using zend framework, so here is my idea.
One approach that am planning to use is this -
The application folder to contain 2 controllers, index controller being the entry point of the standalone web application and another controller- FacebookController to be the entry point of the Iframe being run inside facebook canvas. Both of them calling the same view files which get written based on which controller is writing to them.
The second approach is to have one single controller as the entry point and use 2 layout files. One for the standalone web application and one for the facebook canvas app.
The reason for choosing these approaches in that the authentication mechanism of the two applications is different.
To get an idea, have a look at www.areyouinterested.com, Iam planning to do something similar to what they have done.
Please suggest me what would be the best way to go around this.
Your first choice is best.
Two Controllers. Two layouts. Common views.
This gives you flexibility to change around a lot of one or the other without breaking the opposite one.
If you feel ambitions, I would even go with two modules. If your application is structured well enough each module will have common components that are re-usable.

VB app to web service

I know very little about web service but I assumed it would be the solution I was looking for. Basically I made an application in VB that I want to be ubiquitous for a lack of a better word. I need it to receive requests from multiple users and respond all at once. I was told "technically if you write a webservice you can provide as many results back to users as are connected."
Maybe there is another solution for me that will give me the results I want.
Here is an example of what I'm trying to do.
Lets say I make an application in VB that does math.
I now make a website. My website allows for a person to input 1 + 1
they click submit and my website then connects to my VB application running on my server
listening for a request. It accepts the request from my website, and then it solves the math problem and returns the answer back to the website "1 + 1 = 2"
That is only an example of the type of thing I need. My problem is that I can't have multiple people visiting my website all connecting to that same application running on my server so somehow I need the application to be where it can be accessed by multiple users. I was told a web service would be the answer but if there is another solution I'd like to know.
If the only solution is a web service, then how can I manage to either convert the VB app to a web service? Can I have to convert the app to asp.net or some other language? Is there an easier option?
Without knowing more about what you're actually doing, I might suggest that building an ASP.NET project around your existing VB code might be a good approach. It's going to be awkward to build any kind of "web service" around an existing (presumably GUI) application, so rebuilding your code inside ASP.NET would be the way to go.
How about doing it the push notification way.
http://channel9.msdn.com/posts/Windows-Phone-7-Push-Notification-QuickApp--Web-Service-With-Azure-Publishing-Instructions
You can inform users of your application via a push notification