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

Cordova : how to handle incoming content with Intent

4 Answers 845 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Saluts92
Top achievements
Rank 1
Saluts92 asked on 30 Mar 2016, 06:19 AM
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

4 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 01 Apr 2016, 12:50 PM
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.

 
0
Saluts92
Top achievements
Rank 1
answered on 01 Apr 2016, 01:30 PM
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?
0
Kaloyan
Telerik team
answered on 06 Apr 2016, 01:21 PM
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.

 
0
Saluts92
Top achievements
Rank 1
answered on 14 Apr 2016, 06:27 AM
thanks   it works
Tags
Apache Cordova
Asked by
Saluts92
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Saluts92
Top achievements
Rank 1
Share this question
or