API ReferenceIntegrationsKnowledge Base

React Native Standard Integration - FAQs

1. How do I resolve the following error?

Copydyld: Library not loaded: @rpath/libswiftCoreGraphics.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/696F0EAD-E2A6-4C83-876F-07E3D015D167/.app/Frameworks/.framework/ Reason: image not found

To work around this issue, in your Xcode project:

  1. Set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES in your app. Learn more here.

  2. Navigate to Target SettingsGeneral and ensure that:

    1. The framework is added in Frameworks, Libraries, and Embed Content.
    2. Change Embed status from - 'Do not Embed' to 'Embed & Sign'.
  3. Verify that you have installed CocoaPods.

For Android, if you are using proguard for your builds, you need to add the following lines to proguard files

Copy-keepattributes *Annotation* -dontwarn com.razorpay.** -keep class com.razorpay.** {*;} -optimizations !method/inlining/ -keepclasseswithmembers class * { public void onPayment*(...); }

Auto linking is possible only if you are using React Native version 0.60+. Use the code given below to install and run the SDK:

Copynpm install react-native-razorpay --save cd ios && open podfile # Change the platform from iOS 9.0 to 10.0 pod install && cd .. # CocoaPods on iOS needs this extra step
Copyyarn react-native run-ios

3. How do I integrate the Razorpay SDK if my React Native app version is 0.59 and lower?

If you are using React Native version 0.59 and lower, follow the steps given below to install, link and run the SDK:

Copy$ npm install react-native-razorpay --save // Install the Razorpay React Native Standard SDK using the npm command.
Copyreact-native link react-native-razorpay // Link the SDK with React Native Project using Xcode.

4. How do I install the Razorpay React Native SDK through manual linking?

To manually link the SDK, the steps differ for iOS and Android platforms.

For iOS (via CocoaPods):
Add the following line to your build targets in your Podfile.

Copypod 'react-native-razorpay', :path => '../node_modules/react-native-razorpay'

Run the following command:

Copypod install

For iOS (without CocoaPods):

  1. In XCode, go to the project navigator:
    1. Right click Libraries.
    2. Add files to [your project's name].
    3. Go to node_modules/react-native-razorpay.
    4. Add the .xcodeproj file.
  2. In the project navigator, select your project:
    1. Add the libRNDeviceInfo.a from the deviceinfo project to your project's Build PhasesLink Binary With Libraries.
    2. Click .xcodeproj file you added before in the project navigator and go the Build Settings tab. Make sure All is selected (instead of Basic).
    3. Look for Header Search Paths and make sure it contains both $(SRCROOT)/../react-native/React and $(SRCROOT)/../../React. Mark both as recursive (should be OK by default).
  3. Run your project using the Cmd+R keys.

For Android:

Follow the steps to perform manual linking:

5. How can I update the existing 'razorpay-pod'?

Go to iOS folder in your project and run 'pod update' to update all the pods.

If you do not want to update all pods, run 'pod update razorpay-pod'

6. What is the process for raising a request for a new feature?

If you think of a new feature that can add more values or if that should be included in our plugin, please raise a pull request or create a feature request from New IssueFeature Request on our GitHub repository.

7. I am facing issues when integrating the Razorpay React Native Plugin with my React Native Expo app. How do I resolve this?

As Expo does not support native code, you cannot integrate with the Razorpay React Native Plugin. As a workaround, you can load the Razorpay page in a webview and use the callback URL logic to accept payments in your React Native Expo app. Know more.

8. In the new M1 MacBook, why am I not able to compile the React Native Razorpay plugin for release mode?

This issue is caused by the new changes introduced in Xcode 12.

To resolve this:

  1. Use Rosetta 2 for launching the app on your Mac.
  2. Add the following lines to Podfile:
Copypost_install do |installer| installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end End

Click here for more details.