Windows Phone Support

Good article about Windows Phone and Ionic:


(fix scroll and font problems)

“ng-click event fire twice” - in my application event fire twice on buttons and select.
Resolution?
if (ionic.Platform.isWindowsPhone())
{
$(‘button’).attr(‘data-tap-disabled’, true);
$(‘select’).attr(‘data-tap-disabled’, true);
}

jQuery is not required but helps.

9 Likes

@karbon
i wish i had 10 star button to rate your reply… thanks for such a knowledgeable post

+1 for WP support. Let’s get this show on the road.

+1 I would love to have this for my enterpize app.

happy to put some resources behind this if we could get it onto the release roadmap. Win-win?

Btw we also have a range of windows devices to test on!

hey @harshitgoel96, did you use the cordova template project or have you done any special tweaking?

It would be so great to have ionic on WP!

To make it easier to track a fix, I created this as an issue to bug: ng-click handlers called twice on IE · Issue #2885 · ionic-team/ionic-framework · GitHub .

If one wants a global workaround in an app that doesn’t otherwise need pointer events, code like this seems to do the trick:

window.addEventListener('click', function(event) {
  if (Object.prototype.toString.call(event) == '[object PointerEvent]') {
    event.stopPropagation();
  }
}
, true);

Any updates on windows phone support?

Hey guys, just a heads up I have had Ionic working fine on Windows Phone for a while now. Checkout my game NumberTap http://numbertap.com/ to see it in action.

Happy to help out anyone experiencing issues with it.

what did you have to pay attention to run on windows phone?

Whatever support effort the Ionic team makes for WP compatibility should take into account the upcoming Spartan browser. I seriously hope it will make the team’s job easier. Fingers crossed!

1 Like

A bit of further info for those looking for support Windows Phone.
There are 2 ways to run Cordova on Windows Phone which have slightly different implications.

  1. Windows Phone 8.0 - This solution compiles into a Silverlight project with an embeded webview. A few things to think about when working with this kind of project.
  • This will give you greater device support (Runs on Windows Phone 8.0)
  • Performance is not as good as below.
  • Less debug support within Visual Studio
  • Seems to be less reliable with versions of IE depending on OS versions
  1. Windows Phone 8.1 (or Universal) - This is a native javascript project as supported by the Windows Runtime (Windows 8.1 and Windows Phone 8.1)
  • Less device support (only Windows Phone 8.1, though the update numbers are pretty good now)
  • Much better performance than above
  • 100% support between Windows Store and Windows Phone
  • Upgrade path to Windows 10 will be a lot easier
  • Can debug within Visual Studio with full javascript inspection, breakpoints, DOM Explorer, etc.

Depending on how you generate your Windows Phone project with cordova determines which solution you get. With the current tools adding the wp8 platform will get you the silverlight project but adding the windows platform will give you the native javascript solution with projects for Windows Store and Windows Phone in a universal solution.

Any update on the support for windows phone?

Do you think project Spartan will have an impact on how you do things?
I presume you’re waiting for it to come out in case it makes life a whole lot easier :wink:

As far as I’m aware, WP 8.1 Store apps don’t need a webview control. JS is a native language for store apps. Only the WP 8.1 Silverlight template uses an IE wrapper. So, if the concern is IE’s incompatibility with standards, this might not be a valid concern. I, of course, don’t know how much standards compatibility WinRT has, but Microsoft has made great improvements over the past few years, so I bet you Ionic could easily be made a great framework for the WP platform. Waiting for Spartan might not be a great idea as you won’t bother with a browser.

I recently wrote about my experiences with Ionic on Windows Phone at http://blog.vjrantal.net/2015/01/08/experiences-with-ionic-on-windows-phone-8-1/ .

I also run the unit and end to end tests inside an embeddable browser in a Windows Phone 8.1 Silverlight app. Results available respectively http://blog.vjrantal.net/wp-content/static/ionic-gulp-karma.html and http://blog.vjrantal.net/wp-content/static/ionic-gulp-snapshot.html .

In my opinion, even thought the results shouldn’t be read as “if green, works 100% sure”, they give an idea where there are still issues. Also, there might slight differences based on whether the app is run in IE browser versus Silverlight app versus Windows Runtime app.

If you are interested in running the tests yourself, see http://blog.vjrantal.net/2015/02/05/angularjs-automated-testing-on-windows-phone/ for details.

2 Likes

Hi!

I’m just started to work with ionic and i started it on high difficulty - Windows Phone as the primary target.
I also have a solution what works fine for me and what i shared as a comment on the github issue.

BTW I run it as native JS (Win8.1) and the performance seems pretty cool, just half of my code is IE hack :smile:

+1 for windowss phone. i can not wait anymore. :relaxed:

sorry for such a late reply. i used a blank ionic project and built my app,

you can checkout the github code here.

1 Like