Skip to content
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

React Native Products Integration #2

Merged
merged 30 commits into from
Oct 24, 2023
Merged

React Native Products Integration #2

merged 30 commits into from
Oct 24, 2023

Conversation

JNdhlovu
Copy link
Contributor

@JNdhlovu JNdhlovu commented Sep 4, 2023

Story: https://app.shortcut.com/smileid/story/8965/build-react-native-wrapper-android-v10

Summary

The PR now has the below products tested as well as in the sample app

  1. SmartSelfie Enrollment
  2. SmartSelfie Authentication
  3. Biometric KYC
  4. Document Verification
  5. BVN Consent
  6. Enhanced KYC

Test Instructions

yarn example android
This will show the main screen and you can run the products as per the options

Known Issues

Enhance the sample app ui for other things like enhanced KYC and docv country selection etc will come in a follow up PR

@vanshg
I will have a follow up PR for dependancy versions etc

@JNdhlovu JNdhlovu marked this pull request as draft September 4, 2023 15:45
android/build.gradle Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
@JNdhlovu JNdhlovu changed the title feat: compose view skeleton React Native Products Integration Oct 3, 2023
@JNdhlovu JNdhlovu marked this pull request as ready for review October 3, 2023 12:42
android/build.gradle Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
android/gradle.properties Outdated Show resolved Hide resolved
android/src/oldarch/SmileIdSpec.kt Show resolved Hide resolved
example/android/app/build.gradle Outdated Show resolved Hide resolved
@vanshg
Copy link
Contributor

vanshg commented Oct 4, 2023

Can you also update the package name? react-native-smile-id -> @smileid/react-native

@JNdhlovu JNdhlovu force-pushed the feature/reactcompose branch from 657a0d9 to 653db4f Compare October 10, 2023 12:43
if (hasKey("partnerParams")) {
val partnerParams = getMap("partnerParams")
return PartnerParams(
jobType = if (partnerParams!!.hasKey("jobType")) JobType.fromValue(partnerParams.getInt("jobType")) else null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

Comment on lines 101 to 106
val allowAgentMode =
if (product.hasKey("allowAgentMode")) product.getBoolean("allowAgentMode") else false
val showInstructions =
if (product.hasKey("showInstructions")) product.getBoolean("showInstructions") else true
val isProduction =
if (product.hasKey("isProduction")) product.getBoolean("isProduction") else false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, can do something like val allowAgentMode = product.getBoolean("allowAgentMode") ?: false

src/index.tsx Outdated Show resolved Hide resolved
android/build.gradle Outdated Show resolved Hide resolved
Comment on lines 37 to 40
val partnerParams = product.partnerParams()
partnerParams ?: run {
IllegalArgumentException("partnerParams is required for enhanced kyc")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val partnerParams = product.partnerParams()
partnerParams ?: run {
IllegalArgumentException("partnerParams is required for enhanced kyc")
}
val partnerParams = product.partnerParams() ?: run {
throw IllegalArgumentException("partnerParams is required for enhanced kyc")
}

same for the below occurences

country ?: run {
IllegalArgumentException("country is required for enhanced kyc")
}
val idType = if (product.hasKey("idType")) product.getString("idType") else null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my slack message

android/build.gradle Show resolved Hide resolved

override fun renderContent() {
product?.let {product->
val partnerName = if (product.hasKey("partnerName")) product.getString("partnerName") else null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here/for this file

@@ -6,9 +6,9 @@ import type {
BvnConsentRequest,
DocumentVerificationRequest,
SmartSelfieRequest,
} from 'react-native-smile-id';
} from '@smileid/react-native';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@JNdhlovu JNdhlovu requested review from vanshg and jumaallan October 17, 2023 14:38
@JNdhlovu JNdhlovu merged commit 7425f22 into main Oct 24, 2023
6 checks passed
@vanshg vanshg deleted the feature/reactcompose branch October 31, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants