expo-print
Provides an API for iOS (AirPrint) and Android printing functionality.
API documentation
Installation
This package is pre-installed in managed Expo projects. You may skip the rest of the installation guide if this applies to you.
For bare React Native projects, you must ensure that you have installed and configured the @unimodules/core
package before continuing.
Add the package to your npm dependencies
npm install expo-print
Configure for iOS
Add the dependency to your Podfile
and then run pod install
.
pod 'EXPrint', path: '../node_modules/expo-print/ios'
Configure for Android
- Append the following lines to
android/settings.gradle
:
include ':expo-print'
project(':expo-print').projectDir = new File(rootProject.projectDir, '../node_modules/expo-print/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:
api project(':expo-print')
- In
MainApplication.java
, import the package and add it to the ReactModuleRegistryProvider
list:
import expo.modules.expo.modules.print.PrintPackage;
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(Arrays.<Package>asList(
new PrintPackage()
), Arrays.<SingletonModule>asList());
Contributing
Contributions are very welcome! Please refer to guidelines described in the contributing guide.