Adding Reader SDK to a React Native project

Hi,
I’m trying to add Reader SDK to a React Native project and I’m mostly interested in building an iOS application.

I followed your guide here: react-native-square-reader-sdk/get-started.md at master · square/react-native-square-reader-sdk · GitHub but I’m stuck at point 8 of the Step 5, because when I initialized the project with react-native the iOS application’s code is C++ and not Swift (like the Quick Start Sample App you have in the same repository).

So my question is: how do I update the func application method in my app delegate to initialize the Reader SDK? I have two files that I guess I should be changing but not sure which one (AppDelegate.h or AppDelegate.mm) and how exactly.

I’m using:

  • react-native 0.71.3
  • react-native-square-reader-sdk 1.4.3
  • Reader SDK 1.6.9

Thanks

:wave: Our React Native SDK for Reader SDK has that included. You’ll want to use this setup guide for the React Native plugin. :slightly_smiling_face:

Hi Bryan,
thanks for the answer. There’s something that doesn’t quite work though. Not adding anything to AppDelegate.mm triggers me the following Exception when calling authorizeAsync() with a manually generated authCode from my Developer Dashboard:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: 'Square Reader SDK: You must call +initializeWithApplicationLaunchOptions before calling +sharedSDK.'

What am I getting wrong?

Having the same error on “react-native”: “0.71.8”