You can listen to various events in the IssueCard
using the onEvent
prop.
import { IssueCard } from '@card91/react-native-issue-card';
export function IssueCardPage() {
const onIssueCardEvent = (event) => {
switch (event) {
case "C91_ISSUE_CARD_SCREEN_INITIALISED":
// Do something to indicate that Parameter is missing
break;
case "C91_ISSUE_CARD_AUTHENTICATION_FAILURE":
// Do something to indicate that the API calls have Unauthorized
break;
case "C91_ISSUE_CARD_SERVER_FAILURE":
// Do something to indicate that the API calls have Server Error
break;
case "C91_ISSUE_CARD_SCREEN_SUCCESS":
// Do something to indicate that the API calls have succeeded
break;
case "C91_ISSUE_CARD_MISSING_PARAMETER":
// Do something to indicate that the API calls have succeeded
break;
case 'C91_ISSUE_CARD_API_FAILURE':
// Do something to indicate that the API calls have failed
break;
case "C91_ISSUE_CARD_EXTERNAL_AUTHENTICATION_FAILURE":
// Do something to indicate that the API calls have Unauthorized
break;
case "C91_ISSUE_CARD_EXTERNAL_SERVER_FAILURE":
// Do something to indicate that the API calls have Server Error
break;
case "C91_ISSUE_CARD_TOKEN_API_SUCCESS":
// Do something to indicate that the API calls have succeeded
break;
case 'C91_ISSUE_CARD_TOKEN_API_FAILURE':
// Do something to indicate that the API calls have failed
break;
case 'C91_ISSUE_CARD_EXTERNAL_MISSING_PARAMETER':
// Do something to indicate that the API calls have failed
break;
}
};
return (
<View>
<IssueCard ... onEvent={onIssueCardEvent} />
</View>
);
}
The events are as follows:
Event Name | Description |
---|---|
C91_ISSUE_CARD_SCREEN_INITIALISED | The issue card screen has been initialised. |
C91_ISSUE_CARD_SCREEN_SUCCESS | The API request related to the issue card screen was successful. |
C91_ISSUE_CARD_API_FAILURE | The API request related to the issue card screen has failed. |
C91_ISSUE_CARD_AUTHENTICATION_FAILURE | Authentication for the issue card screen has failed. |
C91_ISSUE_CARD_SERVER_FAILURE | The server encountered an error while processing the issue card request. |
C91_ISSUE_CARD_MISSING_PARAMETER | A required parameter is missing in the issue card request. |
C91_ISSUE_CARD_TOKEN_API_SUCCESS | The API request for retrieving a token related to the issue card was successful. |
C91_ISSUE_CARD_TOKEN_API_FAILURE | The API request for retrieving a token related to the issue card has failed. |
C91_ISSUE_CARD_EXTERNAL_SERVER_FAILURE | An external server encountered an error while processing the issue card request. |
C91_ISSUE_CARD_EXTERNAL_MISSING_PARAMETER | A required parameter is missing in the external issue card request. |
C91_ISSUE_CARD_EXTERNAL_AUTHENTICATION_FAILURE | Authentication for the external issue card request has failed. |