Retargeting your MobileFirst Windows Phone apps to 8.1

If you're developing Hybrid applications for Windows Phone, you might have noticed that Visual Studio allows you to retarget your apps to Windows Phone 8.1. If your using the Visual Studio 2013 Profession Edition (Update 2 or higher), you have the choice on whether your can retarget your app or not. However, if you are using the Express edition of Visual Studio, you will be forced to retarget your app.

If you are one of those who has retargeted your MobileFirst Windows Phone app, you might find that the app is stuck and does not proceed beyond the splash screen. Read on to understand why...

So, what happens when you retarget your app ?
Among other things, the underlying WebView control that runs your app's code is different - it is now Internet Explorer 11 engine instead of Internet Explorer 10.

There is a known incompatibility between jQuery and IE 11. Although this issue has been fixed in a later version of jQuery, the jQuery that is shipped with MobileFirst apps have this bug. Due to this bug and the fact that retargeted apps use IE 11, retargeted MobileFirst apps can appear to be non-responsive.

So, what is the solution ?
Here are some solutions to overcome this issue

  • Do not retarget - The simplest solution is not to retarget your app. This will keep your app compatible with both Windows Phone 8.0 and Windows Phone 8.1.
  • Use the IE 10 engine for your app - In the index.html page of your app, add this meta tag to ensure that the Windows Phone OS runs your app on a WebView running the IE 10 engine instead of IE 11.
    [code lang="javascript"]<meta http-equiv="X-UA-Compatible" content="IE=10">[/code]
  • Back-port the jQuery fix - Another option is to backport the fix to the jQuery bug into your MobileFirst application.

Have you encountered this issue when you retargeted your apps to Windows Phone 8.1 ? If you have any comments about this, feel free to write about it below.

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on May 02, 2016