示例#1
0
        public void HandleCreateNote(INCreateNoteIntent intent, Action <INCreateNoteIntentResponse> completion)
        {
            // データ登録
            var client = new HttpClient();

            client.BaseAddress = new Uri($"{Consts.AzureApiUrl}/");

            var item = new Item
            {
                Text        = intent.Title.SpokenPhrase,
                Description = ((INTextNoteContent)intent.Content).Text
            };

            var serializedItem = JsonConvert.SerializeObject(item);

            Task.WaitAll(
                client.PostAsync($"api/item", new StringContent(serializedItem, Encoding.UTF8, "application/json"))
                );

            var userActivity = new NSUserActivity("INCreateNoteIntent");
            var response     = new INCreateNoteIntentResponse(INCreateNoteIntentResponseCode.Success, userActivity);

            response.CreatedNote = new INNote(intent.Title, new[] { intent.Content }, null, null, null, null);
            completion(response);
        }
示例#2
0
 public void HandleCreateNote(INCreateNoteIntent intent, Action <INCreateNoteIntentResponse> completion)
 {
     throw new NotImplementedException();
 }