Welcome! › Forums › Unity Plugins › In-App Web Browser › Android Soft Keys & PDF
- This topic has 14 replies, 4 voices, and was last updated 5 years, 3 months ago by
jaime@vector001.com.
-
AuthorPosts
-
February 1, 2018 at 4:27 pm #684
ArthurHucksake
ParticipantHI,
Just started using this plugin and have two questions:
1, Is it possible for this plugin to display a local PDF file? I get “Web page not available” when attempting to do this.
2, My Unity App runs full screen on android, but when the “In-App Web Browser” shows, the soft keys appear at the bottom. Is there a way to prevent these from appearing?
Kind regards,
Arthur
February 7, 2018 at 5:21 am #702Piotr
KeymasterHi,
ad 1) how exactly are you opening it? what code are you executing?
ad 2) is it happening on all websites?February 8, 2018 at 11:32 am #711ArthurHucksake
ParticipantHi Piotr,
1, I am trying to open it with the following code
`InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
options.displayURLAsPageTitle = false;
options.backButtonText = “<< Back”;
options.pageTitle = “”;
options.barBackgroundColor = “#A8B1B8”;
options.textColor = “#144B8C”;
options.browserBackgroundColor = “#A8B1B8”;
options.loadingIndicatorColor = “#144B8C”;
options.pinchAndZoomEnabled = true;
string FileLocation = Application.persistentDataPath + “/Temp/Temp.pdf”
InAppBrowser.OpenURL(FileLocation, options);`I know the file is created and exists because I can open it fine using:
Application.OpenURL(FileLocation);
2, Yes, it happens to me on all the websites I have tried.
If you have any suggestions, I would be more than happy to give them a try.
Kind regards,
Arthur
February 8, 2018 at 5:10 pm #712Piotr
KeymasterOh I see. Check “Loading local files” chapter (page 3) in Readme file. 🙂
February 9, 2018 at 5:04 pm #718ArthurHucksake
ParticipantHi Piotr,
Thanks for your reply, unfortunately my PDF files are created at runtime and therefore can only be saved into the “Application.persistentDataPath” as the “Application.streamingAssetsPath” is read only from what I believe.
Kinds regards,
Arthur
February 13, 2018 at 10:01 pm #731ArthurHucksake
ParticipantHi piotr,
Any news on this, is it possible to view a PDF created at runtime which is saved to the “Application.persistentDataPath” folder?
Kind regards,
Arthur
February 13, 2018 at 11:35 pm #735Piotr
KeymasterHi Arthur,
If I send you source code is it something you could take a look by yourself?
I am out for next 2 weeks and not able to do any research on this.February 14, 2018 at 4:05 pm #737ArthurHucksake
ParticipantHi Piotr,
That would be great, it would be a real bonus for me if I could get this working.
Mail it to arthur@ffs-solutions.com
Kind regards,
Arthur
February 15, 2018 at 10:41 am #740ArthurHucksake
ParticipantHi Piotr,
I have it working on IOS, this was a simple tweak to the “InAppBrowser.cs” file to prevent it from prefixing the “Application.streamingAssetsPath” to the supplied path in the appropriate function.
However, it would seem that this operation is carried out within the “InAppBrowser.jar” plugin when this function is called on Android. A modified “InAppBrowser.jar” which does not prefix the supplied file location with anything would most likely do the trick. So the source for the “In-AppBrowser.jar” should allow me to make the changes I require if you do not have the time to do this.
Kind regards,
Arthur
February 27, 2018 at 9:08 pm #786Piotr
KeymasterHi Arthur,
Sorry for late response. I’ve sent you an email with Android library. Let me know if it worked out for you.February 28, 2018 at 11:31 pm #788ArthurHucksake
ParticipantHi Piotr,
No problem, I have also been away 😉
Unfortunately I have not received the email of the Android library ;-(
Kind regards,
Arthur
March 2, 2018 at 5:33 pm #800Piotr
KeymasterPlease check your spam folder. Email’s title is “InAppBrowser Android sources”.
July 4, 2018 at 2:55 am #1129myutini
ParticipantHi Piotr,
I also need the Android soft keys hidden and and simply handle closing the browser by JS callback. How can I hide the Android soft keys?
July 17, 2018 at 8:36 pm #1140Piotr
KeymasterThis question is not related to plugin but Unity and Android-specific APIs.
October 31, 2019 at 12:34 pm #1811jaime@vector001.com
ParticipantHello,
For project needs I need to open local URLs in persistentDataPath. Could you solve it? As Arthur says, in Android it cannot be modified with “InAppBrowser.cs”.
Thank you. -
AuthorPosts
- You must be logged in to reply to this topic.