### Run PSPDFKit React Native Catalog on iOS Source: https://github.com/pspdfkit/react-native/blob/master/samples/Catalog/README.md Provides step-by-step instructions to clone the repository, navigate to the Catalog project, install dependencies, install iOS pods, and launch the React Native application on an iOS device or simulator. Ensure all iOS development environment requirements, including Xcode and CocoaPods, are met before execution. ```Shell git clone https://github.com/PSPDFKit/react-native.git cd react-native/samples/Catalog yarn install cd iOS pod install cd .. react-native run-ios ``` -------------------------------- ### Run PSPDFKit React Native Catalog on Android Source: https://github.com/pspdfkit/react-native/blob/master/samples/Catalog/README.md Provides step-by-step instructions to clone the repository, navigate to the Catalog project, install dependencies, and launch the React Native application on an Android device or emulator. Ensure all Android development environment requirements are met before execution. ```Shell git clone https://github.com/PSPDFKit/react-native.git cd react-native/samples/Catalog yarn install react-native run-android ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/pspdfkit/react-native/blob/master/README.md Installs all required dependencies for the React Native project, ensuring all packages are correctly linked. ```bash yarn install ``` -------------------------------- ### Install iOS CocoaPods Dependencies Source: https://github.com/pspdfkit/react-native/blob/master/README.md Installs the CocoaPods dependencies required for the iOS project, linking native libraries. ```bash pod install ``` -------------------------------- ### Change Directory to Documents Source: https://github.com/pspdfkit/react-native/blob/master/README.md Changes the current working directory to the user's Documents folder, typically used as a starting point for new projects. ```bash cd ~/Documents ``` -------------------------------- ### Change Directory to iOS Project Folder Source: https://github.com/pspdfkit/react-native/blob/master/README.md Changes the current working directory to the `ios` folder within the React Native project, a prerequisite for installing CocoaPods. ```bash cd ios ``` -------------------------------- ### Create New React Native Project Source: https://github.com/pspdfkit/react-native/blob/master/README.md Initializes a new React Native project with the specified name, setting up the basic project structure and dependencies. ```bash npx react-native init PSPDFKitDemo ``` -------------------------------- ### Launch React Native Application Source: https://github.com/pspdfkit/react-native/blob/master/README.md Launches the React Native application on an iOS simulator/device or an Android emulator/device, allowing testing of the integrated SDK. ```bash react-native run-ios ``` ```bash react-native run-android ``` -------------------------------- ### Navigate into React Native Project Directory Source: https://github.com/pspdfkit/react-native/blob/master/README.md Changes the current working directory into the newly created React Native project folder. ```bash cd PSPDFKitDemo ``` -------------------------------- ### Add React Native PSPDFKit SDK Source: https://github.com/pspdfkit/react-native/blob/master/README.md Adds the PSPDFKit React Native SDK as a dependency to the project using Yarn, fetching it directly from the GitHub repository. ```bash yarn add react-native-pspdfkit@github:PSPDFKit/react-native ``` -------------------------------- ### Create Android Assets Directory Source: https://github.com/pspdfkit/react-native/blob/master/README.md Creates the `assets` directory within the Android application's source main folder, where PDF documents can be stored. ```bash mkdir android/app/src/main/assets ``` -------------------------------- ### Open Android Project build.gradle File Source: https://github.com/pspdfkit/react-native/blob/master/README.md Opens the main `build.gradle` file for the Android part of the React Native project, typically in a text editor. ```bash open android/build.gradle ``` -------------------------------- ### Open iOS Project Podfile Source: https://github.com/pspdfkit/react-native/blob/master/README.md Opens the Podfile for the iOS part of the React Native project, typically in a text editor, to configure CocoaPods dependencies. ```bash open ios/Podfile ``` -------------------------------- ### Set Nutrient SDK License Key for Current Platform Source: https://github.com/pspdfkit/react-native/blob/master/README.md This method initializes the Nutrient React Native SDK by setting a single license key for the currently running platform (either Android or iOS). It must be called before using any other Nutrient SDK APIs or features to enable full functionality and remove demo mode limitations. ```JavaScript PSPDFKit.setLicenseKey('YOUR_REACT_NATIVE_LICENSE_KEY_GOES_HERE'); ``` -------------------------------- ### Open React Native App.tsx File Source: https://github.com/pspdfkit/react-native/blob/master/README.md Opens the main `App.tsx` file for the React Native application, where the UI and logic are defined. ```bash open App.tsx ``` -------------------------------- ### Set Nutrient SDK License Keys for Android and iOS Source: https://github.com/pspdfkit/react-native/blob/master/README.md This method initializes the Nutrient React Native SDK by setting separate license keys for both Android and iOS platforms. It must be called before using any other Nutrient SDK APIs or features to enable full functionality and remove demo mode limitations. ```JavaScript PSPDFKit.setLicenseKeys('YOUR_REACT_NATIVE_ANDROID_LICENSE_KEY_GOES_HERE', 'YOUR_REACT_NATIVE_IOS_LICENSE_KEY_GOES_HERE'); ``` -------------------------------- ### Add Nutrient Maven Repository to Android build.gradle Source: https://github.com/pspdfkit/react-native/blob/master/README.md Adds the Nutrient Maven repository to the `allprojects` block in the Android `build.gradle` file, enabling the download of the PSPDFKit SDK. ```gradle allprojects { repositories { mavenLocal() + maven { + url 'https://my.nutrient.io/maven/' + } } } ``` -------------------------------- ### Return to Root Project Directory Source: https://github.com/pspdfkit/react-native/blob/master/README.md Changes the current working directory back to the root of the React Native project after completing iOS-specific configurations. ```bash cd .. ``` -------------------------------- ### Open Xcode Workspace Source: https://github.com/pspdfkit/react-native/blob/master/README.md Opens the Xcode workspace for the React Native project, which includes both the React Native and native iOS components. ```bash open PSPDFKitDemo.xcworkspace ``` -------------------------------- ### Display PDF Document with PSPDFKit in React Native Source: https://github.com/pspdfkit/react-native/blob/master/README.md Replaces the content of `App.tsx` to initialize and display a PDF document using `PSPDFKitView`, handling platform-specific asset paths and basic configuration for the viewer. ```typescript import React, {Component} from 'react'; import {Platform} from 'react-native'; import PSPDFKitView from 'react-native-pspdfkit'; import { NativeModules } from 'react-native'; const PSPDFKit = NativeModules.PSPDFKit; PSPDFKit.setLicenseKey(null); const DOCUMENT = Platform.OS === 'ios' ? 'Document.pdf' : 'file:///android_asset/Document.pdf'; export default class PSPDFKitDemo extends Component<{}> { render() { var pdfRef: React.RefObject = React.createRef(); return ( ); } } ``` -------------------------------- ### Configure PSPDFKitView Component in React Native Source: https://github.com/pspdfkit/react-native/blob/master/README.md Demonstrates how to create a `PDFConfiguration` object to customize the behavior of the `PSPDFKitView` component in React Native. This configuration can be passed during component creation or when using the `PSPDFKit.present()` Native Module API. ```typescript const configuration: PDFConfiguration = { showPageLabels: false, pageTransition: 'scrollContinuous', scrollDirection: 'vertical', showThumbnailBar: 'scrollable' }; ``` -------------------------------- ### Copy PDF Document to Android Assets Source: https://github.com/pspdfkit/react-native/blob/master/README.md Copies a PDF document from the Downloads folder to the Android application's assets directory, making it accessible to the app. ```bash cp ~/Downloads/Document.pdf android/app/src/main/assets/Document.pdf ``` -------------------------------- ### Update iOS Podfile Platform Version Source: https://github.com/pspdfkit/react-native/blob/master/README.md Updates the minimum iOS platform version in the Podfile to 16.0 or higher, ensuring compatibility with the PSPDFKit SDK. ```ruby ... - platform :ios, min_ios_version_supported + platform :ios, '16.0' ... ``` -------------------------------- ### Update Android build.gradle Compile and Min SDK Versions Source: https://github.com/pspdfkit/react-native/blob/master/README.md Updates the `compileSdkVersion` to 35 and `minSdkVersion` to 21 in the app's Android `build.gradle` file to meet the SDK's compatibility requirements. ```gradle ... android { - compileSdkVersion rootProject.ext.compileSdkVersion + compileSdkVersion 35 ... defaultConfig { applicationId "com.pspdfkitdemo" - minSdkVersion rootProject.ext.minSdkVersion + minSdkVersion 21 targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" } } ... ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.