2

Blackberry 10 のブラウザーからネイティブ マップ アプリケーションを開く方法を見つける必要があります。私の Web アプリケーションは、WebWorks を使用せずに純粋なプレーン ブラウザーで動作しています。

このアクションを実行する簡単な方法を提供する URI スキームに違いないと思います。私はすでにiOS、Android、WP8でこれを行っています。しかし、Blackberry 10 デバイスは本当に苦痛です。

繰り返しますが、私の Web アプリは BB10 デバイスのブラウザーで動作します。

4

4 に答える 4

2

最近、BlackBerry に関するドキュメントがあり、それを行う方法があります。

「bar-descriptor.xml」ファイルを目的の 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>

その後、アプリケーション コードで (BlackBerry のドキュメントから):

// 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 ドキュメント

于 2016-02-05T10:28:20.030 に答える
1

現在、同様の問題があります。ネイティブアプリを開くことはできますが、常に現在の場所に表示され、別の場所へのポインターはありません (マップにパラメーターを渡すことができません)。マップを開くには、次を使用します

var url = "マップ:任意のアドレス"; //パラメーターを渡すことができないため、アドレスは違いを生みません。 window.open(url);

(ブラックベリー Z10 でテスト済み)

于 2013-08-23T18:31:58.193 に答える
0

機能していないWebworksがないように見えます。geo: URI を試してみましたが、アプリからは機能しません。BB ブラウザでは問題なく動作しますが、アプリでは動作しません。

于 2014-02-19T13:08:44.900 に答える