UIWebView deprecation

Welcome! Forums Unity Plugins In-App Web Browser UIWebView deprecation

Viewing 15 posts - 1 through 15 (of 39 total)
  • Author
    Posts
  • #1647
    wiksy
    Participant

    iOS App Store is going to stop accepting apps that use UIWebView soon, but I saw this plugin still relies on it.

    ITMS-90809: Deprecated API Usage – Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

    Is there a way to remove this dependency or upgrade to WKWebView?

    #1648
    PiotrPiotr
    Keymaster

    Of course, I prepared new version with WKWebView.

    Would you like to test it out and let me know if you see any regression?

    Here are instructions:
    1. Remove plugin files from /Plugins/iOS directory*,
    2. Download http://kokosoft.eu/beta/InAppWebBrowser206.a
    3. Place it into /Plugins/iOS directory
    4. Rebuild iOS project
    5. Test it out and let me know about results ?

    * These files:
    InAppBrowserViewController.h
    InAppBrowserViewController.mm
    iOSInAppBrowser.mm
    OrientationNavigationViewController.h
    OrientationNavigationViewController.m

    #1649
    wiksy
    Participant

    Hi,

    I tried this new library. It works, but it seems that somehow all texts are rendered twice with an offset, making them hard to read.

    #1650
    PiotrPiotr
    Keymaster

    Thanks for getting back with feedback. Could you post screenshot of this issue?

    #1660
    tpitman
    Participant

    Any word on when this might be fully tested and released?

    #1661
    tpitman
    Participant

    I followed your instructions to download the .a file and remove the other files. It builds fine, but when I run it I get an exception.

    I am using javascript interaction. Do I have to change any of that for it to work?

    #1662
    tpitman
    Participant

    Not sure this will be much help, but here is the top part of the exception stack:

    
    	0   CoreFoundation                      0x000000019c65ead0 <redacted> + 256
    	1   libobjc.A.dylib                     0x000000019b863d00 objc_exception_throw + 60
    	2   CoreFoundation                      0x000000019c57c4d4 <redacted> + 0
    	3   CoreFoundation                      0x000000019c664464 <redacted> + 1412
    	4   CoreFoundation                      0x000000019c666260 _CF_forwarding_prep_0 + 96
    	5   espresso                            0x0000000102d58978 +[InAppBrowserConfig(DisplayOptionsStruct) fromDisplayOptions:] + 356
    	6   espresso                            0x0000000102d54c6c _ShowURLWithDisplayOptions + 120
    	7   espresso                            0x0000000102d54e74 _OpenInAppBrowser + 104
    	8   espresso                            0x0000000102d686b4 iOSInAppBrowser__OpenInAppBrowser_mC93248E1F49443BED3C3D03A7C55783E7EAFE0C4 + 108
    	9   espresso                            0x0000000102d67064 CliveWebBrowserScript_Awake_mC890CB4E232C63AD0AA251991D4ECD40F2EEB86A + 132
    	10  espresso                            0x000000010240ae50
    
    #1663
    alienheretic
    Participant

    I also have this issue and client is pressing me for a fix can you please advise using unity 2019.2.4.f1

    #1666
    PiotrPiotr
    Keymaster

    JavaScript communication has changed, as explained in this thread

    • This reply was modified 4 years, 5 months ago by PiotrPiotr.
    #1668
    PiotrPiotr
    Keymaster

    How do you open InAppBrowser? Could you post code you are using?

    #1669
    alienheretic
    Participant

    public class BrowserOpener : MonoBehaviour
    {

    public string pageToOpen = “http://www.google.com&#8221;;

    // check readme file to find out how to change title, colors etc.
    public void OnButtonClicked()
    {
    InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions();
    options.displayURLAsPageTitle = false;
    options.pageTitle = “InAppBrowser example”;

    InAppBrowser.OpenURL(pageToOpen, options);
    }

    public void OnClearCacheClicked()
    {
    InAppBrowser.ClearCache();
    }
    }

    #1670
    tpitman
    Participant

    I am confused about the new communication mechanism. I start typing webkit and it isn’t defined.

    Here is some of my code:

    
    	private void Start ()
    	{
    		InAppBrowser.ClearCache ();
    		InAppBrowserBridge bridge = FindObjectOfType<InAppBrowserBridge> ();
    		bridge.onJSCallback.AddListener (OnMessageFromJS);
    		bridge.onBrowserStartedLoading.AddListener (OnBrowserStartedLoading);
    	}
    
    	private void Awake ()
    	{
    		InAppBrowser.DisplayOptions options = new InAppBrowser.DisplayOptions ();
    		options.displayURLAsPageTitle = false;
    		options.pageTitle = "My App";
    		options.hidesTopBar = true;
    
    		InAppBrowser.OpenURL ("https://myapp.com", options);
    	}
    

    Here is a place where I send some Json to the browser javascript:

    InAppBrowser.ExecuteJS("$nuxt.messageFromUnity('{\"success\": \"" + success + "\"}');");

    #1672
    PiotrPiotr
    Keymaster

    Could you give some details what’s exactly not working?
    i.e. is browser not opening? is communication not working? what’s $nuxt.messageFromUnity?

    #1673
    tpitman
    Participant

    I am the one who posted that the app crashes on iOS. I gave the crash stack in case that would give some idea of what is going on.

    With a crash that means I don’t get anywhere with it.

    The string I gave you is just what the web page is expecting to process in JavaScript. As far as your plugin goes I think it should just be passing that along to the web page JavaScript.

    • This reply was modified 4 years, 5 months ago by tpitman.
    #1676
    PiotrPiotr
    Keymaster

    Is sample scene working for you? Have you tried to re-generate xcode project?

Viewing 15 posts - 1 through 15 (of 39 total)
  • You must be logged in to reply to this topic.