@azify/aziface-mobile
v3.1.0
Published
A Aziface adapter to react native. π±
Readme
@azify/aziface-mobile π±
[!WARNING] This package supports only new architecture.
Aziface SDK adapter to react native. π±
- Installation
- Usage
- API
- Types
- Components
- Vocal Guidance
- How to add images in Aziface SDK module?
- Enabling Camera (iOS only)
- Contributing
- License
Installation
npm install @azify/aziface-mobile
# or
yarn add @azify/aziface-mobileOnly iOS:
cd ios && pod install && cd ..Usage
import { useState } from 'react';
import { Text, TouchableOpacity, Platform, ScrollView } from 'react-native';
import {
initialize,
enroll,
authenticate,
liveness,
photoMatch,
photoScan,
FaceView,
type Params,
type Headers,
type Processor,
} from '@azify/aziface-mobile';
export default function App() {
const [isInitialized, setIsInitialized] = useState(false);
const opacity = isInitialized ? 1 : 0.5;
const onInitialize = async () => {
/*
* The SDK must be initialized first
* so that the rest of the library
* functions can work!
* */
const headers: Headers = {
'x-token-bearer': 'YOUR_X_TOKEN_BEARER',
'x-api-key': 'YOUR_X_API_KEY',
'clientInfo': 'YUOR_CLIENT_INFO',
'contentType': 'YOUR_CONTENT_TYPE',
'device': 'YOUR_DEVICE',
'deviceid': 'YOUR_DEVICE_ID',
'deviceip': 'YOUR_DEVICE_IP',
'locale': 'YOUR_LOCALE',
'xForwardedFor': 'YOUR_X_FORWARDED_FOR',
'user-agent': 'YOUR_USER_AGENT',
'x-only-raw-analysis': '1',
};
const params: Params = {
isDevelopment: true,
deviceKeyIdentifier: 'YOUR_DEVICE_KEY_IDENTIFIER',
baseUrl: 'YOUR_BASE_URL',
};
try {
const initialized = await initialize({
params,
headers,
});
setIsInitialized(initialized);
console.log(initialized);
} catch (error: any) {
setIsInitialized(false);
console.error(error);
}
};
const onFaceScan = async (type: string, data?: any) => {
try {
let processor: Processor | null = null;
switch (type) {
case 'enroll':
processor = await enroll(data);
break;
case 'liveness':
processor = await liveness(data);
break;
case 'authenticate':
processor = await authenticate(data);
break;
case 'photoMatch':
processor = await photoMatch(data);
break;
case 'photoScan':
processor = await photoScan(data);
break;
default:
processor = false;
break;
}
console.log(type, processor);
} catch (error: any) {
console.error(type, error.message);
}
};
return (
<ScrollView
style={styles.scroll}
contentContainerStyle={styles.scrollContent}
showsVerticalScrollIndicator={false}
>
<FaceView
style={styles.content}
onInitialize={(event) => console.log('onInitialize', event)}
onOpen={(event) => console.log('onOpen', event)}
onClose={(event) => console.log('onClose', event)}
onCancel={(event) => console.log('onCancel', event)}
onError={(event) => console.log('onError', event)}
onVocal={(event) => console.log('onVocal', event)}
>
<TouchableOpacity
style={styles.button}
activeOpacity={0.8}
onPress={onInitialize}
>
<Text style={styles.buttonText}>Initialize SDK</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { opacity }]}
activeOpacity={0.8}
onPress={() => onFaceScan('enroll')}
disabled={!isInitialized}
>
<Text style={styles.buttonText}>Enrollment</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { opacity }]}
activeOpacity={0.8}
onPress={() => onFaceScan('liveness')}
disabled={!isInitialized}
>
<Text style={styles.buttonText}>Liveness</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { opacity }]}
activeOpacity={0.8}
onPress={() => onFaceScan('authenticate')}
disabled={!isInitialized}
>
<Text style={styles.buttonText}>Authenticate</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { opacity }]}
activeOpacity={0.8}
onPress={() => onFaceScan('photoMatch')}
disabled={!isInitialized}
>
<Text style={styles.buttonText}>Photo Match</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { opacity }]}
activeOpacity={0.8}
onPress={() => onFaceScan('photoScan')}
disabled={!isInitialized}
>
<Text style={styles.buttonText}>Photo Scan</Text>
</TouchableOpacity>
</FaceView>
</ScrollView>
);
}
const styles = StyleSheet.create({
scroll: {
flex: 1,
paddingTop: Platform.OS === 'ios' ? 40 : 0,
backgroundColor: 'white',
},
scrollContent: {
flexGrow: 1,
},
content: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
gap: 40,
backgroundColor: 'white',
},
button: {
width: '100%',
justifyContent: 'center',
alignItems: 'center',
padding: 20,
borderRadius: 16,
backgroundColor: '#4a68b3',
},
buttonText: {
fontSize,
fontWeight: 'bold',
color: 'white',
},
});API
| Methods | Return Type | Platform |
| -------------- | -------------------- | -------- |
| initialize | Promise<boolean> | All |
| enroll | Promise<Processor> | All |
| authenticate | Promise<Processor> | All |
| liveness | Promise<Processor> | All |
| photoMatch | Promise<Processor> | All |
| photoScan | Promise<Processor> | All |
| vocal | void | All |
| setTheme | void | All |
initialize
This is the principal method to be called, he must be called first to initialize the Aziface SDK. If he doens't be called the other methods don't works!
| Initialize | type | Required | Default |
| ------------ | --------------------- | -------- | ----------- |
| params | Params | β
| - |
| headers | Headers | β | undefined |
enroll
This method makes a 3D reading of the user's face. But, you must use to subscribe user in Aziface SDK or in your server.
| Property | type | Required | Default |
| -------- | ----- | -------- | ----------- |
| data | any | β | undefined |
authenticate
This method makes a 3D reading of the user's face, it's an equal enroll method, but it must be used to authenticate your user. An important detail about it is, you must subscribe to your user first, after authenticating it with this method.
| Property | type | Required | Default |
| -------- | ----- | -------- | ----------- |
| data | any | β | undefined |
liveness
This method makes a 3D reading of the user's face, ensuring the liveness check of the user.
| Property | type | Required | Default |
| -------- | ----- | -------- | ----------- |
| data | any | β | undefined |
photoMatch
This method make to read from face and documents for user, after compare face and face documents from user to check veracity.
| Property | type | Required | Default |
| -------- | ----- | -------- | ----------- |
| data | any | β | undefined |
photoScan
This method makes to read from documents for user, checking in your server the veracity it.
| Property | type | Required | Default |
| -------- | ----- | -------- | ----------- |
| data | any | β | undefined |
vocal
This method must be used to activate the vocal guidance of the Aziface SDK.
setTheme
This method must be used to set the theme of the Aziface SDK screen.
Note: Currently, it's recommended testing the theme with a physical device. The SDK does not behave correctly with customizable themes in emulators.
| Property | type | Required | Default |
| --------- | ----------------- | -------- | ----------- |
| options | Theme | β | undefined |
Enums
| Enums | Platform |
| ------------------- | -------- |
| Errors | All |
Types
| Types | Platform |
| ------------------------------------------------------------------- | -------- |
| Params | All |
| Headers | All |
| Processor | All |
| ProcessorData | All |
| ProcessorError | All |
| ProcessorAdditionalSessionData | All |
| ProcessorResult | All |
| ProcessorHttpCallInfo | All |
| ProcessorRequestMethod | All |
| ProcessorIDScanResultsSoFar | All |
| Theme | All |
| ButtonLocation | All |
| ThemeImage | All |
| ThemeFrame | All |
| ThemeButton | All |
| ThemeGuidance | All |
| ThemeGuidanceRetryScreen | All |
| ThemeOval | All |
| ThemeFeedback | All |
| FeedbackBackgroundColor | iOS |
| Point | iOS |
| ThemeResultScreen | All |
| ThemeResultAnimation | All |
| ThemeIdScan | All |
| ThemeIdScanSelectionScreen | All |
| ThemeIdScanReviewScreen | All |
| ThemeIdScanCaptureScreen | All |
Params
Here must be passed to initialize the Aziface SDK! Case the parameters isn't provided the Aziface SDK goes to be not initialized.
| Params | type | Required | Default |
| --------------------- | --------- | -------- | ------- |
| deviceKeyIdentifier | string | β
| - |
| baseUrl | string | β
| - |
| isDevelopment | boolean | β | false |
Headers
Here you can add your headers to send request when some method is called. Only values from type string, null or undefined are accepts!
| Headers | type | Required | Default |
| --------------- | --------------------------------- | -------- | ----------- |
| [key: string] | string or null or undefined | β | undefined |
Processor
A processor always return this properties.
| Processor | type | Description |
| ----------- | ------------------------------------------------------------ | ------------------------------------------- |
| isSuccess | boolean | Indicates if the processing was successful. |
| data | ProcessorData or null or undefined | The processor data response. |
| error | ProcessorError or null or undefined | The processor error response. |
ProcessorData
This is data response processor. Each processor can give different responses.
| ProcessorData | type | Description |
| ----------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------- |
| idScanSessionId | string or null or undefined | The unique identifier for the ID scan session. |
| externalDatabaseRefID | string or null or undefined | The unique identifier for the face session. |
| additionalSessionData | ProcessorAdditionalSessionData | The additional session data. |
| result | ProcessorResult or null or undefined | The result of the processing. |
| responseBlob | string | The raw response blob from the server. |
| httpCallInfo | ProcessorHttpCallInfo or null or undefined | The HTTP call information. |
| didError | boolean | Indicates if an error occurred during processing. |
| serverInfo | unknown or null or undefined | The server information. |
| idScanResultsSoFar | ProcessorIDScanResultsSoFar or or null or undefined | The ID scan results so far. |
ProcessorError
This is error response processor.
| ProcessorError | type | Description |
| ---------------- | ------------------- | ------------------ |
| code | Errors | The error code. |
| message | string | The error message. |
ProcessorAdditionalSessionData
The additional session data are extra information about device and processor.
| ProcessorAdditionalSessionData | type | Description |
| -------------------------------- | -------- | --------------------------- |
| platform | string | The platform of the device. |
| appID | string | The application ID. |
| installationID | string | The installation ID. |
| deviceModel | string | The device model. |
| deviceSDKVersion | string | The device SDK version. |
| userAgent | string | The user agent. |
| sessionID | string | The session ID. |
ProcessorResult
The result object of the face or scan analyze.
| ProcessorResult | type | Description |
| ------------------- | ----------------------- | --------------------------------------- |
| livenessProven | boolean | Indicates if it's liveness proven. |
| auditTrailImage | string | The audit trail image in base64 format. |
| ageV2GroupEnumInt | number | The age group enumeration integer. |
| matchLevel | number or undefined | The match level. |
ProcessorHttpCallInfo
The HTTP information of the processor request.
| ProcessorHttpCallInfo | type | Description |
| ----------------------- | --------------------------------------------------- | -------------------------------- |
| tid | string | The transaction ID. |
| path | string | The request path. |
| date | string | The date of the request. |
| epochSecond | number | The epoch second of the request. |
| requestMethod | ProcessorRequestMethod | The request method. |
ProcessorRequestMethod
The request method of the processor.
| ProcessorRequestMethod | Description |
| ------------------------ | ------------- |
| GET | GET request. |
| POST | POST request. |
ProcessorIDScanResultsSoFar
The processor scan result. It's shown when you use photoScan or photoMatch.
| ProcessorIDScanResultsSoFar | Type | Description |
| --------------------------------------------- | --------- | ------------------------------------------------------------- |
| photoIDNextStepEnumInt | number | The photo ID next step enumeration integer. |
| fullIDStatusEnumInt | number | The full ID status enumeration integer. |
| faceOnDocumentStatusEnumInt | number | The face on document status enumeration integer. |
| textOnDocumentStatusEnumInt | number | The text on document status enumeration integer. |
| expectedMediaStatusEnumInt | number | The expected media status enumeration integer. |
| unexpectedMediaEncounteredAtLeastOnce | boolean | Indicates if unexpected media was encountered at least once. |
| documentData | string | The document data in stringified JSON format. |
| nfcStatusEnumInt | number | The NFC status enumeration integer. |
| nfcAuthenticationStatusEnumInt | number | The NFC authentication status enumeration integer. |
| barcodeStatusEnumInt | number | The barcode status enumeration integer. |
| mrzStatusEnumInt | number | The MRZ status enumeration integer. |
| idFoundWithoutQualityIssueDetected | boolean | Indicates if the ID was found without quality issues. |
| idFacePhotoFoundWithoutQualityIssueDetected | boolean | Indicates if the face photo was found without quality issues. |
| idScanAgeV2GroupEnumInt | number | The ID scan age group enumeration integer. |
| didMatchIDScanToOCRTemplate | boolean | Indicates if the ID scan matched the OCR template. |
| isUniversalIDMode | boolean | Indicates if the universal ID mode is enabled. |
| matchLevel | number | The match level. |
| matchLevelNFCToFaceMap | number | The match level NFC to face map. |
| faceMapAgeV2GroupEnumInt | number | The face map age group enumeration integer. |
| watermarkAndHologramStatusEnumInt | number | The watermark and hologram status enumeration integer. |
Theme
This is a list of theme properties that can be used to styling. Note, we recommend that you use only hexadecimal values to colors on format #RGB, #RGBA, #RRGGBB, or #RRGGBBAA because still we don't supported others color type.
| Theme | type | Platform | Required | Default |
| ------------------------ | ----------------------------------------- | -------- | -------- | ----------- |
| overlayBackgroundColor | string | All | β | #ffffff |
| cancelButtonLocation | ButtonLocation | All | β | TOP_RIGHT |
| image | ThemeImage | All | β | undefined |
| frame | ThemeFrame | All | β | undefined |
| guidance | ThemeGuidance | All | β | undefined |
| oval | ThemeOval | All | β | undefined |
| feedback | ThemeFeedback | All | β | undefined |
| resultScreen | ThemeResultScreen | All | β | undefined |
| idScan | ThemeIdScan | All | β | undefined |
ButtonLocation
This type must be used to position of the cancel button on screen.
| ButtonLocation | Description |
| ---------------- | --------------------------------------------------------------- |
| DISABLED | Disable cancel button and doesn't show it. |
| TOP_LEFT | Position cancel button in top right. |
| TOP_RIGHT | Position cancel button in top right. It's default position. |
ThemeImage
An object containing the image assets used in the Aziface SDK.
| ThemeImage | type | Platform | Required | Default |
| ------------ | -------- | -------- | -------- | --------------------------- |
| logo | string | All | β | facetec_your_app_logo.png |
| cancel | string | All | β | facetec_cancel.png |
ThemeFrame
An object containing the frame styles used in the Aziface SDK.
| ThemeFrame | type | Platform | Required | Default |
| ----------------- | -------- | -------- | -------- | --------- |
| cornerRadius | number | All | β | 20 |
| borderColor | string | All | β | #ffffff |
| backgroundColor | string | All | β | #ffffff |
ThemeButton
An object containing the button styles used in the Aziface SDK.
| ThemeButton | type | Platform | Required | Default |
| -------------------------- | -------- | -------- | -------- | --------- |
| backgroundNormalColor | string | All | β | #026ff4 |
| backgroundDisabledColor | string | All | β | #b3d4fc |
| backgroundHighlightColor | string | All | β | #0264dc |
| textNormalColor | string | All | β | #ffffff |
| textDisabledColor | string | All | β | #ffffff |
| textHighlightColor | string | All | β | #ffffff |
ThemeGuidance
An object containing the styles used in the guidance view.
| ThemeGuidance | type | Platform | Required | Default |
| ----------------- | ------------------------------------------------------- | -------- | -------- | ------------------------------------------------------ |
| backgroundColor | string or string[] | All | β | #ffffff (Android) and ['#ffffff', '#ffffff'] (iOS) |
| foregroundColor | string | All | β | #272937 |
| button | ThemeButton | All | β | undefined |
| retryScreen | ThemeGuidanceRetryScreen | All | β | undefined |
ThemeGuidanceRetryScreen
An object containing the styles used in the guidance retry screen.
| ThemeGuidanceRetryScreen | type | Platform | Required | Default |
| -------------------------- | -------- | -------- | -------- | --------- |
| imageBorderColor | string | All | β | #ffffff |
| ovalStrokeColor | string | All | β | #ffffff |
ThemeOval
An object containing the oval styles used in the Aziface SDK.
| ThemeOval | type | Platform | Required | Default |
| --------------------- | -------- | -------- | -------- | --------- |
| strokeColor | string | All | β | #026ff4 |
| firstProgressColor | string | All | β | #0264dc |
| secondProgressColor | string | All | β | #0264dc |
ThemeFeedback
An object containing the oval styles used in the Aziface SDK.
| ThemeFeedback | type | Platform | Required | Default |
| ------------------------------------------------------- | -------- | -------- | -------- | ----------- |
| backgroundColor | string | Android | β | #026ff4 |
| backgroundColors | string | iOS | β | undefined |
| textColor | string | All | β | #ffffff |
FeedbackBackgroundColor (iOS only)
This type must be used to set the theme of the feedback box.
| FeedbackBackgroundColor | Description | type | Required | Default |
| ------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------- | -------- | ------------------------ |
| colors | An array of colors defining the color of each gradient stop. | string[] | β | ["#026FF4", "#026FF4"] |
| locations | It's accepts only two values between 0 and 1 that defining the location of each gradient stop. | [number, number] | β | [0, 1] |
| startPoint | The start point of the gradient when drawn in the layerβs coordinate space. | Point | β | { x: 0, y: 0 } |
| endPoint | The end point of the gradient when drawn in the layerβs coordinate space. | Point | β | { x: 1, y: 0 } |
Point (iOS only)
This interface defines the drawn in the layer's coordinate space.
| Point | type | Required | Default |
| ------- | -------- | -------- | ------- |
| x | number | β | 0 |
| y | number | β | 0 |
ThemeResultScreen
An object containing the styles used in the result screen.
| ThemeResultScreen | type | Platform | Required | Default |
| ------------------------- | ----------------------------------------------- | -------- | -------- | ------------------------------------------------------ |
| backgroundColor | string or string[] | All | β | #ffffff (Android) and ['#ffffff', '#ffffff'] (iOS) |
| foregroundColor | string | All | β | #272937 |
| activityIndicatorColor | string | All | β | #026ff4 |
| uploadProgressFillColor | string | All | β | #026ff4 |
| resultAnimation | ThemeResultAnimation | All | β | undefined |
ThemeResultAnimation
An object containing the animation styles used in the Aziface SDK result animation.
| ThemeResultAnimation | type | Platform | Required | Default |
| ---------------------- | -------- | -------- | -------- | --------- |
| backgroundColor | string | All | β | #026ff4 |
| foregroundColor | string | All | β | #ffffff |
ThemeIdScan
An object containing the styles used in the ID scan screens.
| ThemeIdScan | type | Platform | Required | Default |
| ----------------- | ----------------------------------------------------------- | -------- | -------- | ----------- |
| selectionScreen | ThemeIdScanSelectionScreen | All | β | undefined |
| reviewScreen | ThemeIdScanReviewScreen | All | β | undefined |
| captureScreen | ThemeIdScanCaptureScreen | All | β | undefined |
| button | ThemeButton | All | β | undefined |
ThemeIdScanSelectionScreen
An object containing the styles used in the ID scan selection screen.
| ThemeIdScanSelectionScreen | type | Platform | Required | Default |
| ---------------------------- | ---------------------- | -------- | -------- | ------------------------------------------------------ |
| backgroundColor | string or string[] | All | β | #ffffff (Android) and ['#ffffff', '#ffffff'] (iOS) |
| foregroundColor | string | All | β | #272937 |
ThemeIdScanReviewScreen
An object containing the styles used in the ID scan review screen.
| ThemeIdScanReviewScreen | type | Platform | Required | Default |
| ------------------------- | -------- | -------- | -------- | --------- |
| foregroundColor | string | All | β | #ffffff |
| textBackgroundColor | string | All | β | #026ff4 |
ThemeIdScanCaptureScreen
An object containing the styles used in the ID scan capture screen.
| ThemeIdScanCaptureScreen | type | Platform | Required | Default |
| -------------------------- | -------- | -------- | -------- | --------- |
| foregroundColor | string | All | β | #ffffff |
| textBackgroundColor | string | All | β | #ffffff |
| backgroundColor | string | All | β | #026ff4 |
| frameStrokeColor | string | All | β | #ffffff |
Errors
| Errors | Description | Platform |
| ------------------------- | ----------------------------------------------------------------------------------- | -------- |
| NotInitialized | When trying to initialize a process, but SDK wasn't initialized. | All |
| ConfigNotProvided | When deviceKeyIdentifier and baseUrl aren't provided. | All |
| ParamsNotProvided | When parameters aren't provided, this case, it is null. | All |
| NotAuthenticated | When authenticate process is called, but enroll wasn't done first. | All |
| NotFoundTargetView | When Activity (Android) or ViewController (iOS) aren't found on call processor. | All |
| CameraError | When an error on use the camera occurs. | All |
| CameraPermissionsDenied | When the user doesn't permit the use camera. | All |
| UserCancelledIdScan | When process was cancelled on ID scan. | All |
| UserCancelledFaceScan | When process was cancelled on face scan. | All |
| RequestAborted | When process has request aborted. Some error in JSON or network. | All |
| LockedOut | When process is locked out. | All |
| UnknownInternalError | When process has unknown internal error. | All |
Components
FaceView
The FaceView extends all properties of the View, but it has five new callbacks to listener Aziface SDK events.
Properties
| Property | Description | Returns | Platform |
| -------------- | ----------------------------------------------------------------- | --------- | -------- |
| onOpen | Callback function called when the Aziface SDK is opened. | boolean | All |
| onClose | Callback function called when the Aziface SDK is closed. | boolean | All |
| onCancel | Callback function called when the Aziface SDK is cancelled. | boolean | All |
| onError | Callback function called when an error occurs in the Aziface SDK. | boolean | All |
| onVocal | Callback function called when the vocal guidance is activated. | boolean | All |
| onInitialize | Callback function called when the Aziface SDK is initialized. | boolean | All |
Vocal Guidance
The Aziface SDK provides the vocal method for you on vocal guidance. We recommend using it the SDK is initialized. The vocal method will always return false when the device is muted.
Note: We recommend to use the FaceView component for control vocal guidance state with efficiently.
import { useState } from 'react';
import { Button } from 'react-native';
// ...
import { initialize, vocal, type Params } from '@azify/aziface-mobile';
export default function App() {
const [isInitialized, setIsInitialized] = useState(false);
// State to manager when vocal is enabled
const [isVocalEnabled, setIsVocalEnabled] = useState(false);
function onInitialize() {
const params: Params = {
isDevelopment: true,
deviceKeyIdentifier: 'YOUR_DEVICE_KEY_IDENTIFIER',
baseUrl: 'YOUR_BASE_URL',
};
try {
const initialized = await initialize({ params });
setIsInitialized(initialized);
} catch {
setIsInitialized(false);
} finally {
setIsVocalEnabled(false);
}
}
// Call onVocal function when SDK is initialized!
function onVocal(enabled: boolean) {
setIsVocalEnabled(enabled);
}
return (
<FaceView onVocal={onVocal}>
{/* ... */}
<Button
title={isVocalEnabled ? 'Vocal ON' : 'Vocal OFF'}
onPress={vocal}
/>
</FaceView>
);
}How to add images in Aziface SDK module?
The logo and cancel properties represents your logo and icon of the button cancel. Does not possible to remove them from the module. Default are Azify images and .png format. By default in Android the logo image is shown, but on iOS it isn't shown, It's necessary to add manually.
How to add images in Android?
To add your images in Android, you must go to your project's android/src/main/res/drawable directory. If in your project drawable folder doesn't exist, it create one. Inside the drawable folder, you must put your images and done!
Important: The filename of the image can't have uppercase letters, Android doesn't accept these characters in the image name.
How to add images in iOS?
In iOS, open your XCode and go to your project's ios/<YOUR_PROJECT_NAME>/Images.xcassets directory. Open the Images.xcassets folder and only put your images inside there.
Example with images added
Now, go back to where you want to apply the styles, import setTheme method and add only the image name, no extension format, in image property (logo or cancel). Note: If the image is not founded the default image will be showed. Check the code example below:
import { useEffect } from 'react';
// ...
import {
initialize,
setTheme,
type Params /* ... */,
} from '@azify/aziface-mobile';
export default function App() {
useEffect(() => {
const params: Params = {
isDevelopment: true,
deviceKeyIdentifier: 'YOUR_DEVICE_KEY_IDENTIFIER',
baseUrl: 'YOUR_BASE_URL',
};
async function initialize() {
// You call setTheme after initialize.
setTheme({
image: {
logo: 'brand_logo', // brand_logo.png
cancel: 'close', // close.png
},
});
await initialize({ params });
}
initialize();
}, []);
// ...
}Enabling Camera (iOS only)
If you want to enable the camera, you need to add the following instructions in your Info.plist file:
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) need access to your camera to take picture.</string>That's will be necessary to what iOS works correctly!
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT License. π
Made with create-react-native-library. π
