Sending config/state to device from firebase function via google iot with Qos 0 - google-cloud-messaging

Is there any method to publish data to device from firebase function with qos 0.

There is an example of using a Google Cloud Function to publish a configuration change to a device. That same function should be easy to translate to Firebase functions if that's where you're looking to run it.

Related

Is there a REST api to create a channel in Agora Web sdk?

I'm trying to integrate our web app with voice/video call feature by using Agora. I have read the documentation on their side, but I have not found any rest api for web sdk to create channel. Basically, when a user joins a channel, we have to pass in the app id, token, and channel name. I know that we can create channel in agora dashboard, but I'm looking for a dynamic way, where we can trigger a REST api to do it. Any help would be greatly appreciated. Thank you.
You can deploy your own token server, that will give you the token based on a channel name and uid.
Here's a pre-built server that you can deploy to Heroku in 2 clicks.
I have been able to build a node js to generate agora io token. It is hosted in heroku. The source code can be found here:
https://github.com/Hoang-Minh/partie-agora-token-generator
Here are the endpoint that you can call to generate a token:
api/agora/rtcToken/:tokenType where
tokenType can be either uid or account, depends on what you need.
The default expiration time that I have is 24 hours.

suggestion needed for Agora WebSDK

Looking for a suggestion,
In a live broadcast show, I also want to record the broadcast so that people can listen to the archived show later. The recoding API, however, does not exist in Web SDK. What would be a good way to record the broadcast?
you can use the Agora Cloud Recording RESTFul API. Here is the quick start guide of that: https://docs.agora.io/en/cloud-recording/cloud_recording_rest?platform=All%20Platforms. The recorded videos can be stored in a third-party cloud storage like Amazon S3 and Alibaba Cloud.

Azure IOT Central - Cloud to Device messages using MQTT

My IOT Device is connected to IOT central and am able to receive data through export option.
Now i want to send some command to My device,
For example,
Below json data it is expecting to send heartbeat of device on subscribed URL'devices/....ba50621/messages/devicebound/#'
{ "action": "heartBeat",
"requestId": "b2c3d4e5-3424-4dca-32dc-12b73290cfed"
}
i created service application by refering below links to send Cloud to device message,
Stackoverlow ans and
Sample app
used connection string as,
"HostName=asdasdas.azure-devices.net;DeviceId=asdasdasda50621;SharedAccessKey=nXmyveEPrV....pmo9jULvDtik="
This connection string was received when device got register though dps. i used this on service application to connect. i dont know whether this correct.
When application tried to send message, i got unauthorized error.
In the documentation of above link says to get connection string from shared access policy of IOT hub. but i am using iot central and used above connection string.
Kindl help me fix it.
Cloud to device messaging works a bit different in IoT Central than a plain IoT Hub. Instead of connecting the service client to your IoT Hub, you have to use the IoT Central REST API.
You can either send commands to your device or update a property. The complete documentation including samples are here. You can find the documentation to send commands to your devices here.
In the case when your IoTC App is NOT a legacy application, you can use a preview IoTC App (which is a CapabilityModel driven model type) with the REST APIs support for calling your device. Currently preview version doesn't have a feature what you are trying achieved, such as sending a C2D message to the device.
The IoTC preview supports only calling the device method - Execute Command.
The following screen snippets demonstrated this feature. For this example, I am using my Azure IoT Hub Tester, where the virtual devices are using the MQTT protocol directly to the underlying IoT Hub of the IoT Central App.
I have created a free IoT Central App with the AzureKit ESP32 template, registered and provisioned for device1 and connected from the Azure IoT Hub Tester:
Showing a command echo PnP model:
Invoking a command echo by REST POST call. Note, that the Authorization sastoken must be created in the Administration/API tokens page.
The device1 received the direct call and than published its response (note, that this screen was not snipped for its short response time limit). The following screen snippet shows a complete sync REST call with the device1. Note, that this preview version didn't handle the response payload based on the mentioned document and PnP model.
Finally, this screen snippet shows the history of this command action via the REST:
Note, that there is also missing the response object from the device like is described in the CapabilityModel schema.
UPDATE
I have added the missing screen snippet on the device side when the method echo has been invoked:
As you can see the above picture, the device received the REST POST payload and its published response back to the invoker based on the PnP model schema.
UPDATE 2
The following screen snippets demonstrated invoking a command upgrade for device4. Note, that the device4 is a PnP device created from the template SmartConnect FM-201 IoT Gateway.
The device4 received a message on the direct method upgrade:
The device4 sent the response back to the invoker and IoTC app. The following picture shows its history:
Notice again, there is missing a response object in the REST response and also in the IoTC App. I hope, this is a bug in this preview version and it will fix it soon to follow up the CapabilityModel schema.

App won't run without google play services, which are not supported by your device Error while using firebase analytics for react native mobile app

I am trying to integrate firebase analytics on react native app, I have completed all the prerequisites and got a successful build running on Honeywell android Device, but when I open the app it gives above error. There are many such duplicate question but nothing works for me as I can't have play store as the target devices are Handheld android devices and not mobile devices. How to integrate firebase analytics without having to install google play service.
Thanks for Answer #JakeSteam
But I could get firebase integration working without google play service error.
Issue Details:
I was using react native firebase 5.x.x, which works fine but will give a pop up message mentioned in question if your device doesn't have google play service.
Workaround:
Upgrade react native firebase to version 6.x.x, the community has redeveloped this repo and I am not having issues with it now.
NOTE:
Without google play service on your device you can only use few firebase services like analytics, crashlytics etc.
As a Firebaser said:
Firebase as a platform requires Google Play Services, even though some Firebase products may be able to work without it.
If you cannot use Google Play Services, you may want to look into Google Analytics, which does not require it:
Note: Google Analytics can be used and will work on devices that do not have Google Play Services. In this case you still download and use the Google Play Services SDK and Google Analytics will automatically fall back to local dispatching.

Can we integrate firebase analytics in old project which has google cloud messaging? so i want firebase-analytics and google cloud messaging also

I have tried to add fire base-analytics in old project which has google cloud messaging which i don't want to change, i am getting error for google cloud message for imports.
Google Cloud Messaging has been deprecated as of 10 April 2018.
You can import the old project into Firebase Console and generate a config file. Analytics is a core service and track most of the app data automatically with few lines of code required for initialization. Take a look at this doc.
Please note that the Analytics data will start populating on Firebase dashboard only from the point onwards you integrate the SDK in the app. Also you can easily transition to Firebase Cloud Messaging with that approach.