How to connect to Cumulocity services in order to add multiple devices data - cumulocity

I'm currently building a dotnet core project that receives data from multiple devices and has to send them over to Cumulocity.
So the flow of the app would be something similar to:
dotnet core app receives new data
connects to cumulocity account
creates device with name according to data received
sends data
repeat for multiple devices
I've been doing this for the past week using this code.
It works fine but then i noticed that calling the client.CreateDevice(...) was not creating new ones when presented with different data, it always hit the same one.
This tells me that i'm probably doing this wrong, that this library is to be used only within devices and not this way.
So my question is, to handle/send multiple devices data to the platform which library should i be using (if any)?
Thank you.

I figured it out, when connecting to Cumulocity the ClientId value will identify the device, to create new ones i just map that property to my devices ID.
Problem solved.

Related

On Azure IOT Hub, Is it possible to create a device which acts an alias for an already deployed device?

For Azure IOT Hub - I am working on a project where I would like to create some scripts based around the device name of an IOT device in the field. The device name already has details related to the location and device number of the location (which is what the script will pull).
Example H4C1F5Device3, where H4C1F5 is the postal code, and device 3 refers to the 3rd device in this location.
However due to a mixup in deployment, some devices don't match this naming convention and make scripting a little broken.
So my question is there a way to create an "alias"/dummy device in IOT hub with the correct name which can point to the previously deployed device with the "incorrect" name?
So far I have only looked at solutions in the Portal (no CLI, Node.js, etc.). I have tried making changes in the "Device Twins" page, but it does not accept changes when attempting to save.
Would appreciate any help on this. The Azure documentation is quite good, but I'm having trouble finding the solution to this exact query.
There is no such feature in Azure IoT Hub. You could create the new device IDs and reprovision your device with the new credentials.
It's also good practice not to store this kind of information in the device ID. You could use tags on the device twin (or desired properties if the device needs to know), unlike the device ID they are mutable.

Assigning webhooks to Firebase Messaging "subscribe to topic" event

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

create multiple client on apprtc

I am new in webrtc.I need to create a new implementation of webRtc. I got the source code of apprtc from Github. it is working fine on my local machine.
But in apprtc, it will support only maximum 2 clients(only one client can join to a single room). I need to modify the apprtc to support more than 2 clients. I want to join multiple clients to a single room. Is it possible with apprtc? if else, is any other way using webrtc?
Try https://httprelay.io it allows one to many communication via ajax requests and requires no additional libraries.

How to add dynamic text to live tile in windows 8 with javascript

Well, the topic says it all. I'm dabbling with windows 8 app development using html/css/javascript and I'm having a hard time finding information on how to dynamically manipulate the live tiles.
There is a lot of information out there on how to create multiple tile xml files and launch them after each other but if anyone had a good resource, or even better, a first-hand explanation, on how to create these tiles programatically to, say, make a countdown tile, it would be greatly appreciated.
There's no way to programmatically update the text/image on a live tile directly in real time.
The only APIs available are those in the Windows.UI.Notifications namespace, such as are shown in the Sending a tile update Quickstart.
You can use the notification queue, as shown here, to provide multiple updates that will automatically cycle, or you can use an external service, such as Windows Azure Mobile Services to send tile updates. Using push notifications from an external service will probably get you closest to the behavior you're looking for, since it will not rely on the app being active in order to update the tile. Be aware, however, that the app will need to run at least once in order to create the channel URI that's needed for the external service to update the tile.
For more info on Windows Store app development, register for Generation App.

What is best Way to store data locally on iphone?

I am designing a web app that fetches data every time a user logs into his/her account. The data is an xml file containing image links and some text. I want this data (after image fetch/load from the actual link) to be stored locally so that every time an user opens the app it doesn't have to load everything from scratch. Locally stored contents should load first, then in the background some network processing shall be done so that the newer data is automatically updated. For storing the data I am planning to use SQLite but is there any other efficient way other than this to do the same ?
How does facebook app do this kind of stuff ? Thank you so much
The Facebook app is not really a web app but rather a native Cocoa Touch app.
If you are really creating a web app, your only option is to use localstorage and fetching new data asynchronously using XMLHTTPRequest.
If – on the other hand – your app is a native app, you’ll most likely want to use Core Data for storage and get incremental updates in a separate thread (or using libdispatch in case you’re only targetting post 4.0 devices) using a separate managed object context which you can then merge to the main thread using mergeChangesFromContextDidSaveNotification:.