-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support alert messages customization [ios] #38
Conversation
* only iOS. | ||
* customize the info and error messages shown on NFC reading card alert | ||
*/ | ||
setAlertMessage(key: iOSAlertMessageKeys, value: string): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you think about change this method as:
setAlertMessages(ReadonlyArray<{key: iOSAlertMessageKeys, value: string}>): void;
in order to define the configuration of all the possible alert messages one time and pass in a single function instead of using multiple functions?
Not releated to this pr, but in general I think could improve the usage and readability of the code define the configuration of the library and pass it in the start
method, without using multiple methods, eg:
type CieConfiguration = {
pin: string;
authUrl: string;
iosAlertMessage?: ReadonlyArray<key: iOSAlertMessageKeys, value: string>;
onEvent?: (event: Event) => void;
onSuccess?: (url: string) => void
onError?: (error: Error) => void
};
const cieConfig: CieConfiguration = {...};
cieManager.start(cieConfig);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm agree, your suggestions are an improvement.
So I made a commit to address both
- Now you can start the SDK by passing the alert messages configuration. It has effect only on iOS. I prefer a partial record instead of array, to avoid items duplication. i.e
cieManager.start({ readingInstructions: "my test" })
- I kept
setAlertMessage
so we can change an alert message also when the SDK is already started
This PR updates the iOS compiled framework that includes these changes
pagopa/io-cie-ios-sdk#8
In addition it adds all ReactNative stuffs to make the communication between JS and the native side
how to test
You can test it with app IO directly
react-native-cie
from
"@pagopa/react-native-cie": "^1.1.2",
to
"@pagopa/react-native-cie": "git://github.com/pagopa/io-cie-sdk.git#support-ios-alert-message-customization"
yarn cie-ios:prod
play