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

Hello #2

Closed
bluetechsky opened this issue Nov 25, 2021 · 8 comments
Closed

Hello #2

bluetechsky opened this issue Nov 25, 2021 · 8 comments

Comments

@bluetechsky
Copy link

Dear Stanislav Shemiakov,
I saw your PR
FolioReader/FolioReaderKit#388

Your effort is awesome!
I'd like to ask could you please run on iOS 14?

I cannot run Example code on iOS 14 because of issue calling js functions

Thanks alot!
Hung

@bluetechsky
Copy link
Author

@OrbitalMan

Dear Stanislav Shemiakov,
I saw your PR
FolioReader/FolioReaderKit#388

Your effort is awesome!
I'd like to ask could you please run on iOS 14?

I cannot run Example code on iOS 14 because of issue calling js functions

Thanks alot!
Hung

@OrbitalMan
Copy link
Owner

@bluetechsky Hello, this project is pretty much abandoned for quite a long time - I had a lot of issues with JS functions too, and I don't have much experience with JS, so I don't think I can help with that, sorry...

@bluetechsky
Copy link
Author

@OrbitalMan Thank you very much for your reply!
I believe you could build successfully in the past iOS version.
Do you remember what is your last success build iOS version?
I would like to try to run in that version.
Thank you very much again.
Hung

@OrbitalMan
Copy link
Owner

@bluetechsky uuuuhh umm, I guess iOS 12-ish? It was a couple years ago...

@bluetechsky
Copy link
Author

@OrbitalMan okeiy, thank you very much for your information. I will take some time to dig into it. Thanks again for your time!

@OrbitalMan
Copy link
Owner

No problem! Good luck with this!

@amrangry
Copy link

@bluetechsky did you able to figure out the solution
i found a solution for this issue but not pretty sure if its the right one or not,
let me know if you are still interested to discuss more regarding

@AravindSripathi
Copy link

AravindSripathi commented Jul 12, 2022

Hello, sorry if this is late. Recently downloaded @OrbitalMan build and integrated it as a local library in pod file.

Tested in iOS 15.5

As it was mentioned the javascript functions were not working which lead to the UI not working.

Checked through the original code and found that the JS file and CSS file used for the UI were not inserted into the HTML.

Here is the working solution. Check for FolioReaderCenter.swift file and add this code below "//Insert viewport" comment

        let mediaOverlayStyleColors = ""(self.readerConfig.mediaOverlayColor.hexString(false))", "(self.readerConfig.mediaOverlayColor.highlightColor().hexString(false))""

        // Inject CSS
        let jsFilePath = Bundle.frameworkBundle().path(forResource: "Bridge", ofType: "js")
        let cssFilePath = Bundle.frameworkBundle().path(forResource: "Style", ofType: "css")
        let cssTag = "<link rel="stylesheet" type="text/css" href="(cssFilePath!)">"
        let jsTag = "<script type="text/javascript" src="(jsFilePath!)"></script>" +
        "<script type="text/javascript">setMediaOverlayStyleColors((mediaOverlayStyleColors))</script>"

        let toInject = "\n(cssTag)\n(jsTag)\n"

This will solve your problem.

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

4 participants