skip to Main Content

I am working on a mobile application in React native (using Expo [SDK :~51.0.18])

Note : I am using Expo router to handle all routing in my project.

I am attempting to integrate this new SDK (Lean tech) into my app for bank connection (GCC region). This package uses react-native-webview

I have followed all the instructions in the tutorial as such :

import React, {useRef} from 'react';
import { View, StyleSheet, Text, Image } from 'react-native';
import { Button, useTheme} from 'react-native-paper';
// @ts-ignore
import LinkSDK from "lean-react-native";

const Screen: React.FC = () => {
 
  const theme = useTheme();
  const styles = createStyles(theme);
  const Lean = useRef(null)

  return (
      <View style={styles.container}>

          <LinkSDK
              ref={Lean}
              appToken="xxxxxx-6e5e-xxxx-xx58-bx6xd9fxxxxx"
              version="@latest"
              country="ArabEmirates"
              sandbox
          />
          <Button style={styles.button} mode="contained" textColor="#013511"  onPress={() => Lean.current.connect({ customer_id: "xxxxxxx" })}>
              Link Bank Account
          </Button>


      </View>
  );
};

Whenever i click the button to create the connection, I get the following error :
Render Error View config getter callback for component RCTModalHostView must be a function (received 'undefined').

I am posting this question to see if the issue is with me using Expo or if i need to do any additional setups (or linking) ? I did not follow the Pod install instruction as i am testing on an android device.

2

Answers


  1. Here is the documentation that talks about webview crash issues on Android, hope it helps https://docs.leantech.me/v2.0-KSA/docs/react-native#webview-crashes-on-android

    Login or Signup to reply.
  2. Do they have semi-open source lib you can look at? This looks like a problem with modal host view when it interacts with the webview component.

    1. Maybe play around with how the modal is rendering in react-native, it could change the trace at least.
    1. Try debugging the native crash.
    • On android studio use the step debugger.
    • Add a pause on exceptions.
    • It should break when attempting to load the component
    • If not, you will need to find their package within node_modules and add inspection to their assets. You may have to decompile their app to see the source of the problem. At this point…it’s worth asking them questions + asking for open source.

    Second step is to reach out to them since there code looks closed source.

    • You could ask them politely to publish their UI components and native source code.
    • Tell them the issue, mention your react-native version and expo versions.
    • React Native projects are meant for the community and contribution / feedback from the community is important to gauge health of an SDK.

    Also with react-native error messages, it’s better to post the console output instead of the redscreen/warning screens so we can see the full message.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search