Is it possible to start Siri from the cord side with Swift?

Asked 2 years ago, Updated 2 years ago, 114 views

Is it possible to start Siri from the cord side with Swift?

swift ios xcode

2022-09-30 21:13

1 Answers

I have already asked the following questions to my home SO if I only want to start Siri.

Can you invoke Siri from an app program using the API?

#import "GSEvent.h"

- (void) launchSiri {
   self simulateTouchEvent: kGSEventMenuButtonDown;

   double delayInSeconds = 1.0;
   dispatch_time_topTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds*NSEC_PER_SEC));
   dispatch_after(popTime, dispatch_get_main_queue(),^(void){
      self simulateTouchEvent: kGSEventMenuButtonUp;
   });
}

- (void) simulateTouchEvent: (GSEventType) type
{
   struct GSEventRecord;
   memset(&record,0,sizeof(record)));
   record.type=type;
   record.timestamp=GSCurrentEventTimestamp();
   GSSendSystemEvent (&record);  
}

Unfortunately, I am also studying SiriKit, so I don't know if I can realize what you said.
(It has not been realized, but Siri seems to be able to invoke app functions)
Apple SiriKit, but the support seems to be from iOS10, so
It may be difficult if the operating system that I supported in the past is...


2022-09-30 21:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.