Create Google voice command without IFTTT - google-assistant-sdk

I'm trying to create my own application that uses the Google Assistant device and is able to control my home devices like turn on/off light, lock door, feed cat etc.
I read a lot about Google smart home and this is kind of what I'm looking for but it is problematic to add additional commands and than needs to use Google Home application to configure it again.
IFTTT has a workflow I'm interested to but has limitations in a number of applets and it is another service that is needed to use to execute commands which I would like to avoid..
I want to do something similar to IFTTT but programmatically on my own.
Connect to Google account using specific credentials
Add commands like "Turn on light", "Feed cat".
Then I would like to say to Google: "Hey Google, Feed cat". After saying this command I would like to get a REST API request in my application which I can process and do what I want (like webhook in IFTTT)
Expected application flow
Is it possible to do that without using IFTTT?
I yes how because I can not find any tutorial or Google documentation related to this approach.

Assuming the question is about how to implement the suggested examples using Google Smart Home platform.
The fulfillment flow is actually very similar to what's described in the question:
And commands close to the question examples could be implemented using:
"Fill the cat water bowl": the PETFEEDER device type with the Dispense device trait.
"Turn on the light": the LIGHT device type with the OnOff device trait.

Related

Google Home application support

I have a device which I want to control with Google Home.
Device also can be controlled via mobile app.
It will be a commercial device so many users have different devices and, of course, I can recognise them in my mobile app.
I read documentation about Action and Home Graph, but it is still not clear how I can integrate my device/app with google home in the same way as, for example, Hue is integrated.
I could not find where I can "register" my device/app with google so it will be shown in supported devices.
What I want to achieve is the following:
User gets device, installs the app, connects it device to the app. <- this already works.
Then user goes to google home integrations, selects my platform and he is ready to go.
Maybe someone can push me to the right direction where to start?
The smart home documentation provides the content to help you get started, along with several codelabs to learn about the webhook fomat.
When you are developing your action, through the Actions Console, you will be able to see your service in the full service list as "[test] Your project name". Once your integration is ready, you submit it to be published in the full list of services.

What are the default Apple URL schemes for the default apple apps?

I am trying to track down these URLs because I would like to integrate them with the Shortcuts (previously workflow) app. My end game is to make queries that will perform certain functions that I can call from a google home device. In simpler terms, I want to make google home more "Apple friendly."
I have not found anything that is too current out there on the URL schemes. I saw that sending a SMS message was triggered with sms://<PhoneNumber> , but I am not sure how up to date that information is.
I plan on adding features to search Apple Music (by triggering a workflow). I am also planning on adding text message features.
I am also looking into making an app for google home, but I still am in the learning stage with that. Any advice on making google home more Apple friendly would be greatly appreciated.
This is a constantly changing list given the number of features being added or third-party apps. Here's a list that does a good job of staying up-to-date: https://ios.gadgethacks.com/news/always-updated-list-ios-app-url-scheme-names-0184033/

How to make my iOS APP share files directily to another APP like Workflow "Open in" action

Here is the Workflow Action. It seems that Workflow can send a file to another APP directily. Any ideas?
The normal way to send a file to another APP is using Share Extension, but Workflow APP could send it directily without showing the Action Sheet and selecting an APP.
If you set an action like this and run your workflow, it just open the selected APP and that APP got the file.
So I just want to know is there any way to make it happen? Or it just a secret API of iOS and Workflow just use it because of the purchase?
Your exact question needs to be stated more clearly (e.g. exactly WHAT you are trying to accomplish instead of just "integrate"). To get you started, some quick info:
At my last check, Workflow integrates with apps in a few main ways:
1) Via the iOS sharing/share-sheet interface.
2) Built-in support for the app within Workflow itself.
3) (of course, Workflow can also leverage Callback URI's of other apps to integrate with them like any other app can.)
If you want to have direct, built-in support from Workflow, the Workflow team itself must add the support into the Workflow app. This is easier for them (and others) if your app exposes a proper API with functions that allow direct integration.
Going into this further is too broad of a topic for a quick answer. I hope this helps some.

Siri Kit For Home Automation App?

after reading the apple doc on SiriKit, there are only 6 services where Siri SDK can be used. But i would like to know if there is any crack or way where i can use this in my home automation app, where the api request is sent to my server on my voice command.
Edited 2018
Is it possible now with the release of iOS 12, WWDC 2018 and the new updates in Siri, Siri Shortcuts.
Thanks in advance
As you have already pointed it out that there are currently only six categories which are supported by SiriKit. If you want to achieve something like Siri, you can give try to SpeechFramework introduced in iOS 10. That is not actually like SiriKit, but you can achieve your goal with some efforts and playing with the framework. Here is the very good tutorial for using SpeechFramework.
For the point of any crack or something, I would highly not recommend it as there may be chances of app disapproval from apple.
EDIT:
Please check the EDIT section in question.
You can kind-of do it with Siri Shortcuts, but it takes effort from the user.
There is no way for the you to create a special voice command. Only users can go into Settings > Siri Shortcuts and define a voice command to execute a shortcut you created from the Application.
Also, note that the voice command cannot have any parameters that are passed to the application. The voice command would have to execute a specific action that was defined by the application via the Shortcut. So, "Turn on light X," is a different shortcut than "Turn on light Y." The user would have to create two different voice commands.
As far as the shortcut goes, you can execute pretty much any code, so making an API call shouldn't be an issue.

How to work with Firebase App Indexing for IOS Apps

i am in the process of making my app with firebase i am pretty much done with that except Firebase App Indexing. I am very exited with this feature because it could help me to increase my app get more traffic from the web but the problem is i really can't able to see how to implement this. According to Firebase Docs i just need to register my app with this pice of code
[[FIRAppIndexing sharedInstance] registerApp:your Apple ID from iTunes Connect];
I have done that but what should i do after that?
1.My app is firebase app that means i don't have any website to host my content except firebase realtime database. Does my content is available for crawlers? if not how can i make available to them?
2.If i can able to show my content in the google search results i don't wanna show all the content and i wanna show just some of my content for example i have a social app for sharing General Knowledge questions, i wanna show just the question like "What is the highest mountain" in the search results and if the user want to see the answer it should take them to my app how can i do that?
3.As per docs i came to know that i need to create univiersal links for my app content to direct users from google search but how shold i do that ? Lets say should i crate universal links when the user create question?? if so how can i do that ??
Thank you very much for the help.
This is not currently possible on iOS using Firebase App Indexing. The situation is slightly different on Android, but that is not applicable to your question.
On iOS, Firebase App Indexing is simply highlighting pages on your website in Google search results that have corresponding content inside your app. This is achieved by piggybacking on Apple's Universal Links standard, and there is no proactive 'crawling' going on inside your app. This means unless you have a corresponding web page for your app with 1:1 content parity, you can't really benefit from Firebase App Indexing on iOS as it comes out-of-the-box.
The best workaround is to generate little 'placeholder pages' for every piece of content in your app, which the sole purpose of opening your app (if it is installed) or redirecting to the App Store (if it is not installed). Ideally you'll need some sort of deferred deep linking system so that users still see the correct content after downloading. Fun fact: this is essentially how HotelTonight operates their entire business model. Unfortunately Firebase's implementation is not mature enough to support this full flow, and Google hasn't quite figured out how to rank app-only content properly yet in search results so you will probably need to pro-actively submit your placeholder pages to them.
Shameless plug: at Branch, we provide all of the above as a free service. You can read more about it here and take a look at the set up docs here.

Resources