2016-08-16 3 views
1

지불 도메인 응용 프로그램에 대해 SendPayment 인 텐트를 사용하고 있습니다. 1) 같은 의도 뷰 컨트롤러는 두 흐름에 대해 표시되기 때문에 누구에 의해 "돈을 보내기"의도보기를 변경하는 방법을 몇 가지 팁을 공유 할 수 있습니다, 돈iOS에서 Sirikit을 사용하여 SendPayment 인 텐트를 "MoneySent"의도 UI 화면으로 사용자 지정하는 방법

를 전송) 무니 2 보내기 - : 기본적으로, 두 개의 화면을 보여줍니다 "Money Sent"보기.

apple 설명서에서는 childViewController를 사용하기 위해 작성되었지만 configure 메소드에서 사용되는 기준에 대해 궁금해 할 때 intenthandlingstatus는 항상 "정의되지 않음"입니다.

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

}

제안하십시오. 감사합니다.

+0

SendPaymentIntent도 효과가 있습니까? – cyril

+0

예. 이전에는 작동하지 않았습니다. 그것은 인터넷 검색에 가고 있었다. 나는 일할 길을 찾았습니다. 지불을해야합니다. 응답으로 기록하십시오. 그러면 작동 할 것입니다. –

+0

샘플 코드를 제공해 주시겠습니까? – cyril

답변

3

확인 단계와 보내기 단계의 차이를 알 수 있도록 Apple에서 설정 한 변수를 찾지 못했습니다.

그러나 데이터를 올바르게 구성하면 간접적으로이 작업을 수행 할 수 있습니다.

애플은 설치 PaymentRecord 당신을 필요로하며, 각 confirmSendPayment에 IntentResponse에 첨부 : 완료 및 handleSendPayment : 완료 :

가 완료에 내가 다음 확인 단계에서 보류로 지불 상태를 설정하고 내가 뭐하는 거지입니다

핸들 단계에서. 따라서 UI 확장에서 다음 단계를 수행하여 적절한 단계의 UI를 표시 할 수 있습니다.

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; 
} 
+0

매우 영리합니다. 고마워요! –