2

I need to find a way to open native map application from browser on Blackberry 10. My web application is working in pure plain browser, without using WebWorks.

I suppose it must be an URI scheme that should provide a simple way to perform this action. I already did this for iOS, Android and WP8. But Blackberry 10 device gives me a real pain.

Again, my web app works in browser on BB10 device.

kio21
  • 639
  • 1
  • 6
  • 23

4 Answers4

2

Since recently there is documentation on BlackBerry how to do that.

Extend 'bar-descriptor.xml' file with desired urischeme:

<invoke-target id="com.mycompany.myapplication">
<type>APPLICATION</type>

<filter>
  <action>bb.action.VIEW</action>
  <mime-type>*</mime-type>
  <property var="uris" value="activetext:"/>
</filter>

<invoke-target-pattern>      
  <pattern-value type="uri">activetext:</pattern-value>    
</invoke-target-pattern>

After that in application code (from BlackBerry documentation):

// File: service.cpp
#include "service.hpp"

#include <bb/Application>
#include <bb/platform/Notification>
#include <bb/platform/NotificationDefaultApplicationSettings>
#include <bb/system/InvokeManager>

using namespace bb::platform;
using namespace bb::system;

Service::Service() :
         QObject(),
         m_notify(new Notification(this)),
         m_invokeManager(new InvokeManager(this))
{
    // Whenever the app is invoked, call handleInvoke()
    m_invokeManager->connect(m_invokeManager,
        SIGNAL(invoked(const bb::system::InvokeRequest&)),
        this,
        SLOT(handleInvoke(const bb::system::InvokeRequest&)));

    // Configure app to allow notifications
    NotificationDefaultApplicationSettings settings;
    settings.setPreview(NotificationPriorityPolicy::Allow);
    settings.apply();

    // Set a common notification title
    m_notify->setTitle("Headless service");
}

void Service::handleInvoke(
                    const bb::system::InvokeRequest & request)
{
  // Check if timer trigger invoked the app
  if (request.action().compare("bb.action.VIEW") 
                               == 0) {
      m_notify->setBody("Timer alert!");
      Notification::clearEffectsForAll();
      Notification::deleteAllFromInbox();
      m_notify->notify();
      // Do necessary handling here.
      qDebug() << request.uri();

  }
}

BlackBerry Documentation

Vasiliy
  • 674
  • 6
  • 5
1

i have a similar issue right now, i can open the native apps, but it will always be displayed at current location, and there will be no pointers for different locations ( I'm not able to pass any parameters into the map ), but to open the map, just use

var url = "maps:any address"; //the address wont make a difference since i can't pass parameters in. window.open(url);

(tested on blackberry Z10)

  • Thanks @invisible520, I've tried this uri scheme on Z10 device and yes, maps app opens, but yes, I also didn't managed to pass lat/lon parameters there... – kio21 Aug 27 '13 at 07:08
0

Looks like without webworks thats not working. Just tried the geo: URIs but they don't work from app. In the BB Browser they work fine but not in app.

Felix Weber
  • 518
  • 1
  • 4
  • 8
-1

try these URIs:

geo:-34.6033,-58.3817 (for Buenos Aires, Argentina)

geo:52.5167,13.3833 (for Berlin, Germany)

Worked for me in the browser.

G M Ramesh
  • 3,420
  • 9
  • 37
  • 53