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

IOS - React Native auto link Fix #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

ghost
Copy link

@ghost ghost commented Feb 26, 2020

Fix IOS, auto import files.

P.S: Probably not the best way to import, but i couldn't find a way to import the folders too.

@EricWiener
Copy link

This fixed the issue with the import for me, but I get an EXC_BAD_ACCESS when trying to create a PDF on iOS.

@thekevinbrown
Copy link
Collaborator

Just a note that the reason this isn't merged yet is:

  • @EricWiener hit an issue
  • I don't have time to test this at the moment.

I'd be happy to merge a RN 60+ auto link support PR, just need to be confident that it works, and make sure that it's tested well. If someone else is happy to chip in help here, more than happy to merge and release.

@calinbodnar
Copy link

calinbodnar commented Nov 3, 2021

This fixed the issue with the import for me, but I get an EXC_BAD_ACCESS when trying to create a PDF on iOS.

I got the same EXC_BAD_ACCESS error when made the changes in PR#80. Turned out drawText function is using a default font (Times New Roman) which is not supported in my iOS project. Just had to set fontName option to one of the fonts that are supported.

@thekevinbrown
Copy link
Collaborator

@calinbodnar sounds like we should set the default font to a font that's always available in iOS to make this easier for people.

@rcaseSW
Copy link

rcaseSW commented Sep 10, 2023

This PR worked for me (finally) in react-native 0.71, after trying many other PRs and code changes. I had to copy the RNReactNativePdfLib.podspec from the ios folder to the root of the library (node_modules/react-native-pdf-lib) and then add "ios/" to the paths referenced within that file, and also remove the ".." in front of "../package.json".

@shivanip-iprogrammer
Copy link

shivanip-iprogrammer commented Oct 11, 2023

This PR worked for me (finally) in react-native 0.71, after trying many other PRs and code changes. I had to copy the RNReactNativePdfLib.podspec from the ios folder to the root of the library (node_modules/react-native-pdf-lib) and then add "ios/" to the paths referenced within that file, and also remove the ".." in front of "../package.json".

Hey @rcaseSW ,
can you please help me out for this issue ?
Have you linked manually.....i get error if i link manually: ''React/RCTConvert.h' file not found'.
please explain me this "add "ios/" to the paths referenced within that file".

@rcaseSW
Copy link

rcaseSW commented Oct 11, 2023

@shivanip-iprogrammer I did not link manually. I just moved the RNReactNativePdfLib.podspec file to the root of the library, then adjusted the paths within that file so they pointed to the files correctly from the root. So I modified the package.json line as mentioned above, and also modified the following lines as such, adding "ios/" to the paths:

s.source_files = "ios/.{h,mm}", "ios/lib/**/"
s.ios.vendored_libraries = ["ios/lib/universal/libFreeType.a", "ios/lib/universal/libLibJpeg.a", "ios/lib/universal/libLibTiff.a", "ios/lib/universal/libPDFWriter.a", "ios/lib/universal/libZlib.a"]

Note that I later found out this solution only works for developing on mac's with an intel processor (x86). It does not build on M1 or M2 macs (arm64 architecture).

@shivanip-iprogrammer
Copy link

shivanip-iprogrammer commented Oct 12, 2023

@rcaseSW Thanks for solution but it is not working at my end and i have a mac with intel processor.
I get this issue - **

TypeError: Cannot read property 'createPDF' of null

It seems this is the issue of linking but unfortunately link does not work after RN>=69.

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

Successfully merging this pull request may close these issues.

6 participants