Cordova : how to handle incoming content with Intent

5 posts, 0 answers
  1. Saluts92
    Saluts92 avatar
    7 posts
    Member since:
    Mar 2016

    Posted 30 Mar Link to this post

    Hello,

    I developed a small application with Cordova in HTML5, CSS, JS
     
    My manifest I used:

    <intent-filter>
                    <action android:name="android.intent.action.SEND" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <data android:mimeType="text/plain" />
                </intent-filter>



    This allows me to bring up my app in the list of apps when any of the user is "Share page" from their browser (among others)

    My question is: how do I retrieve this information (URL) into your Javascript?

    I saw a lot of information on the Net but no concrete example that allows me to realize my code.

    Thanks in advance
  2. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 01 Apr Link to this post

    Hi Saluts92,

    I am not sure that I understand your inquiry correctly, so please let me know if neither of the below suggestions meet your requirement.

    If you want to register a custom URL scheme for your application, please check this sample app.

    If you want to add the same intent-filter in a Telerik Platform hybrid application, you can directly edit the AndroidManifest.xml file as explained here.

    I hope this helps.

    Regards,
    Kaloyan
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Saluts92
    Saluts92 avatar
    7 posts
    Member since:
    Mar 2016

    Posted 01 Apr Link to this post

    Thank you Kaloyan, but that's not what I want

    When the user is on a page of its Web browser and it does "share page" then choose an application (mine), the browser sends the URL to the application.

    How can I retrieve this information (URL) in my hybrid application Cordova?
  4. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 06 Apr Link to this post

    Hi Saluts92,

    I think that this is something that must be done in the native parts of the hybrid application. This said, I suggest you to check if the Cordova Intent plugin is capable of retrieving the URL after the application is re-instantiated.

    To import it in your project, please follow these steps. Additionally, you will need to build the project as an application package and deploy it to an actual device in order to test its functionality.

    I hope this helps.

    Regards,
    Kaloyan
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  5. Saluts92
    Saluts92 avatar
    7 posts
    Member since:
    Mar 2016

    Posted 14 Apr in reply to Kaloyan Link to this post

    thanks   it works
Back to Top