Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
ryanruttan
Posts: 9
Registered: ‎09-01-2012
My Carrier: Telus
Accepted Solution

BB10 Dev Alpha Bezel Swipe

I am not able to get the top bezel swipe action to register on the Dev Alpha for any of my apps.  I have tried everything that I have found on these boards and on github.

 

I tried the sample WebWorks project swipemenu.js at https://github.com/blackberry/WebWorks-Samples/tree/master/swipemenu. I packaged the sample app to the Dev Alpha and I cannot get the bezel swipe to work.  I can click on the button and that triggers the javascript to show the menu, but that's not really a bezel swipe.

 

I have added the BB10 the <feature id="blackberry.app" /> tag to my config file. I placed the following in my apps <head> section (found here - https://developer.blackberry.com/html5/apis/blackberry.app.html#.event:swipedown).

 

<script type="text/javascript">

function onSwipedown() {
alert("Swipe down event occurred.");
}

blackberry.event.addEventListener("swipedown", onSwipedown);

</script>

 

But I never see the alert, now matter how I try the top bezel swipe.

 

I am also placing the WebWorks javascript file (webworks-1.0.2.9.js) in my app.

 

I am not using the BBUI.js for this app as it causes too many conflicts at this time. Is there someone who has got the top bezel swipe to work in a BB10 WebWorks app on a Dev Alpha device.

 

OS Version: 10.0.9.338

BlackBerry 10 WebWorks SDK 1.0.2.9

 

Please use plain text.
BlackBerry Development Advisor
Nukul
Posts: 115
Registered: ‎06-06-2011
My Carrier: Rogers

Re: BB10 Dev Alpha Bezel Swipe

you need to wait for the webworks ready event and then register.

 

https://developer.blackberry.com/html5/documentation/creating_a_bb10_app_2007539_11.html

 

 <script>
      function ready() {
        //register for swipe down here
      }
      window.addEventListener("load", function(e) {
         document.addEventListener("webworksready", ready);
      }, false);
 
 
   </script>
@nukulb
Please use plain text.