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

Can't open URL which includes a intent fb:// #1130

Closed
Ebony44 opened this issue Jan 17, 2025 · 4 comments
Closed

Can't open URL which includes a intent fb:// #1130

Ebony44 opened this issue Jan 17, 2025 · 4 comments

Comments

@Ebony44
Copy link

Ebony44 commented Jan 17, 2025

Hello there, I've searched issues that similar to mine. there is works already, #1126 this one.
So, I tried that recent update with sample project, and still it's not working. I have a issue with facebook URL.
The URL I am trying to open is https://www.facebook.com/MingPlayFanPage

Here are error messages and my trying and fidgeting. I hope these struggles help to figure this issue out...

unity-webview/plugins/Android/webview/src/main/java/net/gree/unitywebview/CWebViewPlugin.java

  1. error logs which log inside of catch (ActivityNotFoundException ex), line 750-751(I inserted some log codes manually)

2025-01-17 10:26:00.638 26831 26857 Error Unity
2025-01-17 10:26:00.638 26831 26857 Error Unity [AndroidLog], call from android java [shouldOverrideUrlLoading], inside of catch, ActivityNotFoundException exception is android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=fb://profile/61570822670084?wtsid=wt_0mHOMltRu7y07Yq5z pkg=com.facebook.katana (has extras) }
2025-01-17 10:26:00.638 26831 26857 Error Unity UnityEngine.Logger:Log(LogType, Object)
2025-01-17 10:26:00.638 26831 26857 Error Unity

  1. Image when I trying to open URL
    Image

I wonder, If I cant open it with fallback url inside of intent, should I open it with User's explorer outside of my app?

@KojiNakamaru
Copy link
Member

I introduced #1131 to open Google Play if startActivity fails. This works well at least for the following cases. Could you please try the latest.

<p><a href="intent://example.com/path?query=123#Intent;scheme=https;package=com.example.browser;end">intent1</a></p>
<p><a href="intent://maps.google.com/maps?q=Tokyo+Tower&z=15#Intent;scheme=https;package=com.google.android.apps.maps;end">intent2</a></p>

@Ebony44
Copy link
Author

Ebony44 commented Jan 20, 2025

It works..kind of... now I have a problem with webview's screen size and blackened out, could you give any advices?

Image

Reproduce step

  1. Clone repo
  2. Import /dist/unity-webview.unitypackage
  3. Scene Sample, gameobject SampleWebView, in inspector, change url into https://www.facebook.com/@MingPlayFanPage/?hr=1
  4. Build and check what Webview shows...

@KojiNakamaru
Copy link
Member

You can adjust the screen orientation to open the app in portrait mode.

Image

@Ebony44
Copy link
Author

Ebony44 commented Jan 20, 2025

You can adjust the screen orientation to open the app in portrait mode.
Image

Gosh, I'm sorry to overlook such a basic thing. It works well. I appreciate your quick response!

@Ebony44 Ebony44 closed this as completed Jan 20, 2025
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

2 participants