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: 65
Registered: ‎03-20-2013
My Device: Z10(Red Limited Edition)
My Carrier: MY COMPANY
Accepted Solution

How to invoke my app

Hello All,

         I want to inoke my app when user click on a link("www.xyz.com/myapp") from default bb browser or somewhere else when this link found and then open my app and perform task according to clicked link.

to achieve this , using this docs  https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/receiving_... but still not able to invoke my app.

 

Bar-descriptor.xml

 

  <invoke-target id = "com.xyz.sampleApp">
        <invoke-target-type>application</invoke-target-type>
        <invoke-target-name>SampleApp</invoke-target-name>
        <icon> <image>sample.png</image> </icon>
        <filter>
            <action>bb.action.VIEW</action>
            <action>bb.action.OPEN</action>
            <mime-type>*</mime-type>
            <property var="uris" value="www.xyz.com/myapp"> </property>
        </filter>
    </invoke-target>

correct me if i missing something.

Thanks

Ankur

Developer
Posts: 65
Registered: ‎03-20-2013
My Device: Z10(Red Limited Edition)
My Carrier: MY COMPANY

Re: How to invoke my app

Can anyone suggest me what i did wrong.

Developer
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: How to invoke my app

<property var="uris" value="www.xyz.com/myapp"> </property>

 Have you tried to use: http://www.xyz.com/myapp

And you have to set your application as the default application for this action

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: How to invoke my app

This functionality is not supported.  Web links will only open in the web browser by default.  This is because of security concerns.  For example a malicious developer could override links to a bank's web site and gather banking information.

 

You can however register to be one of the apps able to open a specific link.  If a user long-presses on a link in their email, Facebook, etc, your app can register to be one of the apps that will open the URL. If the user selects your app from the list (the list would probably consist of your app and the browser in this case) then your app will be invoked. Here is some sample code that you can add to your bar-descriptor file to see this:

 

<invoke-target id="com.example.bb10samples.uri">

<invoke-target-name>BB10 Sample App</invoke-target-name>

<icon><image>icon.png</image></icon>

<invoke-target-type>APPLICATION</invoke-target-type>

<filter>

<action>bb.action.OPEN</action>

<mime-type>*</mime-type>

<!-- internal urls -->

<property value="bb10samples://,https://m.bb10samples.com/test/,http://m.bb10samples.com/test/" var="uris"/>

</filter>

</invoke-target>

 

You can also register for custom urls (“bb10samples://” in the above code sample) so you can create links like <a href=” bb10samples://test/testData”>Open in my app!!</a> which will invoke your app.

 

Developer
Posts: 65
Registered: ‎03-20-2013
My Device: Z10(Red Limited Edition)
My Carrier: MY COMPANY

Re: How to invoke my app

thanks a lot buddy