Esempio n. 1
0
void MainMenu::receivedInvokeRequest(const bb::system::InvokeRequest& request) {

	qDebug() << "XXXX invoked by iF: " << request.target() << " MIME=" << request.mimeType() << " ACTION=" << request.action() << " URI=" << request.uri();
	QByteArray data = request.data();
	qDebug() << "XXXX got data";
	if (request.mimeType().compare("application/vnd.rim.nfc.ndef") == 0)
	{
		qDebug("XXXX launched because an NFC tag has been presented");
		emit launchEventLog();
		_nfcManager = NfcManager::getInstance();
		_nfcManager->handleTagReadInvocation(data);
	}
	else {
		if (request.mimeType().compare("application/vnd.bb.nfc_transaction") == 0) {
			qDebug("XXXX launched because an NFC card emulation transaction event has been notified by an applet in the secure element");
			QString json = QString(data);
			qDebug() << "XXXX " << json;
			_systemDialog->setBody(json);
			_systemDialog->show();
		}
	}
}
Esempio n. 2
0
void TranslationInterface::onInvoked(const bb::system::InvokeRequest &request)
{
    if (request.mimeType() != "text/plain")
        return;

    setSourceText(QString::fromUtf8(request.data()));

#ifdef WITH_ANALYTICS
    if (m_privacyLevel == NoPrivacy) {
        QVariantMap props;
        fillTranslationProperties(props);
        m_analytics->trackEvent("Invoked", props, true);
    }
#endif

    retranslate();
}