Can I change a value of variable by using Siri Shortcut? - ios

I want to control my BLE Device with the help of Siri. Like "Fan On" or "Fan Off". So, Is that possible with the help of Siri Shortcuts?
Or is there any alternative way to Contorl BLE Device Fan with Siri.
I think if I am able to change a value of variable through Siri Shortcut then I can do this.

I am now able to switch to On or Off my BLE Device Fan with the help of Siri Shortcuts. I just needed to to do one thing that I missed before: to pass the complete class to Siri Shortcuts Intent.
When I invoked Siri and said my own phrase, then Siri will execute the complete class code and off my device fan.
The main thing that I missed is Pass the complete class to Siri Intent rather than passing only specific section of code or function.

Related

How to get the status of Siri & Search of Settings?

Is there any idea for getting the status Siri enable/disable with swift or ObjC?
I have a feature which is detect Siri is launched. I found a workaround solution from https://stackoverflow.com/a/54822234/4562870. But it has a bug the hasSiri() is always on if Siri in the Settings is disable. So I want to know the Siri is enable or not.
I've searched a lot how to get the value of Listen for "Hey Siri" and Press Side button for Siri in Settings Siri & Search, but no one is about it. Could some one help this? Please help or try to give some ideas how to achieve this. Thanks!
Update:
I got a way listen UIApplicationWillResignActiveNotification. But it isn't good for me. Cause my project is about the map tool so that it's possible running in the background. The method will be no used.

Swift 3 - Run an app with specific keyword by using Siri

According to Intents and thanks to this thread, I know that you can open your app via Siri with "Open [APP NAME]",
What I want to know is if it is possible to tell to Siri just only one word like 'Cheese' to open the Camera app or an other specific keyword set beforehand to open your own app using Siri.
Is it possible ? If yes, I have to use Intents to do that or there is another way ?
Siri runs on the OS level, so in order to use any intents you have set within your app, the user must specify your app.
"Get a ride with Lyft" or "Message Mom in Facebook" etc..
More examples in the doc:
https://developer.apple.com/sirikit/
You can use shortcuts app which comes inbuilt in all iOS devices, for knowing more about Siri Shortcuts refer below links.
https://developer.apple.com/documentation/sirikit/adding_user_interactivity_with_siri_shortcuts_and_the_shortcuts_app
https://www.pocket-lint.com/phones/news/apple/144718-what-is-siri-shortcuts-and-how-does-it-work

iOS Siri kit integration - invoke the app and send the custom instruction

Here is my detailed description to achieve by using Siri.
I'm new in Siri kit integration. I have an app which has certain functionalities like send some information to server. The input is number. Below mentioned actions I want to do via Siri :
Instruct to Siri - Send MyAppname amount used
Siri asks - what is the amount.
Instruct to Siri - Submit
Go through Apple doc and some of other blogs but I didn't find any solution as per my requirements.
1.https://developer.apple.com/library/prerelease/content/documentation/Intents/Conceptual/SiriIntegrationGuide/SiriDomains.html#//apple_ref/doc/uid/TP40016875-CH9-SW2
2.http://jamesonquave.com/blog/adding-siri-to-ios-10-apps-in-swift-tutorial/
Do we have any custom Intent to perform this?
Is there any way to achieve this actions
Please let me your ideas.
Thanks in advance.
You can only use the intents from the available domains. If you want to send money or something similar to another user use the INSendPaymentIntent intent.

Listen for iOS device power button presses

I am creating an app, which needs to do something when the user presses the power button 5 times.
I figured out that it's difficult to implement in iOS, but I think it's not impossible. How do I listen for power key events, even when the app is running in the background?
Can anyone help me to find solution?
you can tap a power key once and also you cannot detect the event from your application, this is not possible in iOS as far now, better try a different way to send alert with in your app, set some conditions with in your app and then send a alert based on those conditions if satisfied, I think this would be better,
Somehow ,If you try to override the existing functionality of the power key, apple will reject your app I think so,
You can't directly get the power button events. But there are notifications which you can count like UIApplicationProtectedDataWillBecomeUnavailable or UIApplicationWillResignActiveNotification. Or just register for all low level notifications with CFNotificationCenter and see if you find something fitting like com.apple.springboard.lockstate.
I don't think you can override system level actions like holding the power button, pressing the home button, overriding the mute sound switch within your own app. iOS system doesn't exactly behave like an normal computer OS, it's to much more limited.
Apple is not allowing you to use hardware components completely. They have added some restrictions. They provided the method in the app delegate i.e. applicationDidEnterBackground can catch the home button press .Also they has provided the the API's to access the camera,bluetooth etc .At least this much of API's I know which provided by apple publicly to access the hardware. You cannot access the other hardware elements in your application which not provided publicly by apple .If you are able to do this by any way then also your application will not approved by apple .

How to detect language of the WatchKit voice-to-text input?

I am trying to get some input from the user on the Apple Watch using presentTextInputControllerWithSuggestions. I wonder what happens if user speaks multiple languages – is there a way to detect which language has he spoken?
Also, is there a way to find out what languages are set in his preferences?
Not having a Watch on hand, I don't think anyone here knows. (Edit: this was first posted before the Watch launched.) But even though it'd be really cool if there were dictation software that could guess cual idioma で話しています from word to word, watchOS is no different than iOS in that respect.
In iOS, Siri listens only in the language you set in Settings, and dictation listens only in the language of the active keyboard (whose microphone button you pressed to start dictation).
In watchOS, Siri likewise has a set language. Dictation is based on the keyboard language last used on your paired phone, but you can also change the language during text entry with a force press. That's a user choice for a system service, so it's opaque to the app, just like choice of keyboard is to an iOS app. (You're welcome to perform some sort of text analysis of you want to know what language of text the user has entered.)

Resources