automatic update of Iot Devices Status in to the WPF C# application - wpf

I have IoT device with status(Idle, Recording, Editing, Saving, Offline) which is updated in the device twin by the device app.
I need to get the device status and show in the WPF c# application automatically in real time.
Current the wpf application is updating by using the IoT query string on button click. but i need to update the status without sending request.
Please help me on this.

The problem goes a bit out of the scope of your WPF and requires some backend(cloud) changes.
You can create a message route to send the device twin changed notification.
As an endpoint, you can have Event Hub and then Azure Function that is triggered on the message in that Event Hub. There you can use SignalR to publish some information and then implement handling that in your WPF.

Related

How to subscribe to Salesforce connected app webhooks?

I want to implement a connected OAuth app in Salesforce which should trigger push events in case some entities changed, for example an opportunity was closed.
Zapier implemented something similar
https://zapier.com/apps/salesforce/integrations/webhook
Could not find something I need which is a simple way to subscribe to entity changes using the OAuth client's token and passing a webhook endpoint. I read about apex callouts, streaming API and outbound messages.
Yeah, we solved this exact problem at Fusebit and I can help you understand the process as well.
Typically speaking here's what you need to do:
Create triggers on the Salesforce Objects you want to get updates for
Upload Apex class that will send an outgoing message to a pre-determined URL
Enable Remote Site Setting for the Domain you want to send the message to
Add in Secret Verification (or other auth method) to prevent spamming of your external URL
If you're leveraging javascript, then you can use the jsforce sdk & salesforce tooling API to push the code into the salesforce instance AFTER the Auth flow has occurred AND on Salesforce Instances that have API access enabled (typically - this is enterprise and above OR professional with API enabled).
This will be helpful for you to look through: https://jamesward.com/2014/06/30/create-webhooks-on-salesforce-com/
FYI - Zapier's webhooks implementation is actually polling every 15 minutes, instead of real-time incoming events.
In which programming language?
For consuming outbound messages you just need to be able to accept an XML message and send back "Ack" message to acknowledge receiving, otherwise SF will keep trying to resend it for 24h.
For consuming platform events / streaming API / Change Data Capture (CDC) you'll need to raise the event in SF (Platform Event you could raise from code, flow, process builder, CDC would happen automatically, you just tell it which objects it should track).
And then in client app you'd need to login to SF (SOAP or REST API), subscribe to channel (any library that supports cometd should be fine). Have you seen "EMP Connector", mentioned for example in https://trailhead.salesforce.com/en/content/learn/modules/change-data-capture/subscribe-to-events?trail_id=architect-solutions-with-the-right-api ?
Picking right messaging way is an art, there's free course that can help: https://trailhead.salesforce.com/en/content/learn/trails/architect-solutions-with-the-right-api
And pretty awesome PDF if you want to study for certification: https://resources.docs.salesforce.com/sfdc/pdf/integration_patterns_and_practices.pdf

React Native make running services

This apps closed but services are running. How can i do this on react-native?
I would like to make services that listen my app notification.
You can use react-native-firebase package for this specific purpose.
Way 1 - Data only notification
Check out the data only notification section documentation here. Please note that this would work only on android.
Way 2 - Notification + Data
Send a notification and when user presses it, update the data of the application. This should work both for android and iOS. You can send key/value pairs in your notification and send a type as one of the key/value pairs. Now, when you handle the notification based on this type you can can API's and update data as required. You can read more about it here

how to send and recieve notification using WPF and WCF

I am using WPF and WCF for client server application. but i got a problem.
How to notify any update of client to other client.
Server(WCF)
Client1(WPF)
Client2(WPF)
if client1 enter any new record,immediatly notification send to client2 .
please suggest me best way to this complete task.
Thanks..
We have achieved such a requirement by using WCF Duplex Services. You can find enough information by googling about implementing a duplex service.
Basically;
clients send a client identifier (uniquely generated for each client) while registering to duplex service.
when WCF service updates data, pushes an update notification (including the notification source's client identifier) to all the registered clients
clients check for the originator's identifier when they got a notification. Discarding notifications caused by itself.
A few notes:
You can include everything about the updated data inside pushed notification payload to understand the change type or entity type.
Different bindings supported by duplex services. Usage of nettcpbinding is suggested if clients and service are in the same network and .net dependency is not a problem. You can find more information about support binding types from here or here.

Loading thread for Windows Form Application?

I am currently developing a windows form application as the subscriber for my WCF service and a asp.net application as the publisher for the service.
Whenever I launch the service or the client, and attempt to "Connect" (AKA subscribe) to the service, it would take awhile to load before it displays a successful message or exception handling. And while the thing "loads", the windows form sort of "hangs" temporary until the thing loads finish.
Is it possible to create a loading effect while they are "loading" to feedback to the user? Anyone can guide me on how to actually start developing this effect.
Thanks!
You can use asynchronous service calls. Before calling the asynchronous call you can show graphical representation of this and in the completion of the asynchronous call you can stop displaying the progress of the call.
Refer to this link to know how you can call the wcf service asynchronously.

limit the instance of silverlight application to one

How to make sure that only one instance of a silver light web out of browser application is running?
How to make sure that only one instance of a silverlight web application inside the web browser is running?
Take a look at the part of the Silverlight Docs: Implement Communication Between Local Silverlight-Based Applications
You can use the LocalMessageSender and LocalMessageReceiver. Create a sender and send a message, if you get a response inform the user by loading an alternate root visual. If you don't get a response set up a receiver so that any other sender do gets a response.

Resources