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
Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone
Accepted Solution

Problem with InvokeManager::invoked

I'm using Invocation Framework as client and as target.

client works well.

 

now added support to be invoked as a target.

 

added in bar descriptor:

<invoke-target id="my-id">
    	<invoke-target-name>my-name</invoke-target-name>  		
  		<icon>assets/images/my-icon.png</icon>    	
    	<type>APPLICATION</type>
    	<filter> 
    		<action>bb.action.OPEN</action>
      		<mime-type>image/png</mime-type>
      		.... some more		
    	</filter>
    </invoke-target>

Using the InvocationClient APP from Cascades-Community-Samples at Github I can query my app, app will be found and also launched or opened.

 

so the app is known as a target and filtering works as expected.

 

But I don't get the InvokationRequest in my SLOT:

hpp:

private Q_SLOTS:
  void handleInvoke(const InvokeRequest& request);

cpp:

void MyApp::handleInvoke(const InvokeRequest& request) {
  qDebug() << "Invoke Request to handle";
}

 

debugged and found that the connect wasn't done.

 

this is my connect code:

 

m_invokeManager = new InvokeManager(this);
	ok = connect(m_invokeManager, SIGNAL(invoked(const InvokeRequest&)), this, SLOT(handleInvoke(const InvokeRequest&)));
	if (!ok) {
		qDebug() << "connect handleInvoke failed";
	}

 Connection failed with:

Object::connect: No such signal bb::system::InvokeManager::invoked(const InvokeRequest&)

 any idea what could be wrong ?

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: Problem with InvokeManager::invoked

Probably need the namespaces... try this

 

_invokeManager = new InvokeManager(this);
	connect(_invokeManager, SIGNAL(invoked(const bb::system::InvokeRequest&)),this, SLOT(onInvoked(const bb::system::InvokeRequest&)));

 

Like all of my posts
Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Problem with InvokeManager::invoked

thx, Kyle

 

added the namespace bb::system for connecting slots and signals

and got compile errors

 

removed use namespace bb::system from headerfile

cleaned project

and suddenly the errors gone and the slot was used

 

all works now as expected

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
ekke
Posts: 1,571
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Problem with InvokeManager::invoked

BTW: had the same problem with another project.

changed to full bb::system:: namespace for the connect,

also got immediately error that invoked... etc is unknown

clear project and new build didn't help, but closing and re-opening the workspace did it.

so next time with unexpected errors I'll close/reopen workspace first ;-)

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner