简体   繁体   中英

How to customize “MoneySent” intent UI screen for SendPayment intent using Sirikit in ios 10

I am using SendPayment intent for payment domain app. Basically, it shows two screens:- 1) Send Mooney 2) Money sent

Since the same intent view controller is shown for both the flows, can anybody share some tips how change the "Send Money" intent View by "Money Sent" view.

Also, in apple documentation, its written to use childViewController, but wondering on what basis it has to be used as in configure method, intenthandlingstatus is "undefined" always.

     func configure(with interaction: INInteraction!, context: INUIHostedViewContext, completion: ((CGSize) -> Void)!) {
// here interaction.intentHandlingStatus allways shows undefined

}

Please suggest. Thanks

I haven't found any variables that are set by Apple to be able to tell the difference between the confirm step and the send step.

However if you structure your data correctly, there is a way to indirectly get this working.

Apple requires you to setup a PaymentRecord and attach it to each IntentResponse in confirmSendPayment:completion and handleSendPayment:completion:

What I am doing is I set the payment status to Pending in the confirm step and then to Completed in the handle step. So I can use the following code in the UI extension to show the proper UI for what step I am on:

INSendPaymentIntent *sendPaymentIntent = (INSendPaymentIntent *)interaction.intent;
INSendPaymentIntentResponse *sendPaymentResponse = (INSendPaymentIntentResponse *)interaction.intentResponse;
if (sendPaymentResponse.paymentRecord.status == INPaymentStatusPending) {
    // Confirm step
    [self setupUI:sendPaymentIntent forView:self.previewView];
    self.previewView.hidden = false;
    self.completeView.hidden = true;
} else if (sendPaymentResponse.paymentRecord.status == INPaymentStatusCompleted) {
    // Action performed step
    [self setupUI:sendPaymentIntent forView:self.completeView];
    self.previewView.hidden = true;
    self.completeView.hidden = false;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM