locked
Xamarin forms: ITMS-90809: Deprecated API Usage, but no webview in my project RRS feed

  • Question

  • User351573 posted

    Yesterday I have pushed a new app to AppStore, but it gets rejected with the following error.

    ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

    In my knowledge, this issue usually occurs due to the use of Webview. I have one Webview in my project, so I decided to remove it (Since that part is currently not using in the project). I have pushed the app again to AppStore after removing the Webview, but again my app gets rejected with the same error. After that I do a clean, rebuild, and deleted the bin, obj folders. 2 times my app gets rejected from Appstore after removing Webview.

    See the below screenshot: No Webviews are available for the entire solution.

    enter image description here

    Are there any other reasons for this error? Please help, this is very emergency.

    Tuesday, July 14, 2020 5:13 AM

Answers

  • User3516 posted

    Add this as additional mtouch arguments in your ios Build properties:

    --optimize=force-rejected-types-removal --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, July 14, 2020 5:27 AM
  • User369979 posted

    Have you read this documentation: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows#uiwebview-deprecation-and-app-store-rejection-itms-90809 Which version of Xamarin Forms are you using? Make sure Xamarin.Forms is 4.5 or higher and Xamarin.iOS is 13.10.0.17 or higher. Change the Linker Behavior to SDK Only or Link All and then add the additional arguments: --optimize=experimental-xforms-product-type Please check all of these have been set under the release configuration and iPhone platform. Moreover, this blog is also very helpful: https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, July 14, 2020 6:16 AM

All replies

  • User3516 posted

    Add this as additional mtouch arguments in your ios Build properties:

    --optimize=force-rejected-types-removal --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, July 14, 2020 5:27 AM
  • User351573 posted

    @DirkWilhelm I didn't get you completely.

    I have opened the iOS app properties and added the code you have suggested under the iOS Build tab.

    Screenshot: Is it correct?

    Tuesday, July 14, 2020 6:11 AM
  • User369979 posted

    Have you read this documentation: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows#uiwebview-deprecation-and-app-store-rejection-itms-90809 Which version of Xamarin Forms are you using? Make sure Xamarin.Forms is 4.5 or higher and Xamarin.iOS is 13.10.0.17 or higher. Change the Linker Behavior to SDK Only or Link All and then add the additional arguments: --optimize=experimental-xforms-product-type Please check all of these have been set under the release configuration and iPhone platform. Moreover, this blog is also very helpful: https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, July 14, 2020 6:16 AM
  • User3516 posted

    @Sreeee said: @DirkWilhelm I didn't get you completely.

    I have opened the iOS app properties and added the code you have suggested under the iOS Build tab.

    Screenshot: Is it correct?

    You added it to the "Debug" build configuration, so these parameters will be used when you are debugging your app. You will need to add the parameters to the build configuration you are using when you are building your app for release.

    Tuesday, July 14, 2020 6:26 AM
  • User351573 posted

    @DirkWilhelm and @LandLu

    My XF version is 4.6.0.726 and Visual Studio for Mac version is 8.6.4 (Xamarin iOS version: 13.18.2.1)

    And I have modified the iOS build properties under release mode like below screenshot:

    So everything is set now, Should I push the app again to Appstore?

    Tuesday, July 14, 2020 6:42 AM
  • User369979 posted

    Yes, you could have a try to archive your project. One more thing is that make sure all the packages you referenced(including some third-party libraries) have removed UIWebView too.

    Tuesday, July 14, 2020 6:54 AM
  • User351573 posted

    @DirkWilhelm and @LandLu

    Thank you very much, my app is accepted by the AppStore.

    One last question: If I need to use webview in my project, I need to add custom webview renderer, right?

    Tuesday, July 14, 2020 7:17 AM
  • User369979 posted

    No, it doesn't. The default webview has rendered to WKWebView on iOS if you are using xamarin forms 4.5 or higher.

    Tuesday, July 14, 2020 7:20 AM
  • User351573 posted

    @LandLu and @DirkWilhelm

    1. So how we can use webview in projects? I need to mirror a website on the app. I am using a webview for that type of requirement.
    2. Also, the app completed processing and I have installed it on a real device using test flight. But I can't log in to the app, I found that Linker behavior is the Cause. So I changed linker behavior to SDK only. Now I am able to log in, is there any issue if I use SDK only as the linker behavior?
    Tuesday, July 14, 2020 8:58 AM
  • User369979 posted

    For 1, Make sure you have used the latest version of Xamarin Forms. The default webview could be used. For 2, SDK Only can make it the same as Link All.

    Tuesday, July 14, 2020 9:33 AM