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
smiley
Posts: 1,497
Registered: ‎07-14-2008
My Device: Z10
Accepted Solution

How to register my app as a invoke target and launch it from a homescreen shortcut?

I want to register my app and then launch it when the user runs the homescreen shortcut.

 

I see this in beBuzz where the developer has two shortcuts on the homescreen.  When the shortcut is launched it opens beBuzz application to perform an action.

 

How do I go about doing this?  I can create a homescreen short already just not sure what to put in the URL and how to register the app in the xml file so the shortcut can lauch my app.

 

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to register my app as a invoke target and launch it from a homescreen shortcut?

In HomeScreen.addShortcut (const QUrl &iconPath, const QString &iconLabel, const QUrl &url), you need to specify a custom url that your app has registered for via its bar-descriptor.

 

To register for that custom URL, you need to define a invoke target with a filter that accepts such url in your bar-descriptor.. To learn more about targets and filters please refer to http://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/receiving_i...

 

Shadid

Developer
smiley
Posts: 1,497
Registered: ‎07-14-2008
My Device: Z10

Re: How to register my app as a invoke target and launch it from a homescreen shortcut?


shaque wrote:

In HomeScreen.addShortcut (const QUrl &iconPath, const QString &iconLabel, const QUrl &url), you need to specify a custom url that your app has registered for via its bar-descriptor.

 

To register for that custom URL, you need to define a invoke target with a filter that accepts such url in your bar-descriptor.. To learn more about targets and filters please refer to http://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/receiving_i...

 

Shadid


Thanks. This is what I have in the bar file so what would I pass to QUrl in addShortcut()?

is the mime-type the correct method or do i have to use url?

 

    <invoke-target id="com.app.test.invoke">
          <type>APPLICATION</type>
          <filter>
             <action>bb.action.OPEN</action>
             <mime-type>application/vnd.abc</mime-type>
          </filter>
    </invoke-target>

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to register my app as a invoke target and launch it from a homescreen shortcut?

You need to avoid the mimetype in your registration and instead use uri in the filter (See invoke docs for how to do that).

If no mimetype is causing issues, specify * as the mimetype.

Shadid