Sirikit,INSearchForBillsIntent对我不起作用xamarin.ios

时间:2018-10-22 04:45:17

标签: xamarin.ios

搜索帐单“对不起,应用程序有问题”时出现错误

bellow是我的工具代码,如果代码中有任何问题,请纠正我。

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

            var userActivity = new NSUserActivity(nameof(INSearchForBillsIntent));
            var response = new INSearchForBillsIntentResponse(INSearchForBillsIntentResponseCode.Success, userActivity);

            // Initialize with found message's attributes
            var billPayee = new INBillPayee(new INSpeakableString("Pratik"), "1111111", new INSpeakableString("Kumar"));
            var currency = new INCurrencyAmount(new NSDecimalNumber("22"), "USD");
            var mincurrency = new INCurrencyAmount(new NSDecimalNumber("22"), "USD");
            var latefee = new INCurrencyAmount(new NSDecimalNumber("20"), "USD");
            var duedate = new NSDateComponents();
            duedate.Calendar = new NSCalendar(NSCalendarType.Buddhist);
            duedate.Day = 25;
            duedate.Month = 11;
            duedate.Year = 2018;
            var billdetail = new INBillDetails(INBillType.Electricity, INPaymentStatus.Unpaid, billPayee, currency, mincurrency, latefee, duedate, duedate);
            response.Bills = new INBillDetails[] { billdetail };
            completion(response);
        }


        public void ResolveBillPayee(INSearchForBillsIntent intent,Action<INBillPayeeResolutionResult> completion)
        {
            var text = intent.BillPayee;
            if (text != null)
                completion(INBillPayeeResolutionResult.GetSuccess (text));
            else
                completion (INBillPayeeResolutionResult.NeedsValue);
        }

我已经在info.plist文件中设置了所有密钥并启用sirikit。

谢谢

0 个答案:

没有答案