Riskified / ios_sdk

Riskified iOS SDK
Apache License 2.0
3 stars 7 forks source link

[React Native/iOS] 'Method was already called once' was thrown while invoking startBeacon on target RiskifiedSdk #35

Closed CTOverton closed 4 months ago

CTOverton commented 4 months ago

This issue is a native iOS issue that appears in the react native implementation of this sdk.

Screenshot

Official react native sdk: https://www.npmjs.com/package/@riskified/react-native-riskified-sdk

The linked Github repo and homepage have been made private, I would suggest making them public so issues can be made there. https://github.com/Riskified/react-native-riskified-sdk

Steps to reproduce

  1. Implement the react native sdk https://www.npmjs.com/package/@riskified/react-native-riskified-sdk
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';

import RiskifiedSDK from '@riskified/react-native-riskified-sdk';

RiskifiedSdk.startBeacon(shopDomain, token, false);

AppRegistry.registerComponent(appName, () => App);
  1. Open the app in a simulator
  2. Refresh metro to reload the js

You should see the error pop up since the app is reloaded and the js code is run again.

CTOverton commented 4 months ago

Seems like Riskified team pushed a new version of the sdk today 1.0.3 and seems to have fixed the error! Thanks team!

https://www.npmjs.com/package/@riskified/react-native-riskified-sdk/v/1.0.3