Code Monkey home page Code Monkey logo

cordova-plugin-intent's People

Contributors

mtillmann avatar napolitano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-intent's Issues

Not working with launchmode singleTask

The plugin works perfectly when launchmode is singleTop, but creates multiple instances of my application. When attempting to use singleTask, the intent was no longer working. Could you provide an example using singleTask launchmode to see it working?

the part code about iOS doesn't work

I insert that code into plist, but still cannot open image or text with my app. I have known something about that preference, but don't know what is wrong.

Support for API level below 19

Hello @napolitano!

First of all, thanks for this plugin - it works way better than the WebIntent plugin. It would be really nice if it could support API levels starting from 15-16 (Android 4.0-4.1) as they still account for 20% of the active devices.

Is there any technical reason for choosing API level 19?

I'll be willing to contribute if needed. Thanks!

Parcelled data in Extra not unpacked

Hi.
Thanks for the great plugin!.

I have noticed that in some cases the intent data (when sending URL from chrome) comes parcelled and then doesn't get unpacked (looking at the data it just shows: extras : Bundle[mParcelledData.dataSize=664] )

I made a small hack to fix it for me by just pulling out the data to a string but I'm not sending it as pull request as I think there must be a more elegant solution ;)


try {
        intentJSON = new JSONObject();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            if(items != null) {
                intentJSON.put("clipItems", new JSONArray(items));
            }
        }

// change to ensure all data is pulled from extras
StringBuilder str = new StringBuilder();
Bundle bundle = intent.getExtras();
if (bundle != null) {
Set keys = bundle.keySet();
Iterator it = keys.iterator();
while (it.hasNext()) {
String key = it.next();
str.append(key);
str.append(":");
str.append(bundle.get(key));
str.append("\n\r");
}
}
intentJSON.put("bundle",str.toString());
// end of change
intentJSON.put("type", intent.getType());

trouble reading intent extra object.

Hello:
I can read the outer fields just find and the clipItems object without a issue. However the extras object I'm having a issue reading the "android.intent.extra.TEXT" and " android.intent.extra.SUBJECT" fields.

I have tried:

intent.android.intent.extra.TEXT
intent.extra.TEXT 

I'm a little confuse here.

what's the proper way to ready the extra object.

plugin breaks visual studio loading process

hey, i know that this might not be necessarily your issue but I'm gonna say it here anyway since other people might search for it.

adding your plugin to visual studio via "cordova plugin add cordova-plugin-intent" will install an example app, that has a file in it, that has a very long path.

\plugins\com.napolitano.cordova.plugin.intent\example\app\platforms\android\CordovaLib\build\intermediates\classes\debug\org\apache\cordova\

The latest version of visual studio (here visual studio 2015 enterprise Update 3) will say something like ' %(Fullpath) cannot be applied to' the file above. Older versions will just crash.

deleting the file or renaming it will help.

clipItems element missing

Hi, I'm trying to use this plugin and I'm getting intet object but clipItems element is missing. How is it possible. What am I doing wrong? I have exactly the same configuration in my AndroidManifes.xml as on the plugin page.
And my action element is android.intent.action.MAIN instead of android.intent.action.SEND_MULTIPLE

Thanks

Problems with setNewIntentHandler()

I get getCordovaIntent() to work but setNewIntentHandler does not work when it is shared with the application. Has anyone experienced the same problem or has a real example about how to implemente setNewIntentHandler() ?

Help with steps for iOS

Hi,
My question is to see if anyone has managed to make this plugin for iOS?

I have followed the steps that are at the end of this plugin but I haven't managed to get the application to appear in the share list. It doesn't give me any error but it doesn't do anything either.

Plugin don´t work on cold start

Hi, when the app it´s completly closed (cold start) i try to share an image or a text using this plugin and it don´t work.
When the app it´s open on background the plugin work perfect.

Somebody have this problem?

Invalid action error

I tested with sharing an image from Whatsapp but I get an error "invalid action" on window.plugins.intent.getRealPathFromContentUrl().

run on ios

I could not understand whether it will work on ios or not. As you have mention for IOS and gave a basic implamentation example, there is not ant file in sources.

Could you clearify, we could use it in ios (on ionic plaftorm) and if yes how.
Thank you.

Share with self - same application

I notice when I use the share option within my app, my own application will appear in the list however if I try to share something to the same application it can't process it - nothing happens.
Anyone else faced this? Got any ideas how to fix/remedy? (eg. Prevent sending application to appear in the list when sharing)

Convert content URL

When sharing to my application from a thirdparty app like google drive, I get files paths looking like this:
content://com.google.android.apps.docs.storage.legacy/something...

For some reason, using getRealPathFromContentUrl fires the success callback, but the variable passed to it is null. What can I do to open the file shared in this way? I tried using window.resolveLocalFileSystemURL on the content URL but that doesn't work (it returns a file error). I replaced "content://" with "file://" but this doesn't work either, the file cannot be opened as well. What could be the reason for that? Opening files from the device's photo gallery works fine! Tested on a Samsung Galaxy Alpha with Android 5.0.2. The app was created using PGB cli 6.3.0.

It would be reall nice if someone could point me in the right direction!

proper way to use getRealPathFromContentUrl

whats the proper way of calling this method? I'm trying to use it like but I'm getting the error saying the getRealpathFromContentUrl() is not a function?

window.plugins.intent.getCordovaIntent(function (intent) {

for (var i = 0, l = intent.clipItems.length; i < l; i++) {
        var obj = intent.clipItems[i];
    window.plugins.intent.getRealPathFromContentUrl(obj.uri, function (realPath) {
           console.log(realPath);
       },function () {
           alert('error in getRealPathFromContentUrl')
        });
 }
}

Get URI while sharing from Chrome

Hello!
Sharing a webpage from Chrome I'd like to get that page URI. I'm using setNewIntentHandler and getting this object:

{
    action: "android.intent.action.SEND",
    clipItems: [
        extension: "jpeg"
        type: "image/jpeg"
        uri: "content://com.android.chrome.FileProvider/images/screenshot/1455964158897645869502.jpg"
    ],
    component: "ComponentInfo{com.ionicframework.starter/com.ionicframework.starter.MainActivity}"
    extras: "Bundle[mParcelledData.dataSize=868]"
    flags: 55050241
    type: "text/plain"
}

As you see there's no shared page URI. So how to get it?

In my current config.xml

<config-file target="AndroidManifest.xml" parent="activity">
      <intent-filter android:label="@string/launcher_name">
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <intent-filter>
          <action android:name="android.intent.action.SEND" />
          <action android:name="android.intent.action.SEND_MULTIPLE" />
          <category android:name="android.intent.category.DEFAULT" />
          <data android:mimeType="*/*"/>
      </intent-filter>
</config-file>

event error firing when app starts up cold

Hello,
Thank you for the work on this plugin.

When I share something from the browser my app starts up I get a error in the getCordovaIntent()


 window.plugins.intent.getCordovaIntent(function (intent) {

                    alert(intent)

                }, function () {
                    alert('error in getCordovaIntent')

                });

Not sure why the event is firing? Is there something else I might need to set or add?

Any help would be great.

Additional info below

 <intent-filter>
               <action android:name="android.intent.action.SEND_MULTIPLE" />
               <category android:name="android.intent.category.DEFAULT" />
               <data android:mimeType="*/*" />
            </intent-filter>

using version .1.3

Cannot make the plugin work in Phonegap app

Not sure why I am not able to make it work.

Here is what I have done.

Opened PhoneGap desktop app (Windows 10)
Created a new Hello World App.
Open command prompt, cd to the app directory

phonegap local plugin add https://github.com/napolitano/cordova-plugin-intent

It installed the plug in.
In plugins directory I can see this directory:

com.napolitano.cordova.plugin.intent

In config.xml I have:

<plugin name="com.napolitano.cordova.plugin.intent" spec="https://github.com/napolitano/cordova-plugin-intent" />

In AndroidManifest.xml I have:

<application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" />
            </intent-filter>
        </activity>
</application>

So, any link with https schema is giving me option to open my app. This is fine.

In index.html I have:

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
document.addEventListener('deviceReady', function(){
    window.plugins.intent.getCordovaIntent(function (Intent) {
        console.log(Intent);
    }, function () {
        console.log('Error');
    });
});
</script>

In Chrome Console, I am getting this error:

Uncaught TypeError: Cannot read property 'getCordovaIntent' of undefined

So, I think the plug in is not initiated at all. Or it is something else? Whatever it is, I am struggling for two days to make it work. Please let me know what wrong I am doing.

How to read a shared file

Hello,

First of all,thank you for this plugin, works flawlessly. I was just guessing how can I access a file that has been sent to my application. I tried to use the file cordova plugin, trying to open the path that I receive on the intent , but I'm unable to access the contents, probably because lack of permissions. Is there any other way of doing this ?

Thanks in advance

Create the hook file

Hi!

With this plugin we need to manually create the hook file....
This other plugin is able to add the hook: https://github.com/rossmartin/cordova-uglify

  1. It needs to be specified in postinstall in package.json https://github.com/rossmartin/cordova-uglify/blob/master/package.json
  2. Then that script moves the file: https://github.com/rossmartin/cordova-uglify/blob/master/scripts/install.js

Also, you guys use ruby..... if possible it would be better if you guys used nodejs since it's more used...

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.