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

latest ion-icons not working with ionic5 on uiwebview and wkwebview #831

Closed
rashmendis opened this issue May 14, 2020 · 19 comments
Closed
Labels
needs: reply Issues that need more information from the author

Comments

@rashmendis
Copy link

rashmendis commented May 14, 2020

I was working on a latest ionic project and tried to get these icons to work but there was no luck. Then I tried the sample ionic app which is getting generated with the cli which has the ion-menu with ion icons. Those are working on the iPad browser but not inside the Webview. Tried the old ionicon:4.6.3 and that works fine.

Screenshot 2020-05-14 at 20 13 26

Environment:
Angular 9.0.6
Ionic 5

@himanshuarya
Copy link

I can also confirm this issue. In my case, the icons appear the first time but when I force close the Ionic app and open the app again, they disappear because the SVG does not load in the Shadow Content as shown in the screenshot by @rashmendis

@rashmendis
Copy link
Author

rashmendis commented Jun 15, 2020 via email

@himanshuarya
Copy link

Another observation is that even on using a custom SVG, the SVG does not load the second time on force closing the app.

@rashmendis
Copy link
Author

rashmendis commented Jun 15, 2020 via email

@lhaiscapyba
Copy link

Same issues for me

@jdpsbh
Copy link

jdpsbh commented Jul 16, 2020

Same here. Not only with UIWebview, also with WKWebview.

@jdpsbh
Copy link

jdpsbh commented Jul 19, 2020

@rashmendis how did you used the old ionicon:4.6.3? Did you uninstall the 5.x and install the 4.x?

@rashmendis
Copy link
Author

rashmendis commented Jul 19, 2020 via email

@himanshuarya
Copy link

@brandyscarney is anyone from the Ionic team looking into any of the ion-icon issues? It looks like none of the ion-icon issues haven't been assigned, triaged, or being investigated upon. This issue is one of the major issues in Ion-icon v5 which comes along bundled with Ionic 5. This is a blocker issue that is preventing us to upgrade from Ionic 4 to Ionic 5. Can you please get this issue resolved?

@bensperry
Copy link
Contributor

Hey @himanshuarya, we hear you. Can you share more information on the issue you're seeing (code sample, screenshots)?

@himanshuarya
Copy link

himanshuarya commented Oct 8, 2020

@rashmendis Would you be able to share the code of the sample ionic app in which you were able to reproduce this issue?
@bensperry - @rashmendis had shared a DOM screenshot where there is no content in the icon-inner div in the Shadow Content. Please refer to that screenshot in the first comment.

@rashmendis
Copy link
Author

@bensperry Just do a ionic start myApp tabs and create an app with ion-icons. Then have to build the app and run it inside a uiwebview or wkwebview in iPad or an Apple device.

@bensperry
Copy link
Contributor

Hey @rashmendis, this is frustrating. We are unable to reproduce the issue on our end.

Basically, we need more info. What are you using to deploy the app—are you using Capacitor or Cordova? Please share the exact steps for us to follow and be as specific as possible. This will greatly help us nail down exactly what might be going wrong more quickly.

@rashmendis
Copy link
Author

@bensperry Not using both Capacitor or Cordova. What you have to do is create a tab app using ionic start myApp tabs. Then you need to build the app using ionic build --prod. Then You have to create a iOS app with a UIWebView or WKWebView and load the ionic app which we build earlier. App is working directly on iPad Safari app without any issues but not working inside the UIWebView or WKWebView. I was testing it inside a Commercial iOS app so won't be able to share the code. But as you can see in the comments it's a common issue when we run the ionic5 app inside a iOS WebView.

@liamdebeasi
Copy link
Contributor

Thanks for the issue. So just using WKWebView or UIWebView is not going to be sufficient to get Ionicons loading. The reason is that when an icon SVG is loaded, it is treated as a local file, and WKWebView has some limitations referencing local files by itself.

The best solution here is to use a small local server to serve the files. The easiest way to do this is to use Capacitor. You can view our Getting Started Guide to quickly integrate Capacitor into your existing app.

Can you try your app with Capacitor and let me know if it resolves the issue?

@Sagar-rr
Copy link

Sagar-rr commented Jan 6, 2021

I was facing same issue. my issue was solved by changing path in angular.json file
Old path:
....
"assets": [
{
"glob": "/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "
/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
],
....

new path:
....
"assets": [
{
"glob": "/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "
/*.svg",
"input": "node_modules/ionicons/dist/svg",
"output": "./svg"
}
],
....

@fortesp
Copy link

fortesp commented Nov 15, 2021

Any news on this? <IonIcon .../> is not shown in WebView ...

@brandyscarney brandyscarney added the triage New issues label Sep 27, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the report and apologies for the delay. Does this issue still reproduce using the latest version of Ionicons? If so, is there a sample app I can try?

@liamdebeasi liamdebeasi added the needs: reply Issues that need more information from the author label Nov 8, 2022
@ionitron-bot ionitron-bot bot removed the triage New issues label Nov 8, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 22, 2022

Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionicons, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionicons!

@ionitron-bot ionitron-bot bot closed this as completed Nov 22, 2022
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: reply Issues that need more information from the author
Projects
None yet
Development

No branches or pull requests

9 participants