IOS mobile access to Google IOT Core REST API authentication authorization scope problem - ios

一:I would like to ask some questions about our IOS mobile access to Google IOT Core permission scope authentication. We are planning to use API services from Google IOT Core to access device-specific data;
But we encountered the problem of OAuth authentication, requesting the scope of Google API, it may take up to several weeks, I wonder if this is the case?
OAuth image
My application will use the following request scopes: https://www.googleapis.com/auth/cloudiot, https://www.googleapis.com/ auth / cloud-platform I want to be able to view and manage and manage and Create a registered device.
https://www.googleapis.com/auth/pubsub Want to use this API to publish subscriptions / topics on your phone, receive device data, and assume: temperature, humidity, alarm values, etc. Mobile terminals can access IoT data through HTTPS (https://cloudiot.googleapis.com/v1/{name=projects//locations//registries/*}) nodes.
二:Use Google Cloud Functions to connect to the cloud platform to get device data from IOS;
Google Cloud and the device have been successfully bound and deployed through the console, but it is impossible to understand how to write the Google core API from the cloud function so that the device connects to the cloud, IAM grants permissions, or the private key to access the Google API (Purpose: IOS mobile phone calls Google API through cloud functions, implements JSON interface, and gets device data for IOS) Thank you in advance, thank you!

My article might be helpful for your problem if you're still having this issue, It shows how to connect to IoT Core using CocoaMQTT and SwiftJWT, you can do something similar but instead of connecting to the specific device you could register the device with a given ES256 public key.
Controlling you phone from the cloud

Related

How do I build Google smart home action that only need to communicate with my IoT Gateway?

As I looked into Google's references about smart home, I got to know that Google Home connects directly with the end device. But I wanted to specifically connects it with my gateway and sync with it so Google Assistant would only need to send command to the gateway to fulfill a user's request like "Turn on the light". Is this possible or Google need to connect to every end devices for it to work?
If you want, you can create a Hub device that talks to the Cloud and acts as a gateway to smaller, low-powered devices. In that case, you would still return all of your devices in the SYNC response but then handle all of the EXECUTE requests in your Cloud by forwarding to the Hub. From there the Hub can handle it however is needed.

Microsoft Graph API Create Device | Correct deviceID

We're trying to automate device creation using the Graph API.
What is our situation: We don't have intune. We use another 3rd party MDM solution and have a API there to extract information. We have Azure and we use conditional access to allow access to cloud ressources from managed and compliant devices only.
So far only Intune can report compliance status to Azure AD of a managed iOS device. So we were trying to automate ths process by creating devices in Azure AD using Graph API and stuck on the value to use for deviceID in the JSON (documentation).
The general UUID and UDID, what we can get from our MDM API are not working, so the device is not recognized because the deviceID read from the OneDrive App for example is not matching with UUID/UDID we extracted, during authentication in Azure as compliant/managed.
Can anyone help how to correctly generate/use the Create Device API in Graph to have the right deviceID so the device will be recognized correctly when accessing cloud resources?

Use Google Places nearbySearch function in iOS

In Web API, use the nearbySearch function will return the results nearby the specific coordinate.
But I cannot find a similar function in iOS SDK.
I think the worst way is using REST API likes
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=22.979468,112.544345&radius=100&key=API_KEY by Alamofire
But I have another problem, I don't know how to restrict my API key for iOS REST API only.
I tried to set it for iOS Application but it does not work.
Please give me some idea, thank you very much!
You cannot apply iOS app restriction on web service API key. The only supported restrictions for web services are IP address restrictions. This supposes that you are executing web service requests from your backend server and restrict an API key with IP address of your backend server.
In case of mobile iOS app that means you should create an intermediate server to execute web services and pass responses back to your app in order to protect an API key that you use with web service.
There is a feature request in the Google issue tracker to add nearby search as a part of Places API for iOS:
https://issuetracker.google.com/issues/35830334
Feel free to star this feature request to add your vote and subscribe to further notifications from Google.
Hope this resolves your doubt.

Brokered message transfer between iOS device and backend using Azure Bus service queue

I am trying send data between iOS device and backend using azure bus service .
But all the things that I found on Microsoft azure portal provide Accounts storage methods to azure or through hub providing push notifications.
I am trying to send a "Brokered message"(used for distributed systems) through a queue client using bus service Queue(FIFO). I also came across this method but found that on .net C# not for iOS even Our team here is able to send the data in .net but no luck with Mobile systems(iOS and Android)
You should be able to use REST API for Azure Service Bus from iOS or Android. There's also a good walk-through tutorial you can try.

What is the most efficient way to create end-points for an Amazon SNS service?

I am using Amazon SNS Service for an iOS application that needs push notifications.
I have figured most of the things, except for the part where I have to register my device tokens.
This is where Amazon talks about it. It can be done manually or with the help of createPlatformEndpoint API which they obviously recommend for bulk uploads. My question is how we can directly register tokens from devices that will install the app later on. The documentation talks about a proxy server which I would want to avoid as of now. Isn't there a direct way of doing this, like where I can directly call a method and push the device token received in the application to my SNS Platform?
This, is a possible duplicate except that it is in reference to Android.
The AWS Mobile SDKs support accessing SNS directly from the mobile device. If you're interested in seeing code demonstrating this on iOS, we included some as a sample we prepared for re:Invent 2013 called Mobile Photo Share.
The important thing to note when accessing SNS directly from the mobile device is that you'll want to restrict the credentials delivered to the device to only those services and resources you'll need to access. You can accomplish this via web identity federation or a token vending machine with appropriately restricted policy.
If you want to learn more about the Mobile Photo Share app, we had two talks at re:Invent about the app and its architecture. The video and slides for those talks are available here:
Building Cloud-Backed Mobile Apps
Integrating Social Login Into Mobile Apps

Resources