Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/mobile-sdk-demo-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,37 @@ jobs:
FORCE_BUNDLING=1 RCT_NO_LAUNCH_PACKAGER=1 \
xcodebuild -workspace "$WORKSPACE_PATH" -scheme ${{ env.IOS_PROJECT_SCHEME }} -configuration Debug -destination "id=${{ env.IOS_SIMULATOR_ID }}" -derivedDataPath packages/mobile-sdk-demo/ios/build -jobs "$(sysctl -n hw.ncpu)" -parallelizeTargets -quiet COMPILER_INDEX_STORE_ENABLE=NO ONLY_ACTIVE_ARCH=YES SWIFT_COMPILATION_MODE=wholemodule || { echo "❌ iOS build failed"; exit 1; }
echo "✅ iOS build succeeded"
- name: Build iOS Release Archive (unsigned)
run: |
echo "Building iOS Release archive (unsigned) to validate Release configuration..."
WORKSPACE_PATH="${{ env.IOS_WORKSPACE_PATH }}"

FORCE_BUNDLING=1 RCT_NO_LAUNCH_PACKAGER=1 \
xcodebuild archive \
-workspace "$WORKSPACE_PATH" \
-scheme ${{ env.IOS_PROJECT_SCHEME }} \
-configuration Release \
-archivePath packages/mobile-sdk-demo/ios/build/SelfDemoApp.xcarchive \
-destination "generic/platform=iOS" \
-jobs "$(sysctl -n hw.ncpu)" \
-parallelizeTargets \
-quiet \
COMPILER_INDEX_STORE_ENABLE=NO \
SWIFT_COMPILATION_MODE=wholemodule \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
AD_HOC_CODE_SIGNING_ALLOWED=NO \
|| { echo "❌ iOS Release archive build failed"; exit 1; }
echo "✅ iOS Release archive build succeeded (unsigned)"

# Verify archive was created
if [ -d "packages/mobile-sdk-demo/ios/build/SelfDemoApp.xcarchive" ]; then
echo "📦 Archive created at packages/mobile-sdk-demo/ios/build/SelfDemoApp.xcarchive"
else
echo "❌ Archive not found"
exit 1
fi
- name: Install and Test on iOS
run: |
echo "Installing app on simulator..."
Expand Down
2 changes: 1 addition & 1 deletion app/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const IS_TEST_BUILD = process.env.IS_TEST_BUILD === 'true';

export const MIXPANEL_NFC_PROJECT_TOKEN = undefined;
export const SEGMENT_KEY = process.env.SEGMENT_KEY;
export const SELF_UUID_NAMESPACE = process.env.SELF_UUID_NAMESPACE;
export const SENTRY_DSN = process.env.SENTRY_DSN;
export const SUMSUB_TEE_URL =
process.env.SUMSUB_TEE_URL || 'http://localhost:8080';
export const SUMSUB_TEST_TOKEN = process.env.SUMSUB_TEST_TOKEN;

export const TURNKEY_AUTH_PROXY_CONFIG_ID =
process.env.TURNKEY_AUTH_PROXY_CONFIG_ID;

export const TURNKEY_GOOGLE_CLIENT_ID = process.env.TURNKEY_GOOGLE_CLIENT_ID;
export const TURNKEY_ORGANIZATION_ID = process.env.TURNKEY_ORGANIZATION_ID;
7 changes: 6 additions & 1 deletion app/src/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export type RootStackParamList = Omit<
| 'Home'
| 'IDPicker'
| 'IdDetails'
| 'KycSuccess'
| 'RegistrationFallback'
| 'Loading'
| 'Modal'
Expand Down Expand Up @@ -201,7 +202,11 @@ export type RootStackParamList = Omit<

// Onboarding screens
Disclaimer: undefined;
KycSuccess: undefined;
KycSuccess:
| {
userId?: string;
}
| undefined;

// Dev screens
CreateMock: undefined;
Expand Down
4 changes: 3 additions & 1 deletion app/src/providers/selfClientProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ export const SelfClientProvider = ({ children }: PropsWithChildren) => {

// Success case: navigate to KYC success screen
if (navigationRef.isReady()) {
navigationRef.navigate('KycSuccess');
navigationRef.navigate('KycSuccess', {
userId: accessToken.userId,
});
}
} catch (error) {
const safeInitError = sanitizeErrorMessage(
Expand Down
47 changes: 40 additions & 7 deletions app/src/screens/kyc/KycSuccessScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,70 @@
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import React from 'react';
import React, { useCallback } from 'react';
import { StyleSheet, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { YStack } from 'tamagui';
import { v5 as uuidv5 } from 'uuid';
import type { StaticScreenProps } from '@react-navigation/native';
import { useNavigation } from '@react-navigation/native';
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';

import { DelayedLottieView } from '@selfxyz/mobile-sdk-alpha';
import { DelayedLottieView, useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import loadingAnimation from '@selfxyz/mobile-sdk-alpha/animations/loading/misc.json';
import {
AbstractButton,
Description,
Title,
} from '@selfxyz/mobile-sdk-alpha/components';
import { ProofEvents } from '@selfxyz/mobile-sdk-alpha/constants/analytics';
import { black, white } from '@selfxyz/mobile-sdk-alpha/constants/colors';

import { buttonTap } from '@/integrations/haptics';
import type { RootStackParamList } from '@/navigation';
import { requestNotificationPermission } from '@/services/notifications/notificationService';
import {
getFCMToken,
getSelfUuidNamespace,
registerDeviceToken,
requestNotificationPermission,
} from '@/services/notifications/notificationService';
import { useSettingStore } from '@/stores/settingStore';

type KycSuccessRouteParams = StaticScreenProps<
| {
userId?: string;
}
| undefined
>;

const KycSuccessScreen: React.FC = () => {
const KycSuccessScreen: React.FC<KycSuccessRouteParams> = ({
route: { params },
}) => {
const navigation =
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
const userId = params?.userId;
const insets = useSafeAreaInsets();
const setFcmToken = useSettingStore(state => state.setFcmToken);
const selfClient = useSelfClient();
const { trackEvent } = selfClient;

const handleReceiveUpdates = async () => {
const handleReceiveUpdates = useCallback(async () => {
buttonTap();
await requestNotificationPermission();

if ((await requestNotificationPermission()) && userId) {
const token = await getFCMToken();
if (token) {
setFcmToken(token);
trackEvent(ProofEvents.FCM_TOKEN_STORED);

const sessionId = uuidv5(userId, getSelfUuidNamespace());
await registerDeviceToken(sessionId, token);
}
}

// Navigate to Home regardless of permission result
navigation.navigate('Home', {});
};
}, [navigation, setFcmToken, trackEvent, userId]);

const handleCheckLater = () => {
buttonTap();
Expand Down
5 changes: 5 additions & 0 deletions app/src/services/notifications/notificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import { PermissionsAndroid, Platform } from 'react-native';
import { SELF_UUID_NAMESPACE } from '@env';
import type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
import messaging from '@react-native-firebase/messaging';

Expand Down Expand Up @@ -36,6 +37,10 @@ const error = (...args: unknown[]) => {
if (!isTestEnv) console.error(...args);
};

export function getSelfUuidNamespace(): string {
return SELF_UUID_NAMESPACE ?? '';
}

export { getStateMessage };

export async function isNotificationSystemReady(): Promise<{
Expand Down
Loading
Loading