christopherdro / react-native-print Goto Github PK
View Code? Open in Web Editor NEWPrint documents using React Native
License: MIT License
Print documents using React Native
License: MIT License
On ios, when filePath is an invalid URL (e.g. one results in 404 http status code), ios will complain with an error like this (visible on xcode):
ERROR: attempting to display print options with no printing source (item/items/formatter/renderer) set
But there is nothing on JS side, as the promise never resolves/rejects
I wonder if anything can be done to capture that error and bring it back to JS.
I am using a IPAD pro 12.9
this is the select printer method I am using, called from the button below, on the iphone the dialog comes up but on the ipad nothing happens
here is the repo. the detach2 branch is the relevant one
detach-test
selectPrinter = async () => {
const selectedPrinter = await RNPrint.selectPrinter();
this.setState({ selectedPrinter });
};
<Button title="Select Printer" onPress={this.selectPrinter} />
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.instancecloudmobile, PID: 4098
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.webkit.WebView.destroy()' on a null object reference
at com.rnprint.RNPrint.RNPrintModule$2$1$1$override.onFinish(RNPrintModule.java:173)
iPad when you press print it doesn't close the window & return to the app. iPhone is working though.
Versions:
React Native: 0.58.4
React Native Print: 0.5.1
React Native Navigation: 2
In my app I need to print different types of file in different views. So I use print() function both with filePath and html (separately), i.g.:
await RNPrint.print({ html: htmlToPrint });
and somewhere else
await RNPrint.print({ filePath: pdfToPrint });
The problem I'm facing with is that if I cancel
both the print attempts above (in my app flow), it's showing an error:
After many attempts and some research I found out the problem is that the options passed are not cleared, so that the print() function is trying to resolve itself with both filePath and html
await RNPrint.print({ filePath: pdfToPrint, html: htmlToPrint });
I've just submitted a PR which solves this issue.
You can check it here
I'm getting the following warning in the console:
Module RNPrint requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
I tried to add this package into my react native project. Here is the error I got,
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProject/MainApplication.java:18: error: cannot access ReactApplication
public class MainApplication extends NavigationApplication {
^
class file for com.facebook.react.ReactApplication not found
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProject/MainApplication.java:20: error: method does not override or implement a method from a supertype
@Override
^
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProject/MainApplication.java:41: error: method does not override or implement a method from a supertype
@Override
^
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProject/MainApplication.java:46: error: method does not override or implement a method from a supertype
@Override
^
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/network/NetInfoPackage.java:12: error: NetInfoPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class NetInfoPackage implements ReactPackage {
^
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProjectclite/AuditLogPackage.java:12: error: AuditLogPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class AuditLogPackage implements ReactPackage {
^
/home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProjectclite/CouchPackage.java:12: error: CouchPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class CouchPackage implements ReactPackage {
^
Note: /home/anonymous/myProject2/myProject-phase2-mobile/android/app/src/main/java/com/myProjectclite/CouchModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I'm using react native version 0.56.0.
I am running into an error with a detached RNCA app using Expokit in iOS.
This is the error I'm getting:
undefined is not an object (evaluating '_reactNativePrint2.default.print')
package.json:
{
"name": "AppName",
"version": "2.0.0",
"private": true,
"devDependencies": {
"jest-expo": "25.0.0",
"react-native-scripts": "1.8.1",
"react-test-renderer": "16.0.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^25.0.0",
"react": "16.2.rea0",
"react-font-face": "^0.2.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
"react-native-auto-height-image": "^1.0.0",
"react-native-print": "^0.5.0",
"react-native-storage": "^0.2.2",
"react-navigation": "^1.0.0-beta.27"
}
}
Here is what I did to get to this point:
npm install --save react-native-print
, and running react-native-link
exp detach
ios
directory and ran pod install
This installs the app on my iPad and allows me to test.
I have the following code in a component:
import RNPrint from 'react-native-print';
...
handleClickPrint() {
console.log('print');
RNPrint.print({
html: '<h1>Heading 1</h1><h2>Heading 2</h2><h3>Heading 3</h3>'
});
}
The use of RNPrint.print is causing the error.
I do find it odd that I need to have exp start
running for the app to load. It's like it's not building a native app, but instead installing a standalone Expo app that loads my RN app from the local expo server.. Maybe I'm not understanding how detached apps works. Anyway, that's beside the point.
Should this package work in this situation? Is there something I'm doing wrong?
Let me know if I need to provide any further information.
Thanks!
When android support coming ?
Is there anything additional required to make this plugin work in RELEASE? It seems to be working fine in DEBUG on ANDROID.
I ran the following:
react-native link
react-native run-android
Print Dialog is triggered.
When i ran the following:
react-native run-android --variant=release
Print Dialog is not triggered, No errors thrown.
From mid august, Android will need a target sdk version which is minimum API26. Also the compile sdk version should be updated
Hi !
First thanks for your work :)
I'm trying to build an app with react-native-print on iOS with RN 0.39.2
This is the error :
#import <React/RCTView.h> file not found
in RNPrint.h
I've tried with :
#import "RCTView.h"
instead but problem still here :/
Someone have a solution ?
Hi there,
First of all, thanks for this awesome module, well, currently I am facing an issue where I need to silently print some data directly to LAN or Bluetooth printer without getting that pop-up to select a printer first and then click on the print button.
Is there any way to make this work?
Please help :),
Thanks!
Hi, I am getting the following error when trying to compile the project 'react-native run-android'
:react-native-print:compileDebugJavaWithJavac Note: /Library/WebServer/Documents/TestingApp/node_modules/react-native-print/android/src/main/java/com/christopherdro/RNPrint/RNPrintModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-print:compileDebugJavaWithJavac FAILED /Library/WebServer/Documents/TestingApp/node_modules/react-native-print/android/src/main/java/com/christopherdro/RNPrint/RNPrintPackage.java:26: error: method does not override or implement a method from a supertype @Override ^
"react": "16.6.3",
"react-native": "^0.58.6",
So, my app is for a brazilian audience and I'd like to have it on full portuguese if possible.
The problem is the launcher is in english. Is there any way I could change it?
Thanks
How can I print out qrcode, I only found two method which path and html, someone can teach me?
I am using a brother Ql-820NWB thermal label printer and I am getting alot of extra whitespace when printing
I invoked the RNPrint.selectPrinter() on multiple iPads (of many versions) but the select printer menu that normally appears when using the same method on an iPhone doesn't show up! When on an iPad, pressing the assigned button that would invoke the method would only flash the screen a bit.
Below is the code that I have used
selectPrinter = async () => {
if(this.state.selectedPrinter == null || this.state.selectedPrinter == undefined){
const selectedPrinter = await RNPrint.selectPrinter()
this.setState({ selectedPrinter })
console.warn(selectedPrinter)
console.warn(this.state.selectedPrinter)
}
}
This is the printer selection screen which pops on iPhones only (The result I am trying to achieve on iPad)
Is there any callback? I want to apply some conditions on it.
@christopherdro can you please let me know about this, I have to perform some action.
It's taking 76MB to download
Hi, I was wondering how on iOS I could print an html string that contains a local image? Thanks!
Is there a reason why this library is setting the minsdkversion to 19? RN uses 16 and because of that there is a conflict.
I lowered the version to 16 and I was able to build my project and print a pdf with the library? Can we lower the sdk version in the package?
Shall I make a pull request with that?
This issue leads to application crash for the very first time when I try to connect with the print module which was developed with react-native-print. Please find the error log that I got.
Any help in solving this issue is much appreciated.
2018-12-18 12:37:59.336 18608-18608/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: in.instabike, PID: 18608
java.lang.NullPointerException: Attempt to invoke virtual method 'android.print.PrintDocumentAdapter android.webkit.WebView.createPrintDocumentAdapter()' on a null object reference
at com.christopherdro.RNPrint.RNPrintModule$1$1$1.(RNPrintModule.java:85)
at com.christopherdro.RNPrint.RNPrintModule$1$1.onPageFinished(RNPrintModule.java:83)
at xq.c(SourceFile:228)
at alW.handleMessage(SourceFile:72)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Hi and thanks for the (highly useful) library!
I'm curious if you had any plans to support "silent printing" -- in other words, printing directly to a printer without a print dialog. The usecase here is for things like receipt / ticketing printing, where we want the print to start automatically without intervention.
It looks like this is definitely possible with Apple's printing API - https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPrintInteractionController_Class/index.html#//apple_ref/doc/uid/TP40010141-CH1-SW34 / http://stackoverflow.com/questions/8125560/is-there-a-way-to-silent-print-using-ios-airprint-e-g-no-print-dialog for an example implementation.
The one other thing that would need to be added is a method to list the connected printers (so that the user could then set the desired printer).
If this isn't something you have the time / interest in building, I would be willing to work on a PR myself... just might be a bit slower due to unfamiliarity with Apple's printing APIs in general :)
Please let me know - thanks again!
Downloaded the example app and tried to run it. Works OK on iOS and was able to print to the printer. However, couldn't do the same on Android... App is stuck on 'Searching for Printers' screen and nothing happens after that.
Looking at the emulator logs, I see the following: (omitted some stuff for better readability)
`
10-26 08:33:38.251 1704-1747/system_process I/ActivityManager: Displayed com.android.printspooler/.ui.PrintActivity: +573ms (total +1s153ms)
10-26 08:33:38.735 7716-7716/com.android.printspooler W/View: requestLayout() improperly called by android.widget.TextView{507e924 V.ED..... ......ID 239,0-265,63 #7f05000a app:id/copies_count_summary} during layout: running second layout pass
10-26 08:33:38.735 7716-7716/com.android.printspooler W/View: requestLayout() improperly called by android.widget.TextView{33f6c8d V.ED..... ......ID 572,0-693,63 #7f05000b app:id/paper_size_summary} during layout: running second layout pass
10-26 08:33:38.737 7716-7732/com.android.printspooler I/MutexFileProvider: Acquired file: /data/user/0/com.android.printspooler/files/print_job_ebd7b2a2-538a-4b8f-aeed-92e30e8fbb68.pdf by thread: Thread[AsyncTask #1,5,main]
10-26 08:33:38.751 7716-7732/com.android.printspooler I/MutexFileProvider: Released file: /data/user/0/com.android.printspooler/files/print_job_ebd7b2a2-538a-4b8f-aeed-92e30e8fbb68.pdf from thread: Thread[AsyncTask #1,5,main]
10-26 08:33:38.899 7716-7716/com.android.printspooler I/MutexFileProvider: Acquired file: /data/user/0/com.android.printspooler/files/print_job_ebd7b2a2-538a-4b8f-aeed-92e30e8fbb68.pdf by thread: Thread[main,5,main]
10-26 08:33:44.221 2154-2995/com.google.android.gms.persistent V/NativeCrypto: Read error: ssl=0x7f78dcd7bdc0: I/O error during system call, Connection reset by peer
10-26 08:33:44.222 2154-2995/com.google.android.gms.persistent V/NativeCrypto: SSL shutdown failed: ssl=0x7f78dcd7bdc0: I/O error during system call, Broken pipe
10-26 08:33:44.224 1704-2355/system_process D/ConnectivityService: reportNetworkConnectivity(100, false) by 10008
10-26 08:33:44.224 1704-2552/system_process D/NetworkMonitor/NetworkAgentInfo [MOBILE (LTE) - 100]: Forcing reevaluation for UID 10008
10-26 08:33:55.169 7716-7731/com.android.printspooler D/EGL_emulation: eglMakeCurrent: 0x7f78dcd61820: ver 3 1 (tinfo 0x7f78dcd42c80)
10-26 08:33:57.031 1704-2168/system_process I/ActivityManager: START u0 {cmp=com.android.printspooler/.ui.SelectPrinterActivity} from uid 10047 on display 0
10-26 08:33:57.100 7716-7731/com.android.printspooler D/EGL_emulation: eglMakeCurrent: 0x7f78dcd61820: ver 3 1 (tinfo 0x7f78dcd42c80)
10-26 08:33:57.163 7660-7679/com.rnprintexample D/EGL_emulation: eglMakeCurrent: 0xee464600: ver 3 1 (tinfo 0xee4525f0)
10-26 08:33:57.166 7660-7679/com.rnprintexample E/Surface: getSlotFromBufferLocked: unknown buffer: 0xeaaca140
10-26 08:33:57.206 7716-7731/com.android.printspooler D/EGL_emulation: eglMakeCurrent: 0x7f78dcd61820: ver 3 1 (tinfo 0x7f78dcd42c80)
10-26 08:33:57.343 7716-7731/com.android.printspooler E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f78dcd61be0
10-26 08:33:57.349 7716-7731/com.android.printspooler D/OpenGLRenderer: endAllStagingAnimators on 0x7f78d0739400 (ListPopupWindow$DropDownListView) with handle 0x7f78dcd42fa0
10-26 08:33:57.523 7716-7731/com.android.printspooler D/EGL_emulation: eglMakeCurrent: 0x7f78dcd61820: ver 3 1 (tinfo 0x7f78dcd42c80)
10-26 08:33:57.743 1704-1747/system_process I/ActivityManager: Displayed com.android.printspooler/.ui.SelectPrinterActivity: +624ms
10-26 08:33:57.838 7716-7731/com.android.printspooler E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f78d94a4700
10-26 08:34:24.269 1704-2552/system_process D/NetworkMonitor/NetworkAgentInfo [MOBILE (LTE) - 100]: Probably not a portal: exception java.net.UnknownHostException: Unable to resolve host "connectivitycheck.gstatic.com": No address associated with hostname
10-26 08:34:24.270 1704-1851/system_process D/ConnectivityService: NetworkAgentInfo [MOBILE (LTE) - 100] validation failed
10-26 08:34:24.271 1704-1851/system_process D/ConnectivityService: rematching NetworkAgentInfo [MOBILE (LTE) - 100]
10-26 08:34:24.271 1704-1851/system_process D/ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [MOBILE (LTE) - 100]
10-26 08:34:24.276 1704-1851/system_process D/ConnectivityService: sendStickyBroadcast: action=android.net.conn.INET_CONDITION_ACTION
10-26 08:34:24.277 1906-2374/com.android.systemui D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524294
10-26 08:34:24.283 2396-3417/com.google.android.gms D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524294
10-26 08:34:25.274 1704-2552/system_process D/NetworkMonitor/NetworkAgentInfo [MOBILE (LTE) - 100]: Probably not a portal: exception java.net.UnknownHostException: Unable to resolve host "connectivitycheck.gstatic.com": No address associated with hostname
10-26 08:34:25.275 1704-1851/system_process D/ConnectivityService: NetworkAgentInfo [MOBILE (LTE) - 100] validation failed
10-26 08:34:59.293 1257-1316/? D/hwcomposer: hw_composer sent 3249 syncs in 60s
10-26 08:35:07.321 1704-2552/system_process
D/NetworkMonitor/NetworkAgentInfo [MOBILE (LTE) - 100]: Probably not a portal: exception java.net.UnknownHostException: Unable to resolve host "connectivitycheck.gstatic.com": No address associated with hostname
`
Tested it on my Mac and Windows PC and both had this problem, whereas the iOS version worked perfectly
I tried writing a simple callback onto the end of the print job to create an alert when the print job is done however if I press cancel the alert still comes up. Is there some way to differentiate between someone pressing print or cancel?
My code is below for reference.
function PrintAlert() {
const printAlert = AlertIOS.alert(
alertName + "'s label is being printed now.",
"Please go and check the printer."
)
}
async function PrintDocument() {
let PrintSettings = {
html: PrintLabelLayout(),
fileName: 'PrintLabel',
base64: false,
height: 420,
width: 595,
padding: 0
};
try {
const results = await RNHTMLtoPDF.convert(PrintSettings);
const printJob = await RNPrint.print(results.filePath).then(() => {
PrintAlert()
});
} catch (err) {
console.log(err)
}
}
First of all I enjoy the ease of use of this library. What I'm still missing is the feature to print multiple copies for a file right out of the iOS option screen. I didn't find a way to enable that. I wanted to extend the library but I'm struggling to find the necessary docs for the objective C code.
Here are some more options I found using the built in iOS file viewer. I would love to have all the options also available for the printer when I'm using this library.
@christopherdro I am using the same code given in the example. I have a list of items, where user can print any list item data. But When I install the fresh app & click on print, the blank screen appears. I have checked that all the html data is coming, its not blank but on Print page no data appears.
When I click second time, it works.
Can you please let me know what is the issue at first time? The issue is with dynamic HMTL. Hardcoded HTML is working fine.
Commented out this line to enable print options to pop up. Otherwise it fails to present it.
//printInteractionController.delegate = self;
I am using this module to print labels for packages for a courier.
There are often multiple labels to print.
When the labels are printed in succession, the second one gets dropped.
I have created an example project based on the react-native-print sample project.
Steps to replicate:
create a new react-native project
add react-native-print
npm install react-native-print --save
react-native link
Replace the App.js with the following:
import React, { Component } from 'react';
import {
Button,
StyleSheet,
View
} from 'react-native';
import RNPrint from 'react-native-print';
export default class RNPrintExample extends Component {
async printHTML() {
await RNPrint.print({
html: '<h1>First Document</h3>'
})
await RNPrint.print({
html: '<h1>Second Document</h3>'
})
await RNPrint.print({
html: '<h1>Third Document</h3>'
})
}
render() {
return (
<View style={styles.container}>
<Button onPress={this.printHTML} title="Print HTML" />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
});
When you run the app, there is only one button "Print HTML". Clicking this will print the three documents.
The second document will be lost.
This works OK on Android.
This means that the "Cancel" and "Print" buttons are also missing, making it impossible to print or exit the dialog.
In android, I want one screen of my react native app to convert into PDF.It is possible to use direct comonent of app for converting pdf rather than html? And also can not change the number copies.It has only 1 number
NPM PACKAGE BROKEN npm i react-native-print --save installes in node_modules without several files like index.js
When I've tried printing from a file path, I get the 'Preparing preview...' message on the print screen, but it never gets past that. I've tried both in an emulator and on a real device. Has anyone else seen this?
I've integrated the library with npm install react-native-print --save && react-native link
Now when I try to publish a new beta, I get this error:
Is it a mistake on my side? BTW, the build is launched with fastlane beta
UDPATE: As a workaround I've just deleted RNPrintTests
target from the linked RNPrint.xcproj
, but I don't think this is the best solution!
I need to use UIPrintInfoOutputPhoto
as outputType, I patched for myself here: master...kevinresol:photo
But I think it would be more convenient if it is exposed to JS. Also fixes #47
Im trying to print a image from url but app close and have error:
java.lang.RuntimeException: Cannot print a malformed PDF file
android.print.PrintManager$PrintDocumentAdapterDelegate$MyHandler.handleMessage(PrintManager.java:1115)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7002)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
Only can print pdfs?
Seems the selectPrinter function doesn't run happily. In the logs I see:
WARNING: Calling -[UIPrinterPickerController presentAnimated:completionHandler:] on iPad
The module has been working great for the past few months. We recently updated to [email protected] and subsequently our builds have been failing.
The error lives on line 39 of the Completion handler in RNPrint.m
Too few arguments to block call, expected 3, have 1
I can get around the issue by adding two empty string arguments, but obviously it's not ideal :^/
It would be much appreciated if anyone has a solution for this. Unfortunately my Objective-C chops are non-existent for a pull request. Thanks.
OSX 10.11.3
Xcode 7.2.1
react-native ^0.21.0
react-native-print ^0.1.1
Can i print via Bluetooth? and How please help.
After installing the package and running react-native link
and trying to build for Android I get:
/myapp/android/app/src/main/java/com/myapp/MainApplication.java:6: error: cannot find symbol import com.rnprint.RNPrint.RNPrintPackage; ^ symbol: class RNPrintPackage location: package com.rnprint.RNPrint /myapp/android/app/src/main/java/com/myapp/MainApplication.java:29: error: cannot find symbol new RNPrintPackage(), ^ symbol: class RNPrintPackage 2 errors :app:compileDebugJavaWithJavac FAILED
This seems to be due to the package listed in AndroidManifest.xml being the old package name before it was updated in 0.4.0. I'll have a pull request to fix this shortly.
Hi,
I want to use this library with cocoapods with react native - is there a podspec file for it?
Thanks!
I just installed the module using:
npm install react-native-print --save
then ran:
react-native link
I copied the example to one of my screens in RN.
I get the following issue:
Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'selectPrinter' of undefined
TypeError: Cannot read property 'selectPrinter' of undefined
at ViewOrder._callee$ (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:158370:76)
at tryCatch (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:14084:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:14257:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:14127:23)
at tryCatch (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:14084:19)
at invoke (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:14160:22)
at blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:14188:13
at tryCallTwo (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:13422:7)
at doResolve (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:13586:15)
at new Promise (blob:http://localhost:8081/29d208a6-8ea9-4f98-8dec-3d931b4349f0:13445:5)
I console.log(RNPrint) and it is undefined.
Is it because i am running it in the simulator perhaps?
After i selected the printer, and i turn off the app. the app itself not remember the printer.
please Help.
I installed the package by running npm install react-native-print --save
, then I added RNPrint.xcodeproj
to Libraries. As per the documentation, the next step is to Add libRNPrint.a to Build Phases -> Link Binary With Libraries
, but I can't find that file to add. Am I missing any steps or what may be the reason behind this happening and how can I fix this?
Edit: Figured out how to add libRNPrint.a
now. The steps in the docs regarding adding to the project seem to be somewhat lacking. Maybe I'll send a pull request later adding more details to the steps.
Hi,
I was trying to use the print library for my app. I tried the manuel linking and follow the steps written in readMe. The issue is this :
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
C:\Users\HasanCan\portabiles\sensor-app\sensorProject\android\app\src\main\java\com\sensorproject\MainApplication.java:13: error: cannot find symbol
import com.rnprint.RNPrint.RNPrint;
^
symbol: class RNPrint
location: package com.rnprint.RNPrint
C:\Users\HasanCan\portabiles\sensor-app\sensorProject\android\app\src\main\java\com\sensorproject\MainApplication.java:33: error: cannot find symbol
new RNPrint()
^
symbol: class RNPrint
2 errors
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
Compilation failed; see the compiler error output for details.
BUILD FAILED
Total time: 37.61 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
any ideas?
Hi,
Your project is very usefull for me. I tried to deploy it on ios. But, in xcode, build failed with error RCTview.h not found.
I made react-native link and it has done task correctly.
Could you help me please?
when I print remotePdfUrl,how can I set cookie in native code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.