- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to test my cordova app which has been built using Intel XDK for windows phone.
I am testing the app in windows phone 8.1 emulator, the backbutton event is not firing, instead it exits the app.
And I tried with some suggestions I read from internet to use winjs to capture backclick event which is not also working.
Please help me resolve this problem.
Code to capture backbutton:
document.addEventListener('backbutton', function(){
// Code to handle;
e.preventDefault();
}, false);
With WinJS:
window.WinJS.Application.onbackclick = function (e) {
// Code to handle
e.handled = true;
return true;
};
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sam, also, try including this script in the front of your app, there may be some issues related to the strict security model that Microsoft imposes on that webview > https://github.com/xmnboy/xdk-win8x-compat.js < this will also allow you to use alert() in your code for debugging on a real device.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sam Deepak,
I would recommend you to try building our one of the existing samples and watch the response of the back button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sam, also, try including this script in the front of your app, there may be some issues related to the strict security model that Microsoft imposes on that webview > https://github.com/xmnboy/xdk-win8x-compat.js < this will also allow you to use alert() in your code for debugging on a real device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Paul,
Thanks. It worked. Here is what I can summarize.
Basically in my previous question, you have referred to a plugin from MSOPENTECH (winstore-jscompat,) which made javascript plugins work. But backbutton was still the issue I was facing. Then, I came to know that backbutton event from cordova has been ignored in windows phone 8.1 runtime and it delivers the hardware backbutton event to a Microsoft javascript library called WinJS. So I used it, but still was the issue unresolved. Now after referring the plugin you have referred in your reply (https://github.com/xmnboy/xdk-win8x-compat.js) which is once again customized and corrected by Intel XDK team (this is what I read there in this link), the backclick event works.
So the solution is to refer xdk-win8x-compat.js before all scripts. And backclick event is fired only in conjuction with this library. So for windows phone build, it is required to add this library before the script that starts the app. And for backbutton event in windows phone, it is required to add the base library from WinJS, i.e., you can see in the attached zip which is what I used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please help me I can not publish my app for windows phone 8.1 , I have tried everything ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Pablo,
Could you please summarize what did not work.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page