Code Monkey home page Code Monkey logo

Comments (13)

lampaa avatar lampaa commented on June 14, 2024

Hi, @minamu1!

I updated plugin in thees lines: https://github.com/lampaa/com.lampa.startapp/blob/master/src/android/startApp.java#L77

Please, reinstall plugin and add this code:

navigator.startApp.check([["action", "com.evernote.action.VIEW_NOTE"],[{"NOTE_GUID":"SOME_NOTE_UID"}]], function(message) { 
    console.log(message); // => OK
}, 
function(error) {
    console.log(error);
});

from com.lampa.startapp.

andy-ta avatar andy-ta commented on June 14, 2024

Hello, I would like to know if it would be possible to return to the app that has been started. For example, if I start a call on X app, once the calls end, my app would open.

from com.lampa.startapp.

lampaa avatar lampaa commented on June 14, 2024

@andy-ta hi!
Try to run your application after launch another application, example:

navigator.startApp.start("com.evernote", function(message) { 
    navigator.startApp.start("com.you.app", function(message) {  }, function(error) { );
}, function(error) { );

from com.lampa.startapp.

minamu1 avatar minamu1 commented on June 14, 2024

Hello lampaa,

Thanks for tending to the issue I mentioned earlier. I uninstalled and then reinstalled the plugin and tried again.

However, it does not seem to work still. I tried the following code: for navigator.startApp.check:

navigator.startApp.check([["com.evernote", "com.evernote.action.VIEW_NOTE"],[{"NOTE_GUID":"SOME_NOTE_UID"}]], function(message) { 
                        alert(message); // => OK
                    }, 
                    function(error) {
                        alert(error);
                        }
                );

I got the following error:

android.content.pm.PackageManager$NameNotFoundException: [["com.evernote","com.evernote.action.VIEW_NOTE"],[{}]]

I get this error even tough the Evernote app is install and has package "com.evernote".

Also, instead of using startApp.check, if I use startApp.start, I get the same old error I was getting. The following code:

          navigator.startApp.start([["com.evernote", "com.evernote.action.VIEW_NOTE"],[{"NOTE_GUID":"SOME_NOTE_GUID"}]], function(message) {   
                        alert(message); // => OK
                    }, 
                    function(error) {
                        alert(error);
                        }
                );

I get the same error:

"intent:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.evernote/com.evernote.action.VIEW_NOTE}; have you declared this activity in your AndroidManifest.xml?"

I am not sure if the issue is with the plugin or how to setup the AndroidManifest.xml file. Do I need to add something to the AndroidManifest.xml file?

As always, thanks for your time and effort!

from com.lampa.startapp.

lampaa avatar lampaa commented on June 14, 2024

@minamu1 hi! Replace com.evernote to action, see my comment
#14 (comment)
I write about check method, please replace to start method.

from com.lampa.startapp.

minamu1 avatar minamu1 commented on June 14, 2024

Hello lampaa,

Ah, I should have mentioned that I did try your suggestion from #14 and got an error with that too.

After uninstalling and re-installing the plugin, I used the following code:

navigator.startApp.check([["action", "com.evernote.action.VIEW_NOTE"],[{"NOTE_GUID":"SOME_NOTE_GUID"]], function(message) { 
                        alert(message); // => OK
                    }, 
                    function(error) {
                        alert(error);

                    }
                );

When I ran my app and tried to execute the above code, I got the following error:

android.content.pm.PackageManager$NameNotFoundException:[["action","com.evernote.action.VIEW_NOTE"],[{}]]

Any ideas how I can resolve this? I double-checked and confirmed in Evernote documentation that "com.evernote.action.VIEW_NOTE" is a valid action.

Thanks!

from com.lampa.startapp.

lampaa avatar lampaa commented on June 14, 2024

@minamu1 try this:

navigator.startApp.start([["action", "com.evernote.action.VIEW_NOTE"],[{"NOTE_GUID":"SOME_NOTE_UID"}]], function(message) { 
    console.log(message); // => OK
}, 
function(error) {
    console.log(error);
});

from com.lampa.startapp.

minamu1 avatar minamu1 commented on June 14, 2024

Hello lampaa,

Thanks for your continued help and support!

I tried using the start() function as you mentioned, but I got no response from the app - no success or error.

I added an alert('Done!') after the code, but the alert was never called:

navigator.startApp.start([["action", "com.evernote.action.VIEW_NOTE"],[{"NOTE_GUID":"SOME_NOTE_UID"}]], function(message) { 
    alert(message); // => OK    <-- This is never called
}, 
function(error) {
    alert(error);        //     <-- This is never called
});

alert('Done!');        //     <--- This is never called.

Any ideas on what may be going on?

Thanks!

from com.lampa.startapp.

lampaa avatar lampaa commented on June 14, 2024

@minamu1 hi! Hmm, probably you not declared code or before the code has a bug. See this tool for debug code on app: http://jsconsole.com/remote-debugging.html. I often use it if have something does not work.

from com.lampa.startapp.

minamu1 avatar minamu1 commented on June 14, 2024

Hello lampaa,

I reinstalled the plugin and followed your instructions - it works!!! The activity launches and Evernote pulls up the right note. Thanks for helping.

Also, thanks for introducing my to the jsconsole remote debugging tool. It's amazingly useful for Cordova/Phonegap development. I have been suffering from poor debugging for the last two years.

Thanks!
Mohammad

from com.lampa.startapp.

lampaa avatar lampaa commented on June 14, 2024

@minamu1, i was happy to help you!

from com.lampa.startapp.

hadroapp avatar hadroapp commented on June 14, 2024

Hello lampaa,

Firstly, I am continuing to use your plugin and find it really useful. Thank you!

I wanted to reach out to you about trying to launch the Salesforce android app from my Cordova app using the startapp plugin.

According to Salesforce documentation (https://na7.my.salesforce.com/help/pdfs/en/salesforce1_url_schemes_ios.pdf), for both iOS and Android, the URL scheme is as follows:

<scheme_name>sObject//view

For example, if I have an object ID "001D000000Jwj9v", then I can launch the native app to view the object with the following:

salesforce1://sObject/001D000000Jwj9v/view

At this stage, I am only interested in "view"ing the object; I don't plan on any other functions like editing or downloading. I am having trouble launching this from my app using the startapp plugin. Could you please advise on what would be the correct syntax and usage for this situation? I have read your documentation and tried several permutations but am getting various errors. Could you please advise on this?

Thanks!
Mohammad

from com.lampa.startapp.

lampaa avatar lampaa commented on June 14, 2024

Hi, @hadroapp!
try this:

navigator.startApp.start([["action", "VIEW"], ["salesforce1://sObject/001D000000Jwj9v/view"]], ...);

from com.lampa.startapp.

Related Issues (20)

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.