Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work on iOS #4

Open
vitolipari opened this issue May 11, 2020 · 6 comments
Open

Not work on iOS #4

vitolipari opened this issue May 11, 2020 · 6 comments

Comments

@vitolipari
Copy link

When I use it on iOS it doesn't work.

This code

import PDF from "rn-pdf-generator";
let datab64 = await PDF.fromHTML(htmlBuider, 'http://localhost')

produce this error
Cannot read property 'fromHTML' of undefined

@vitolipari
Copy link
Author

After import library in XCode, when run project, XCode has an error

In file included from /Users/ ... /node_modules/rn-pdf-generator/ios/PDFGenerator.m:2:
In file included from /Users/ ... /node_modules/rn-pdf-generator/ios/PDFGenerator.h:3:
../../react-native/React/Base/RCTBridgeModule.h:10:9: fatal error: 'React/RCTDefines.h' file not found
#import <React/RCTDefines.h>
        ^~~~~~~~~~~~~~~~~~~~
1 error generated.```

@cesarvr
Copy link
Owner

cesarvr commented Jun 24, 2020

Hi @vitolipari

I will take a look at this particular issue and in the mean time you can use this example as a guide.

@vitolipari
Copy link
Author

Thank you very much for answer!!!
I cloned example, and I run it ( through XCode ) but it went in error!

Screenshot 2020-06-24 at 19 23 19

@cesarvr
Copy link
Owner

cesarvr commented Jun 24, 2020

There is a solution here in this thread for that..

You basically you need to modify this file ./node_modules/react-native/React/Base/RCTModuleMethod.mm and add this content.

@vitolipari
Copy link
Author

Hi @vitolipari

I will take a look at this particular issue and in the mean time you can use this example as a guide.

  • I cloned the sample project
  • I set all package.json dependencies to their last version
  • I run npm install
  • I open XCode project
  • I run iPhone simulator

but I believe there is something wrong with the new version of react

Screenshot 2020-06-25 at 11 23 46

@Serginh0
Copy link

Serginh0 commented Jul 7, 2020

the same thing happened to me when upgrading to react native 0.62.2, did you manage to get around it somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants