Created
September 18, 2018 07:26
-
-
Save WildStudio/38af120fe56b36ce0ff96c6310cf1524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Once resolution is completed, perform validation on the intent and provide confirmation (optional). | |
func confirm(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) { | |
// Verify user is authenticated and your app is ready to send a message. | |
let userActivity = NSUserActivity(activityType: NSStringFromClass(INSendMessageIntent.self)) | |
let response = INSendMessageIntentResponse(code: .ready, userActivity: userActivity) | |
completion(response) | |
} | |
// Handle the completed intent (required). | |
func handle(intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Void) { | |
// Implement your application logic to send a message here. | |
let userActivity = NSUserActivity(activityType: NSStringFromClass(INSendMessageIntent.self)) | |
let response = INSendMessageIntentResponse(code: .success, userActivity: userActivity) | |
completion(response) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment