Exemplo n.º 1
0
        // Implement handlers for each intent you wish to handle.
        // As an example for messages, you may wish to add HandleSearchForMessages and HandleSetMessageAttribute.

        public void HandleSearchForMessages(INSearchForMessagesIntent intent, Action <INSearchForMessagesIntentResponse> completion)
        {
            // Implement your application logic to find a message that matches the information in the intent.

            var userActivity = new NSUserActivity("INSearchForMessagesIntent");
            var response     = new INSearchForMessagesIntentResponse(INSearchForMessagesIntentResponseCode.Success, userActivity);

            // Initialize with found message's attributes
            var sender    = new INPerson(new INPersonHandle("*****@*****.**", INPersonHandleType.EmailAddress), null, "Sarah", null, null, null);
            var recipient = new INPerson(new INPersonHandle("+1-415-555-5555", INPersonHandleType.PhoneNumber), null, "John", null, null, null);
            var message   = new INMessage("identifier", "I am so excited about SiriKit!", NSDate.Now, sender, new INPerson[] { recipient });

            response.Messages = new INMessage[] { message };
            completion(response);
        }
Exemplo n.º 2
0
		// Implement handlers for each intent you wish to handle.
		// As an example for messages, you may wish to add HandleSearchForMessages and HandleSetMessageAttribute.

		public void HandleSearchForMessages (INSearchForMessagesIntent intent, Action<INSearchForMessagesIntentResponse> completion)
		{
			// Implement your application logic to find a message that matches the information in the intent.

			var userActivity = new NSUserActivity (nameof (INSearchForMessagesIntent));
			var response = new INSearchForMessagesIntentResponse (INSearchForMessagesIntentResponseCode.Success, userActivity);

			// Initialize with found message's attributes
			var sender = new INPerson (new INPersonHandle ("*****@*****.**", INPersonHandleType.EmailAddress), null, "Sarah", null, null, null);
			var recipient = new INPerson (new INPersonHandle ("+1-415-555-5555", INPersonHandleType.PhoneNumber), null, "John", null, null, null);
			var message = new INMessage ("identifier", "I am so excited about SiriKit!", NSDate.Now, sender, new INPerson [] { recipient });
			response.Messages = new INMessage [] { message };
			completion (response);
		}