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

Native Development

Reply
Contributor
helixion
Posts: 17
Registered: ‎03-28-2012
My Device: Developing on multiple models

HCI Event not captured

Hi All,

 

As per the instructions in this page, I developed an HCI event handler. Here is the excerpt from my bar-description.xml.

 

    <invoke-target id="b10.transaction.listener">
    	<entry-point>1</entry-point>
    	<type>APPLICATION</type> 
    	<filter>
        	<action>bb.action.NOTIFY</action>
        	<mime-type>application/vnd.bb.nfc_transaction</mime-type>
        	<property var="uris" 
            	   value="aid://SIM/a0.00.00.00.04.10.10/"/>
    	</filter> 
	</invoke-target>

 And here is the (cut down version of the) code I use to capture the event:

 

SeConnectionAdapter::SeConnectionAdapter(){
	 // And finally listen for HCI events
	invokeManager = new bb::system::InvokeManager(this);
	qDebug("Registering event");
	QObject::connect(invokeManager, SIGNAL(invoked(const bb::system::InvokeRequest&)),
			this, SLOT(receivedInvokeRequest(const bb::system::InvokeRequest&)));
	qDebug("Registered event");
}

SeConnectionAdapter::~SeConnectionAdapter() {
	delete invokeManager;
}

void SeConnectionAdapter::receivedInvokeRequest(const bb::system::InvokeRequest& invReq){
	qDebug("Event captured");
	bb::system::SystemDialog *_systemDialog = new bb::system::SystemDialog(this);
	_systemDialog->setTitle("NFC Transaction");
	bb::system::SystemUiButton *confirmButton = _systemDialog->confirmButton();
	confirmButton->setLabel("Ok");
	// TODO For now just display a message box
	QByteArray data = invReq.data();
	QString body("No Mime");
	if(invReq.mimeType().compare("") == 0){
		body = QString(data);
	}
	_systemDialog->setBody(body);
	_systemDialog->show();

 I could see the "Registering event" and the "Registered event" debug lines. But on triggerring (for which I use the GPShell utility mentioned in the link), I don't get anything reaching my app (neither do I get a debug line as in the first line of the slot).

 

Can anybody figure out anything wrong in the implementation?

 

Thanks

Please use plain text.