Last month we delivered the Gold release of the BlackBerry 10 WebWorks SDK to our development community. This was a huge milestone on the road to launch for BlackBerry 10, allowing our developers to confidently develop, test, and submit their WebWorks applications to BlackBerry World, and to take part in the Built for BlackBerry program. I am sure all of you have already submitted your apps and are now relaxing by the pool. ;)
Today we are launching a refresh to the WebWorks SDK that brings a number of fixes that, while not required for your application to run on BlackBerry 10, bring a few tweaks and stability improvements. There are two very specific updates addressing some underlying platform changes that COULD mean you will want to repackage an existing application. Let’s look at those first.
The concept of Cards in BlackBerry 10 is what really enables the Peek and Flow experience. There are many built-in cards that developers are able to leverage to complete common tasks or integrate with system services, and WebWorks has provided built-in APIs for some of these system cards. One of them is the File picker (blackberry.invoke.card.invokeFilePicker). In the gold release, you could provide a list of directories in the FilePickerOptions object, and the standard UI would present a selection list of those folders. This ability was removed from the standard UI. The API has not changed, but we only now look at and use the first entry in the array to seed the UI. So as long as you were not relying on this multi-directory functionality, or if you don’t mind that only the first is considered, then you have no need to repackage your application.
Another update relates to how Contacts are created, or more specifically, what happens when you save a newly created contact using the blackberry.pim.contacts API. In the Gold SDK, when you save a contact that you create using blackberry.pim.contacts.create(), it will always create a new entry in the device address book. The underlying native implementation changed slightly and will now attempt to merge it with an existing relevant contact entry if it finds one. If you are fine with this behavior, or if it is desirable, then you need to do nothing if you have already packaged with the Gold SDK. Otherwise, in order to preserve the behavior of creating a new contact, you will need to repackage with this latest WebWorks SDK refresh.
That’s it for compatibility concerns – not so bad. There is one other thing though that you will notice with the latest Dev Alpha update. If you are using the blackberry.invoke.card.invokeEmailComposer API, clicking the Send button actually does nothing. This has already been fixed on the native platform and will work at launch. You have no need to repackage your app, either now or later, as the fix is entirely on the device, but just something to be aware of if you use this API and are testing it on the latest Dev Alpha build.
Finally, let’s turn to a couple of the polish items that we have in this refresh. As most of you are probably aware, BlackBerry Balance allows the user to segment their device into multiple perimeters to separate work and personal. The enterprise perimeter can be locked if a password is enabled, and when locked, apps are “locked” as well. In order for you as the developer to know what the current state is, we have introduced events that you can listen for that will tell you when the perimeter locks while your application is open. Check out blackberry.system.perimeterlocked/perimeterunlocked.
We have also expanded the Contacts API to include the Accounts information for that contact. Check out the new field blackberry.pim.contacts.contact.sourceAccounts.
We recently added the ChildBrowser concept to WebWorks that allows you to support target=”_blank” and window.open in your web content. We also allowed you to disable it. With this release, if you disable the ChildBrowser and use target=”_blank” or window.open to display non-whitelisted content, the result will be opened in the system browser, rather than the user being presented with an access denied dialog.
Context menus and custom contexts have also seen a couple of improvements. When you add your own menu item to the context menu, the callback that is invoked when the menu item is clicked will be passed the id of the content element that the user long-pressed on. You can also now override existing menu items through the blackberry.ui.contextmenu.additem method. Just provide the platform action id in the additem call and you can provide your own text, image, and functionality for things like Copy, paste, and so on.
As you can see, unless you use one or two specific items, applications you have already packaged and built are still good to go. But if you do use the contacts API and wish to always create new items as oppose to merge, or if you used the file picker in a specific mode, you will want to repackage and resubmit your applications to BlackBerry World. And be sure to get your applications approved for sale prior to January 21st, and take advantage of the Built for BlackBerry program. Download the gold refresh of WebWorks today to polish up your applications before launch of BlackBerry 10!