nhn / gpm.unity

A brand of NHN providing free services required for game development.

Home Page:https://gameplatform.nhncloud.com/en/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FullScreen WebView is cropped in new iPhone models

stanleychy opened this issue · comments

Service

  • WebView
  • AssetManagement
  • Communicator
  • LogViewer
  • Manager
  • UI
  • Profiler
  • Adapter
  • DLST

Version

GPM 2.2.1
WebView 1.9.2

Describe the bug

  1. When opening WebView in landscape mode, the bottom part is cropped by iPhone's home bar, but will appear after rotation
  2. When opening WebView in portrait mode, the top part covered by iPhone's notch is cropped, but will appear when scrolling down

To Reproduce

Steps to reproduce the behavior:

  1. Open Sample scene from WebView
  2. Put iPhone in landscape mode, allow device's auto-rotate
  3. Press Open WebView button
  4. Observe the bottom part of the WebView is cropped out
  5. Rotate the screen to portrait mode and back to landscape mode
  6. Observe the bottom part is not cropped and filling the whole screen

Steps to reproduce the behavior:

  1. Open Sample scene from WebView
  2. Put iPhone in potrait mode
  3. Press Open WebView button
  4. Observe the top part of the WebView is cropped out
  5. Scroll down a little bit and observe the top part is filled
  6. Scroll up to the top and the top part is cropped again

Expected behavior

FullScreen WebView should fill the whole screen all the time

Screenshots

RPReplay_Final1668038153.MP4
RPReplay_Final1668037191.MP4

Environment

Unity

  • Version 2019.4.33f1

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro
  • OS: iOS 16.0

Additional context

Add any other context about the problem here.

Hi @taehyeon-nhn may I ask for an expected timeline when this will be fixed?

@HKerStanley
Hello
In the meantime, the person in charge has been busy with other work, and it seems difficult to confirm today due to attending NHN FORWARAD 2022.
I'll have the person in charge respond to you sometime tomorrow.
Thank you

Hello. @HKerStanley.

I will check the fix contents and leave a comment next week.

Thank you.

Thanks @taehyeon-nhn May I have an estimation on when will it be fixed?

Hello. @HKerStanley.

If it is fixed without any issues, the revision will be updated on December 9th.

Thank you.

Hi @taehyeon-nhn
I woukd like to add more details to the issue.
In certain device resolution when webpage content is cut off in webview in landscape mode, for example some text or link, even if we scroll down, these element will not be shown properly and break UI/UX.
Will this also be addressed in the coming fix?

For your reference (Captured from iPhone 11, iOS 15.6
image

Hello. @HKerStanley.

Could you please provide us with the code about the WebView configuration settings?
And is there a link that we can test?

Thank you.

Hello. @HKerStanley.

GPM WebView v1.10.0 released.
Please refer to ReleaseNotes.
Update GPM WebView and rebuild your projects.

Thank you.

Thanks @taehyeon-nhn
Sorry I am not permitted to share the website or our code with your team. I have updated the plugin in my project and the webpage is now displayed well.
However there are new issues as we are using a custom login webpage for authentication and there is a login button to activate deeplink to the game
After the update clicking the login button will not activate the deeplink and I found error logs in XCode as below:

[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>

[ProcessSuspension] 0x13a004420 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=24985, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}

[assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>

[ProcessSuspension] 0x13a004480 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Suspended Assertion' for process with PID=24985, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}

[assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>

[ProcessSuspension] 0x13a0044e0 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=24984, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}

[assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>

[ProcessSuspension] 0x13a004540 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Suspended Assertion' for process with PID=24984, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

This might be the reason why the deeplink is not activated, seems there is parsing error. But the provided Url and custom scheme are not changed after the update.
Logs attached for your reference

[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://<LOGIN_WEBPAGE_URL>/<CUSTOME_SCHEME>:/authoriselogin

[ProcessSwapping] 0x13c000c30 - [pageProxyID=6, webPageID=24, PID=25586, navigationID=2] ProvisionalPageProxy::didFailProvisionalLoadForFrame: frameID=3

[Process] 0x1053a6018 - [pageProxyID=6, webPageID=7, PID=25578] WebPageProxy::didFailProvisionalLoadForFrame: frameID=3, domain=WebKitErrorDomain, code=102, isMainFrame=1

[GPM][WebView][iOS][GPMWebViewController.m:(1047)] Error occurred while loading content. Error Domain=WebKitErrorDomain Code=102 "Frame load interrupted" UserInfo={_WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x283f27220>, NSErrorFailingURLStringKey=https://<LOGIN_WEBPAGE_URL>/<CUSTOME_SCHEME>:/authoriselogin, NSErrorFailingURLKey=https://<LOGIN_WEBPAGE_URL>/<CUSTOME_SCHEME>:/authoriselogin, NSLocalizedDescription=Frame load interrupted}

Hello. @HKerStanley.

RBSAssertionErrorDomain related errors need to be checked a more.

For a Custom scheme error, the passed URL is displayed as https://<LOGIN_WEBPAGE_URL>/<CUSTOME_SCHEME>:/authoriselogin.
Please check the redirection URL.

The scheme checks from the beginning of the forwarded URL.
e.g. https://www.google.com or itms-apps://itunes.app.com
custom scheme : https or itms-apps

Thank you.

Thanks for the update @taehyeon-nhn
May I know what are the changes in custom scheme logic?
From our side we did not change anything but working perfectly before the update, and we never have to set "https" in the custom scheme list

Hello. @HKerStanley.

There are no changes to the custom scheme logic.
The location of receiving the custom scheme from the Sample.scene has been changed from Unity Editor Inspector to Scene InputField.

Thank you.

Hi @taehyeon-nhn
I am hardcoding my custom scheme to the configuration so the sample scene should not affect my behavior.
By comparing before and after the upgrade, it seems that the GPM communicator is not able to trigger the CallAsync function in the newer version, so the deeplink cannot be activated, any advice?

Hello. @HKerStanley.

We need a more detailed explanation of what it means that the CallAsync function is not triggered.
GpmWebView.ShowUrl uses GpmCommunicator.CallAsync.

Thank you.

Hi @taehyeon-nhn
So I understand ShowUrl will trigger the [Open] callback type and the close button can trigger the [Close] callback type, but I am not seeing any callback type [PageLoad] from the log

Sorry, to correct I do get some [PageLoad] event, but it only happens to some of the page load, for example clicking button on the webpage will not trigger [PageLoad] event

Hello. @HKerStanley.

We will check the logic related to page loading in iOS and contact you again.
If you have any additional information, please let us know anytime.

Thank you.

Thank you @taehyeon-nhn
Is it possible that the button click event is routed to/blocked/affected by the new [ExecuteJavascript] callback type?
But I should still see log printed from OnAsyncEvent ?

We will check including [ExecuteJavascript].

Thank you.

Hi @taehyeon-nhn
This is the last few lines of log after I click the login button on my webpage, as you can see there are a sequence of "Try to open URL" call, but there are no [PageLoad] event following.
May I know how the webview trigger a callback event?
Is there any filtering or conditional logic that prevent a callback event send to the Communicator?
P.s. Sorry I removed the full url from the log for confidential reason

🐞[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://
🐞[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://
🐞[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://
🐞[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://
🐞[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://
🐞[GPM][WebView][iOS][GPMWebViewController.m:(896)] Try to open URL (iOS 13) : https://
[ProcessSwapping] 0x13f001620 - [pageProxyID=6, webPageID=24, PID=47461, navigationID=2] ProvisionalPageProxy::didFailProvisionalLoadForFrame: frameID=3
[Process] 0x107140018 - [pageProxyID=6, webPageID=7, PID=47453] WebPageProxy::didFailProvisionalLoadForFrame: frameID=3, domain=WebKitErrorDomain, code=102, isMainFrame=1
⚠️[GPM][WebView][iOS][GPMWebViewController.m:(1047)] Error occurred while loading content. Error Domain=WebKitErrorDomain Code=102 "Frame load interrupted" UserInfo={_WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x2813d1180>, NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, NSLocalizedDescription=Frame load interrupted}

Hello. @HKerStanley.

Not found issues in the logic related to [PageLoad], [ExecuteJavaScript].

[PageLoad] is triggered inside the webView:didFinishNavigation method.
[ExecuteJavaScript] runs evaluateJavaScript and runs a [completionHandler] callback.

Try the following:

List<string> CustomSchemeList = new List<string> { "CustomScheme1", "CustomScheme2" };
GpmWebView.ShowUrl("Your URL", Your Configuration, OnWebViewCallback, CustomSchemeList);

private void OnWebViewCallback(GpmWebViewCallback.CallbackType callbackType, string data, GpmWebViewError error)
{
    switch (callbackType)
    {
        case GpmWebViewCallback.CallbackType.Scheme:
            {
                if (data.StartsWith("CustomScheme1"))
                {
                    // Custom scheme 1 logic
                }
                else if (data.StartsWith("CustomScheme2"))
                {
                    // Custom scheme 2 logic
                }
            }
            break;
    }
}

Thank you.

Thanks for the update @taehyeon-nhn
I tried and found that custom scheme cannot be recognised in the middle of the full Url.
For example if I have my Url as https://my.login.com/iam/mysdk:/auth?code=AuthCode

This will not trigger any callback event

List<string> CustomSchemeList = new List<string> { "mysdk"}

But if I set it like this, I can see [Scheme] callback event

List<string> CustomSchemeList = new List<string> { "http://my.login.com/iam/mysdk" 

This is different to the previous behavior and not ideal

Hello. @HKerStanley.

The Custom scheme logic checks each NSString with a hasPrefix.
There are no changes to this part.

Thank you.