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
Posts: 163
Registered: ‎12-06-2012
My Device: Z10, Q10
My Carrier: BlackBerry
Accepted Solution

Can't invoke the clock app

I am trying to invoke the clock app from my app. But the reply shows the NoTarget error.

// Create a new invocation request
    InvokeRequest request;

    // Setup the request properties according to the current configuration
    request.setAction("bb.action.VIEW");
    request.setMimeType("text/plain");
    request.setTarget("bb.clock.launcher");
    request.setData("worldClockTab");
    request.setTargetTypes(
    		InvokeTarget::Application | InvokeTarget::Card
                            | InvokeTarget::Viewer | InvokeTarget::Service);

    // Start the invocation
	const InvokeReply *reply = m_invokeManager->invoke(request);
	if (reply)
	{
		// Ensure that processInvokeReply() is called when the invocation has finished
		bool ok = connect(reply, SIGNAL(finished()), this,  SLOT(processInvokeReply()));
	}

 the found reply shows this error

 

InvokeReplyError::NoTarget

 

Retired
Posts: 83
Registered: ‎10-10-2012
My Device: Z30
My Carrier: Bell

Re: Can't invoke the clock app

Hi,

 

Does you application have the appropriate permissions checked off in the bar-descriptor?

 

-g

Developer
Posts: 163
Registered: ‎12-06-2012
My Device: Z10, Q10
My Carrier: BlackBerry

Re: Can't invoke the clock app

I have this permission added in bar descriptor

<permission>access_shared</permission>
Developer
Posts: 163
Registered: ‎12-06-2012
My Device: Z10, Q10
My Carrier: BlackBerry

Re: Can't invoke the clock app

Is it currently even possible? I tried to open the clock from the invokeClient app downloaded from sample app list of BB10. But it says that error I am having. I set the action type to all and invocation type to all and target Id to bb.clock.launcher amd mme type to text/plain. But it show the error I am having.
Developer
Posts: 1,178
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Can't invoke the clock app

Looks like another example of the invocation bug introduced with BB10.2. Try invoking it with my Invoker Class which can be called from C++ or QML. Wraps the fix for the invocation bug up in a nice neat package.

 


calicratis19 wrote:
Is it currently even possible? I tried to open the clock from the invokeClient app downloaded from sample app list of BB10. But it says that error I am having. I set the action type to all and invocation type to all and target Id to bb.clock.launcher amd mme type to text/plain. But it show the error I am having.





Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.
Developer
Posts: 163
Registered: ‎12-06-2012
My Device: Z10, Q10
My Carrier: BlackBerry

Re: Can't invoke the clock app

Hi. Thanks for the reply. I tried with your class.

 

Invoker *request = new Invoker(this);

    // Setup the request properties according to the current configuration
    request->setAction("bb.action.VIEW");
    request->setMimeType("text/plain");
    request->setTarget("com.example.Clock");
    request->setTargetTypes(InvokeTarget::Application | InvokeTarget::Viewer| InvokeTarget::Unspecified);
    request->setData("worldClockTab");

    request->invoke();

 But got the same error Smiley Sad

Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Can't invoke the clock app

[ Edited ]

I think your error lies in the targetID

 

you're using

request->setTarget("com.example.Clock");

 

should be 

request->setTarget("bb.clock.launcher");

This page has all the info needed to invoke core applications 

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/invoking_c...

Developer
Posts: 163
Registered: ‎12-06-2012
My Device: Z10, Q10
My Carrier: BlackBerry

Re: Can't invoke the clock app

That also give me the same error. I previously tried that . Now tried again.

 

Invoker *request = new Invoker(this);

    // Setup the request properties according to the current configuration
    request->setAction("bb.action.VIEW");
    request->setMimeType("text/plain");
    request->setTarget("bb.clock.launcher");
    request->setTargetTypes(InvokeTarget::Application | InvokeTarget::Viewer| InvokeTarget::Unspecified);
    request->setData("worldClockTab");

    request->invoke();

 Same error again Smiley Sad

 

Followed as it is mentioned in here

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/clock.html

Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Can't invoke the clock app

hmm well it should be working then, your best bet would be to create a ticket so they can look into it

 

https://www.blackberry.com/jira/secure/Dashboard.jspa

Developer
Posts: 1,178
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Can't invoke the clock app

Interesting. Two thoughts... I am surprised that I can't find any mention in Cascades/Native documentation for InvokeTarget::Viewer, despite many code samples around the web specifying it.

 

Also, it is possible that the clock doesn't respond to any of the target types you specified, so the system couldn't find a match. The Clock Invocation docs don't mention anything about target types. I suggest you try removing the setTargetTypes clause and see what happens.

 


calicratis19 wrote:

That also give me the same error. I previously tried that . Now tried again.

 

Invoker *request = new Invoker(this);

    // Setup the request properties according to the current configuration
    request->setAction("bb.action.VIEW");
    request->setMimeType("text/plain");
    request->setTarget("bb.clock.launcher");
    request->setTargetTypes(InvokeTarget::Application | InvokeTarget::Viewer| InvokeTarget::Unspecified);
    request->setData("worldClockTab");

    request->invoke();

 Same error again Smiley Sad

 

Followed as it is mentioned in here

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/clock.html




 

 



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.