This is a migrated thread and some comments may be shown as answers.

Get my app on the "Share" menu?

1 Answer 23 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bobby
Top achievements
Rank 1
Bobby asked on 07 Jan 2013, 09:02 PM
Is there a method for adding my app to the "share" feature on devices?
Eg, to send the url of a webpage currently being viewed in the browser to my app?
Thanks!

1 Answer, 1 is accepted

Sort by
0
iliev
Telerik team
answered on 08 Feb 2013, 11:21 AM
Hello Bobby,

I would like to thank you for taking the time to report us the issue you encountered on behalf of the Telerik team.

My impressions are that you are trying to:

  • Add your application to the share menu.
  • Transfer information or url from the native telephone browser to your application.

Icenium's team investigated these issues. You can't add your application to the share menu in iOS, but in Android it can be done using intent filters. To open your app from the browser you need to define your custom url scheme and use it consistently(which is done again through intent-filters). For example:

bobbyapp://some/path/here

Unfortunately modifying intent filters is not currently supported in Icenium at the moment. We've added this issue in our backlog and will be working hard to make it available in future releases.

If you are curious what you will need to do after we support this you can read below:

In your Cordova project's JavaScript, add a global function handleOpenURL which just takes one parameter, which will be a string containing the URL that was launched. Add your code to parse and handle the URL in that global function. This function will be called always if your app was launched from the custom scheme.

function handleOpenURL(url) { // TODO: parse the url, and do something }

IMPORTANT NOTE:

You cannot launch any interactive features like alerts in the handleOpenURL code, if you do, your app will hang. Similarly, you should not call any Cordova APIs in there, unless you wrap it first in a setTimeout call, with a timeout value of zero:

function handleOpenUrl(url) { 
// TODO: parse the url, and do something
setTimeout(function() {
// TODO: call some Cordova API here
}, 0);
}

Kind regards,
Ilian Iliev
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.

Tags
General Discussion
Asked by
Bobby
Top achievements
Rank 1
Answers by
iliev
Telerik team
Share this question
or