From 02d0cca684c165ccf955d63514b755ae272a7409 Mon Sep 17 00:00:00 2001 From: Braxton Ward Date: Wed, 3 Dec 2025 16:22:04 -0700 Subject: [PATCH 1/2] feat: add new deeplink parameter for apps --- android/build.gradle | 2 +- example/screens/TransactScreen.tsx | 126 +++++++++++++++++------------ src/constants.tsx | 19 +++++ src/index.tsx | 16 +++- 4 files changed, 106 insertions(+), 57 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 70c4d04..7bcf369 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -38,7 +38,7 @@ def getExtOrIntegerDefault(name) { } // Update this value to the latest Android SDK version published on Maven -def transact_version = "3.13.0" +def transact_version = "3.15.1" android { namespace "com.atomicfi.transactreactnative" diff --git a/example/screens/TransactScreen.tsx b/example/screens/TransactScreen.tsx index c9024fc..9f79fae 100644 --- a/example/screens/TransactScreen.tsx +++ b/example/screens/TransactScreen.tsx @@ -18,8 +18,12 @@ import { Scope, Environment, PresentationStyles, + Step, +} from '@atomicfi/transact-react-native'; +import type { + PresentationStyleIOS, + StepType, } from '@atomicfi/transact-react-native'; -import type { PresentationStyleIOS } from '@atomicfi/transact-react-native'; type Props = NativeStackScreenProps; @@ -39,7 +43,9 @@ const TransactScreen: React.FC = () => { const [useDeeplink, setUseDeeplink] = useState(false); const [deeplinkCompanyId, setDeeplinkCompanyId] = useState(''); const [singleSwitch, setSingleSwitch] = useState(false); - const [paymentsInput, setPaymentsInput] = useState(''); + const [deeplinkStep, setDeeplinkStep] = useState( + Step.LOGIN_COMPANY + ); const products = [ { key: Product.DEPOSIT, label: 'Deposit' }, @@ -99,11 +105,12 @@ const TransactScreen: React.FC = () => { return; } - if (useDeeplink && !deeplinkCompanyId.trim() && !paymentsInput.trim()) { - Alert.alert( - 'Error', - 'Please enter a Company ID or Payments when using deeplink' - ); + // Company ID is only required for steps that target a specific company (not search) + const requiresCompanyId = + deeplinkStep !== Step.SEARCH_COMPANY && + deeplinkStep !== Step.SEARCH_PAYROLL; + if (useDeeplink && requiresCompanyId && !deeplinkCompanyId.trim()) { + Alert.alert('Error', 'Please enter a Company ID when using deeplink'); return; } @@ -121,25 +128,13 @@ const TransactScreen: React.FC = () => { // Add deeplink configuration if enabled if (useDeeplink) { - if (paymentsInput.trim()) { - // If payments input is provided, use pay-now step - const paymentsArray = paymentsInput - .split(',') - .map((p) => p.trim()) - .filter((p) => p.length > 0); - - config.deeplink = { - step: 'pay-now', - payments: paymentsArray, - }; - } else if (deeplinkCompanyId.trim()) { - // Otherwise use login-company step if company ID is provided - config.deeplink = { - step: 'login-company', + config.deeplink = { + step: deeplinkStep, + ...(deeplinkCompanyId.trim() && { companyId: deeplinkCompanyId.trim(), - singleSwitch: singleSwitch, - }; - } + }), + singleSwitch: singleSwitch, + }; } Atomic.transact({ @@ -317,6 +312,48 @@ const TransactScreen: React.FC = () => { {useDeeplink && ( <> + + Step + + setDeeplinkStep(Step.LOGIN_COMPANY)} + > + + Login Company + + + setDeeplinkStep(Step.SEARCH_COMPANY)} + > + + Search Company + + + + + Company ID = () => { {selectedProduct === Product.SWITCH && ( - <> - - Single Switch - - Off - - On - - - - Payments (pay-now step) - + Single Switch + + Off + - - Comma-separated values. If provided, uses pay-now step - instead of login-company. - + On - + )} )} diff --git a/src/constants.tsx b/src/constants.tsx index c541650..0a2d86c 100644 --- a/src/constants.tsx +++ b/src/constants.tsx @@ -45,3 +45,22 @@ export const DeferredPaymentMethodStrategy = { SDK: 'sdk', API: 'api', }; + +export const App = { + PAY_NOW: 'pay-now', + TRANSACTIONS: 'transactions', + ORDERS: 'orders', + SUGGESTIONS: 'suggestions', +} as const; + +export type AppType = (typeof App)[keyof typeof App] | (string & {}); + +export const Step = { + ADD_CARD: 'add-card', + LOGIN_COMPANY: 'login-company', + LOGIN_PAYROLL: 'login-payroll', + SEARCH_COMPANY: 'search-company', + SEARCH_PAYROLL: 'search-payroll', +} as const; + +export type StepType = (typeof Step)[keyof typeof Step] | (string & {}); diff --git a/src/index.tsx b/src/index.tsx index 8e589ac..2a01e1c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,7 +2,7 @@ import { Appearance, NativeModules, Platform } from 'react-native'; import { AtomicIOS } from './ios'; import { AtomicAndroid } from './android'; import * as CONSTANTS from './constants'; -import type { PresentationStyleIOS } from './constants'; +import type { PresentationStyleIOS, AppType, StepType } from './constants'; const LINKING_ERROR = `The package '@atomicfi/transact-react-native' doesn't seem to be linked. Make sure: \n\n` + @@ -37,6 +37,7 @@ interface Task { operation: String; distribution?: Object; navigationOptions?: Object; + apps?: AppType[]; } interface Customer { @@ -44,12 +45,14 @@ interface Customer { } interface DeeplinkOptions { - step?: 'loginCompany' | 'loginPayroll' | 'addCard' | 'pay-now' | string; + step?: StepType; + app?: AppType; companyId?: string; connectorId?: string; companyName?: string; singleSwitch?: boolean; payments?: string[]; + accountId?: string; } interface Config { @@ -77,8 +80,15 @@ export const { Environment, DeferredPaymentMethodStrategy, PresentationStyles, + App, + Step, } = CONSTANTS; -export type { TransactEnvironment, PresentationStyleIOS } from './constants'; +export type { + TransactEnvironment, + PresentationStyleIOS, + AppType, + StepType, +} from './constants'; export type { DeeplinkOptions }; export const Atomic = { From 277f5a26108a6b41c23ecfc0630369f1423cd43e Mon Sep 17 00:00:00 2001 From: Braxton Ward Date: Thu, 4 Dec 2025 15:23:59 -0700 Subject: [PATCH 2/2] chore: update documentation workflow --- .github/workflows/documentation.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b777dd1..01506b9 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -7,9 +7,10 @@ on: jobs: notify: - uses: atomicfi/mobile-conformance-tests/.github/workflows/notify_releases.yml@main + uses: atomicfi/sdk-release-notifications/.github/workflows/notify_releases.yml@main secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }} NOTION_API_KEY: ${{ secrets.NOTION_RELEASES_API_KEY }} LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }} - GITHUB_DEPLOY_KEY: ${{ secrets.CONFORMANCE_REPO_PULL_KEY }} + GITHUB_DEPLOY_KEY: ${{ secrets.NOTIFICATIONS_REPO_PULL_KEY }} + GITHUB_RELEASE_PULL_TOKEN: ${{ github.token }}