Skip to content
Merged
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
12 changes: 12 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release Notes

## Version 0.2.1

### 🐛 Bug Fixes
- **Fixed initializeSDKIOS function**: Resolved critical issue where `initializeSDKIOS()` was undefined due to incorrect native bridge method mapping
- The function was incorrectly calling `TsAccountprotection.initializeSDK()` instead of `TsAccountprotection.initializeSDKIOS()`
- This caused runtime errors when trying to initialize the SDK on iOS without parameters
- Updated example app to use correct `initializeSDKIOS()` method call

### Technical Details
- Corrected native method bridge mapping in `initializeSDKIOS` function
- Updated example implementation to demonstrate proper usage

## Version 0.2.0

### 🚀 Major API Refactor - Breaking Changes
Expand Down
4 changes: 2 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import { SafeAreaView, Keyboard, Alert, Platform } from 'react-native';

import {

Check failure on line 5 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
initializeIOS,
initializeSDKIOS,
setUserId,
setLogLevel,
clearUser,

Check failure on line 9 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
triggerAction,

Check failure on line 10 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
TSAction,

Check failure on line 11 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
type TSActionEventOptions

Check failure on line 12 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `·` with `,`
} from 'react-native-ts-accountprotection';
import MockServer from './mock-server';

Expand All @@ -22,7 +22,7 @@
payerName: string;
payeeName: string;
amount: string;
}

Check failure on line 25 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `;`

export type State = {
currentScreen: AppScreen;
Expand All @@ -30,35 +30,35 @@
isLoading: boolean;
};

export type Props = {

Check failure on line 33 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎⏎`

};

const enum AppScreen {
Login = 'Login',

Check warning on line 38 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

'Login' is already declared in the upper scope on line 16 column 8
AuthenticatedUser = 'AuthenticatedUser'

Check failure on line 39 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `,`

Check warning on line 39 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

'AuthenticatedUser' is already declared in the upper scope on line 17 column 10
}

export default class App extends React.Component<Props, State> {

Check failure on line 43 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `⏎··private·mockServer·=·new·MockServer(config.baseUrl,·config.clientId,·config.secret` with `··private·mockServer·=·new·MockServer(⏎····config.baseUrl,⏎····config.clientId,⏎····config.secret⏎··`
private mockServer = new MockServer(config.baseUrl, config.clientId, config.secret);

constructor(props: Props) {
super(props);
this.state = {
currentScreen: AppScreen.Login,
errorMessage: "",

Check failure on line 50 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `""` with `''`
isLoading: false
};
}

componentDidMount(): void {
this.onAppReady().catch(e => void e);

Check warning on line 56 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Expected 'undefined' and instead saw 'void'
}

render() {
return (
<SafeAreaView style={{ flex: 1 }}>

Check warning on line 61 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Inline style: { flex: 1 }
{
this.state.currentScreen === AppScreen.Login ? (
<Login onLogin={this.handleLogin} errorMessage={this.state.errorMessage} />
Expand All @@ -80,7 +80,7 @@
private onAppReady = async (): Promise<void> => {
// this is for iOS only, Android TSAccountProtectionSDK is initialized from application onCreate.
if (Platform.OS === 'ios') {
await initializeIOS(config.clientId, null);
await initializeSDKIOS();
}

const isLogEnabled = true;
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const enum TSAction {

// SDK Functions - Direct exports of the native module methods
export function initializeSDKIOS(): Promise<boolean> {
return TsAccountprotection.initializeSDK();
return TsAccountprotection.initializeSDKIOS();
}

export function initializeIOS(clientId: string, baseUrl?: string | null): Promise<boolean> {
Expand Down
Loading