You can listen to various events in the PrintCard
using the onEvent
prop.
import { PrintCard } from '@card91/react-native-issue-card';
export function PrintCardPage() {
const onEvent = (event) => {
switch (event) {
case "C91_PRINT_CARD_SCREEN_INITIALISED":
// Do something to indicate that Parameter is missing
break;
case "C91_PRINT_CARD_AUTHENTICATION_FAILURE":
// Do something to indicate that the API calls have Unauthorized
break;
case "C91_PRINT_CARD_SERVER_FAILURE":
// Do something to indicate that the API calls have Server Error
break;
case "C91_PRINT_CARD_API_SUCCESS":
// Do something to indicate that the API calls have succeeded
break;
case "C91_PRINT_CARD_MISSING_PARAMETER":
// Do something to indicate that the API calls have succeeded
break;
case 'C91_PRINT_CARD_API_FAILURE':
// Do something to indicate that the API calls have failed
break;
case "C91_PRINT_CARD_EXTERNAL_AUTHENTICATION_FAILURE":
// Do something to indicate that the API calls have Unauthorized
break;
case "C91_PRINT_CARD_EXTERNAL_SERVER_FAILURE":
// Do something to indicate that the API calls have Server Error
break;
case "C91_PRINT_CARD_TOKEN_API_SUCCESS":
// Do something to indicate that the API calls have succeeded
break;
case 'C91_PRINT_CARD_TOKEN_API_FAILURE':
// Do something to indicate that the API calls have failed
break;
case 'C91_PRINT_CARD_EXTERNAL_MISSING_PARAMETER':
// Do something to indicate that the API calls have failed
break;
case 'C91_FETCH_ADDRESS_API_FAILURE':
// Do something to indicate that the API calls have failed
break;
}
};
return (
<View>
<PrintCard ... onEvent={onEvent} />
</View>
);
}
The events are as follows:
Event Name | Description |
---|---|
C91_PRINT_CARD_SCREEN_INITIALISED | The Print card screen has been initialised. |
C91_PRINT_CARD_API_SUCCESS | The API request related to the print card screen was successful. |
C91_PRINT_CARD_API_FAILURE | The API request related to the print card screen has failed. |
C91_PRINT_CARD_AUTHENTICATION_FAILURE | Authentication for the print card screen has failed. |
C91_PRINT_CARD_SERVER_FAILURE | The server encountered an error while processing the print card request. |
C91_PRINT_CARD_MISSING_PARAMETER | A required parameter is missing in the print card request. |
C91_PRINT_CARD_TOKEN_API_SUCCESS | The API request for retrieving a token related to the print card was successful. |
C91_PRINT_CARD_TOKEN_API_FAILURE | The API request for retrieving a token related to the print card has failed. |
C91_PRINT_CARD_EXTERNAL_SERVER_FAILURE | An external server encountered an error while processing the print card request. |
C91_PRINT_CARD_EXTERNAL_MISSING_PARAMETER | A required parameter is missing in the external print card request. |
C91_PRINT_CARD_EXTERNAL_AUTHENTICATION_FAILURE | Authentication for the external print card request has failed. |
C91_FETCH_ADDRESS_API_FAILURE | The API request related to the fetch address has failed. |