Giter Site home page Giter Site logo

lampaa / com.lampa.startapp Goto Github PK

View Code? Open in Web Editor NEW
226.0 226.0 120.0 174 KB

Phonegap plugin for check or launch other application in android device.

License: MIT License

Java 37.33% Objective-C 5.87% JavaScript 24.10% HTML 32.70%
android java javascript phonegap phonegap-plugin startapp

com.lampa.startapp's People

Contributors

calclavia avatar dragas avatar edmundasr avatar eisenhorn13 avatar inu1255 avatar kraihn avatar lampaa avatar raymondelferink avatar sametkahraman avatar vitorsgomes 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

com.lampa.startapp's Issues

PG to PG application launch

Able to launch the another phonegap application form phonegap application..

Can you please assist how to pass the parameters to the target PG app?
Given examples for the Intent are fine say - VIEW 98XXXX, CALL 98XXXX

Would like to some parameters and will navigate/execute something in target phonegap application.

Problem under Cordova

We have just tested your plugin under Cordova 3.5 and it doesn't work "out of the box".
After installing with CLI, the first line in startApp.js is corrupted.

It looks like this:

cordova.define("org.apache.cordova.startapp.startapp", function(require, exports, module) { cordova.define("org.apache.cordova.startapp.startapp", function(require, exports, module) { /*

while it should be:

cordova.define("org.apache.cordova.startapp.startapp", function(require, exports, module) { /*

After manual correction, plugins works as a charm, so thank you for that ๐Ÿ‘

ActivityNotFoundException on Android when trying to start activity

Hello,

First of all, thanks for this wonderful and convenient plugin - it made my life a lot easier!

I have a Cordova app that is attempting to launch the Evernote native app. I can launch the Evernote app from inside my app successfully with the following code:

navigator.startApp.start([["com.evernote"]], function(message) { 
    alert(message);  
}, function(error) { 
    alert(error);
});

However, when I try to pass an activity, I get an ActivityNotFoundException. The code I use is:

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

The error message I get is:

"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?"

The Evernote activity is based on Evernote documentation (https://dev.evernote.com/doc/articles/android_intents.php).

Could you advise how I can resolve this issue? Do I need to make changes to my config.xml or AndroidManifest.xml? I have not dealt with making changes to AndroidManifest.xml and not sure what changes, if any, I need to make.

Thanks,
Mohammad

Phonegap and startapp

Hi.
Is it possible to run startapp with Phonegap 5.3.6?
I get "TypeError: Cannot read property 'check' of undefined"
Same goes for for "start"

The plugin seems to be installed. "com.lampa.startapp 0.0.4 "startApp""" when listing installed plugins.

Thanks.
/D

cordova.define being imported twice.

Hi,

Cheers for all your work on this plugin!
I've noticed an error on my project with recent updates.=

Cordova seems to be importing/defining the module twice.
The resulting startApp.js plugin in the platforms has the first 2 lines

cordova.define("com.lampa.startapp.startapp", function(require, exports, module) {
cordova.define("com.lampa.startapp.startApp", function(require, exports, module) {

In my source plugins folder the startApp.js already contains the cordova.define statement.
Which cordova is then adding again..
There is no startApp.manually.js file either - But it seems like this is the one being imported from the plugin manager.

Any ideas?

Cheers,

Jamie

Cannot open external app on android

Hi,

I am trying to open the external app from my application, but cannot do so. The error I am getting is -

Uncaught TypeError: Object com.concur.breeze has no method 'apply' cordova.js:293
cordova.callbackFromNative cordova.js:293
processMessage cordova.js:1081
processMessages

I am using cordova version 5.1.1

The sample code which is -

sApp = startApp.set({ /* params */
                "action":"ACTION_MAIN",
                "package":"com.concur.breeze",
                "component": ["com.concur.breeze"],
                "intentstart":"startActivity"
            }, { /* extras */

            });

Alternatively link to the app is https://play.google.com/store/apps/details?id=com.concur.breeze&hl=en.
Any help would be highly appreciated.

Regards,
Deepak

Uber Example

Hi - thanks for your efforts on this it looks great.

Can you please provide an example for how to launch the Uber app with deep linking to ride requests and optional parameters? This seems straightforward for iOS but I can't figure out what the options for android need to be.

https://developer.uber.com/docs/deep-linking

Message to propose to install the external app

Hi,
actually my app run corretly whan I press a button that lauch an external app (bambuser) with the following code:
<a href="#" class="btn" onclick='navigator.startApp.start("com.bambuser.broadcaster");'>Bambuser</a>
But if bambuser is not installed, nothing occurs.

I want to have a message alert that advise the user that the bambuser is not installed, and pressing the button, open the playstore url in order to install the missing app at https://play.google.com/store/apps/details?id=com.bambuser.broadcaster&hl=en

It's possible that with your plugin?

MaX

Deep Linking with Intents in Android?

I am trying to deep link with this using an argument... not sure why it is not working:

navigator.startApp.start('com.facebook.katana', [{"index":"https://www.facebook.com/GitHub"}],function(message) {
    console.log('Facebook app launched');
}, 
function(error) {
    //App Not available, open in browser
    console.log(error);
    $window.open(url, '_blank', 'location=no')
});

App launches... but I am getting errors (and it only opens to default page, not requested):

D/CordovaLog( 7445): file:///android_asset/www/cordova.js: Line 1059 : processMessage failed: Error: TypeError: Object [object Array] has no method 'apply'
D/CordovaLog( 7445): file:///android_asset/www/cordova.js: Line 1060 : processMessage failed: Stack: TypeError: Object [object Array] has no method 'apply'
D/CordovaLog( 7445):     at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:293:54)
D/CordovaLog( 7445):     at processMessage (file:///android_asset/www/cordova.js:1054:21)
D/CordovaLog( 7445):     at androidExec.processMessages (file:///android_asset/www/cordova.js:1091:13)

Cannot read property 'set' of undefined

Hello,
I'm writing an app which launch other apps (games) from it - here's my code:

        var app = navigator.startApp.set({
            "package": "com.ea.game.nfs14_row"
        });
        app.start(function(){
            console.log('Game started!');
        }, function(err){
            console.log('Game start failed! ', err);
        });

It's activated on click event via button, but when I click I'm getting an error:

Uncaught TypeError: Cannot read property 'set' of undefined

Earlier, I was trying to use startApp without navigator but that raises me an error that startApp is not defined.

I'm using Intel XDK and I've added plugin via it's window plugin tool by pasting github url - I think it is installed correctly.

Please help!

not working with IOS

Hi, I tried it with IOS but the plugin is not working.
While using navigator.startApp.check(), the error function gives message as false. Can you please suggest the probable issue with this.
Thanks in advance
Piyush
[email protected]

Plugin Not Responding

Hello! im trying to use your plugin on my app, i follow all the installation intructions, but when i try to run this function: navigator.startApp.check("com.example.hello", function(message) { /* success /
console.log(message); // => OK
},
function(error) { /
error */
console.log('47', error);
});

doesn't fire any message to console.

Thanks for your time!

Class not found

hi,
I'm getting this "Class not found" error when running navigator.startApp.start on android 6.0.
Any ideas about this?

plugin not working

hi
am using cordova 3.4 and i installed startAPP plugin through CLI. when i try to call the application am getting error like cannot call method check.
am i miss something?
Thanks
sikkandar

Plugin only works when installing from git

cordova plugin add com.lampa.startapp
installs version 0.0.7 that doesn't work (navigator.startApp is an empty object)

cordova plugin add https://github.com/lampaa/com.lampa.startapp.git
gets version 0.0.6 that work as expected

tried on cordova 6.0.0 and android platform 5.1.1

Startapp now won't run

HI today this plugin won't run anymore. I think that the problem come from the recent cordova upgrade.

I have created a simple demo with ionic in order to a fast test and debug

$ ionic start startapp-demo
$ cd startapp-demo
$ cordova plugin add com.lampa.startapp
$ cordova plugin list
com.lampa.startapp 0.1.4 "startApp"
cordova-plugin-console 1.0.2 "Console"
cordova-plugin-device 1.1.1 "Device"
cordova-plugin-splashscreen 3.2.1 "Splashscreen"
cordova-plugin-statusbar 2.1.2 "StatusBar"
cordova-plugin-whitelist 1.2.1 "Whitelist"
ionic-plugin-keyboard 2.0.1 "Keyboard"

Now copy/paste this code below in the index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->

    <!-- ionic/angularjs js -->
<!--    <script src="lib/ionic/js/ionic.bundle.js"></script>-->

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
<!--
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>
-->
  </head>
  <body ng-app="starter">
        <h1 id="title">Press this button below</h1>

        <!-- Firefox - Start -->
        <script>
            function launchFirefox() {
            var scheme;
            if (device.platform === 'iOS') {
                scheme = 'firefox://';
            } else if (device.platform === 'Android') {
                scheme = 'com.google.android.calendar';
            } else if (device.platform === 'wp') {
                scheme = 'firefox:';
            } else if (device.platform === 'windows8') {
                scheme = 'firefox:';
            }
            navigator.startApp.check(scheme, function(message) { /* success */
                navigator.startApp.start(scheme, function(message) {
                }, function(error) { /* error */
                    alert("I can't run Firefox);
                });
            }, function(error) {
                alert("Firefox is missing. Now we proceed to install it");
                window.open('https://play.google.com/store/apps/details?id=org.mozilla.firefox', '_system', 'location=no');
            });
        } 
        </script>     

        <a href="#" 
        class="btn" 
        onclick='launchFirefox();' >
        Firefox
        </a>   
        <!-- Firefox - end -->    

  </body>
<style>
#test2 {
    color: #387ef5;
    background: red;
    padding: 20px;
    color: white;
    text-decoration: inherit;
    font-size: 30px;
    position: absolute;
    top: 60%;
    left: 50%;
    margin-left: -100px;
    width: 200px;
    text-align: center;
}     
.btn {
    color: #387ef5;
    background: red;
    padding: 20px;
    color: white;
    text-decoration: inherit;
    font-size: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -100px;
    width: 200px;
    text-align: center;
} 
h1#title {
    position: absolute;
    top: 30%;
    text-align: center;
    width: 100%;
}    
</style>  
</html>

...add the platform android:


$ cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: com.ionicframework.startapp276416
    Name: startapp
    Activity: MainActivity
    Android target: android-23
Android project created with [email protected]
Installing "com.lampa.startapp" for android
Installing "cordova-plugin-console" for android
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-splashscreen" for android
Installing "cordova-plugin-statusbar" for android
Installing "cordova-plugin-velda-devicefeedback" for android
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "ionic-plugin-keyboard" for android
Running command: /home/max/startapp-demo/hooks/after_prepare/010_add_platform_class.js /home/max/startapp-demo
add to body class: platform-android

Now install it in the real phone device with

$ cordova run android

x startapp

In previus versions the app, run the external firefox app, and if not present, run the playstore app in the firefox page in order tu install it.

But today won't run.

The android components are updated at today version
my mobile is a motog2 with original android 6.0

$ cordova -v
6.1.1
$ npm -v
2.15.0
$ ionic -v
1.7.14

Start an external app with component [Shazam app]

Hi guys,
I would like start a class recognition for shazam app with this parameters:

var sApp = startApp.set({
    "component": ["com.shazam.android", "com.shazam.android.intent.actions.START_TAGGING"]
});
sApp.start(function() { /* success */
    console.log("OK");
}, function(error) { /* fail */
    alert(error);
});

But there is an error :( How I can resolve?

img-20160507-wa0003

Set a new Alarm Clock

Hi guys,
it is possible set a new alarm clock like this?
http://stackoverflow.com/questions/8664670/how-to-launch-alarm-clock-screen-using-intent-in-android

I tried but when pressed button there is an error "NoSuchFieldException: ACTION_SET_ALARM"

This is my code example:

      var sApp = startApp.set({ /* params */
          "action":"ACTION_SET_ALARM",
          "intentstart":"startActivity",
      }, { /* extras */
          "EXTRA_MESSAGE":"Nuova sveglia Deneb",
          "EXTRA_HOUR":"12",
          "EXTRA_MINUTES":"00"
      });

      sApp.start(function() { /* success */
          console.log("OK");
      }, function(error) { /* fail */
          alert(error);
      });

How can I get the parameters

Dear,

I have two cordova apps BMIapp and receiveApp. I want to pass the parameters form BMIapp to receiveAPP.
Using the navigator.startApp.start and took a parameter, it can be launched the receiveAPP.
I just wrote code in BMIapp, as below:

navigator.startApp.start([
    ["com.android.receiveApp", "com.android.receiveApp.MainActivity"],
    [{"product_id":"100"}]
], function (message) {
    console.log("Launch App Success: " + message);
}, function (error) {
    console.log("Launch App Error: "+ error);
});

But, I don't know that how can I get the parameters in receiveApp. Am I write something in receiveApp to get the param ??

Ryant

add version to check

Add this:

navigator.startApp.check("com.application.name", function(message) { /* success */
    console.log(message); // => {'appname':'Navigator', 'versionCode':'0.0.1', 'versionApp':'0.0.1'...}
}, 
function(error) { /* error */
    console.log(error);
});

Open phone call history ?

Hello,

I known it's possible to run "tel://0123456789" scheme to call the number, but I would like to only open the tel application, without any number.

The goal is to permit to the user to go quickly in his call history.

May be with your plugin we can call something like "com.apple.tel", but I don't known the exact ID to open it :-/

Thanks for your help :)

TypeError when calling trying to call plugin methods

Hi,
When trying to call navigator.startApp.check(...) I get the following error:
TypeError: Cannot read property 'check' of undefined

When debugging, I found out that startApp isn't resolved.
However, a week ago it still worked and I have no idea what might have changed since then.

Any ideas on that?

Regards,
Colin

platform windows not supported.

your plugin is really awesome. my application run on android, ios, windows. Using your plugin I can open another app on android and ios. but not in windows. So please help me to solve this issue.

IOS cordova 3.3

Hello i am trying to call the plugin always returns 47 false

function show() {
    navigator.startApp.start("twitter://", function(message) { /* success */
        console.log(message); // => OK
    }, 
    function(error) { /* error */
        console.log('47', error);
    });
 }

i am interested in open major social apps from my app can you please post HTML test code
thanks
Abdul

IOS support

does it support ios 6 and above? with cordova 3.4

Unable to pass the parameters when starting the app

I got the following code to check app and start the app if available. I am able to open the app but the parameters aren't passed. Am I missing something here?

navigator.startApp.check(appURL, function(message){
    // success checking
    console.log("The app is available in your Android device. Response Message: " + message + "!!");
    navigator.startApp.start([appURL, [
        {"store_name" : store_name},
        {"store_number" : store_id},
        {"state" : state},
        {"city" : city}
    ]], function(message){
        // Success starting
        console.log("Opening app on your Android device. Message: " + message);
    }, function(error){
        console.error("Unable to open the app on your Android device. Message: " + error);
    });
},
function (error) {
    console.error("The app is not available in your Android device!!! Message : " + error);
});

cordova 3.5

i'm using cordova 3.5 and build for android , navigator.startApp return undefine, Please help me

Receiving Data's

in ionic i want to send some text to print on android. how to receive that text on android app on specific activity

Open itunes on ipad

Hi, your project save my day, but i have one problem that i can not solve. Can you show me example on how can i launch itunes app inside other app? Thanks in advance )

Can't get the plugin to work in iOS 9.2

This code works fine on Android (by replacing "twitter://" by "com.twitter.android"), but on iOS, even though Twitter is installed, it always goes to the second function (error), like if the app was not installed.

           var scheme, storeUrl;

           scheme = 'twitter://';
           storeUrl = 'https://itunes.apple.com/fr/app/twitter/id333903271?mt=8';

            navigator.startApp.check(scheme, function(message) {
                window.open(scheme);
            },
            function(error) {
                // Open the App Store/Google Play
                console.log('app ' + scheme + ' doesn\'t exist on this device');
                Utils.openLinkInBrowser(storeUrl);
            });

Any idea?

LaunchIntent.putExtra converted to string

Hi,

Actually every extra is converted to String. As Java is typed it can bug for the launched app.
Here a quick dirty fix for Boolean :
@startApp.java#L163

value = extra.getString(key);
// fix boolean converted to string
if( value == "true" || value == "false" ){
    LaunchIntent.putExtra(parseExtraName(key), Boolean.parseBoolean(value));
} else {
    LaunchIntent.putExtra(parseExtraName(key), value);
}

I have no fork to pull request sorry.

With this I can transfer boolean value like this :

var sApp = startApp.set({ 
    'package':'com.lampa.startapp'
}, { 
    'exempleExtra':true
});

A better fix should handle number, int, boolean, ... ;)

Opening native components

Is it possible to launch native apps using this plugin?

E.g. I would like to open system's sms, contacts or video player from my app?

Install via Phonegap Build?

This is searchable on the npm registry but including it in the config.xml file doesn't seem to be enough to build my app on PGB with this plugin included. Ideally I would add a line like the following to config.xml:

<plugin name="com.lampa.startapp" version="0.0.6" />

Any suggestions?

Using since updated

Hi,

I've used your plugin for some time now. However for some reason I can't get it to function since the syntax changed. I used to use:

navigator.startApp.start("uk.org.nice.bnfc");

Based on the documentation I'm now trying to use:

var startBNF = startApp.set({
            "action": "ACTION_VIEW",
            "package": "uk.org.nice.bnfc"
        }).start();

Is this correct? If so, any ideas why it wouldn't be working?
Thanks for your help.

StartApp plugin is not registred on Phonegap repository

Hi, I'm trying to build a phonegap application that uses Statapp to call another application but when I try to build it from https://build.phonegap.com/apps I got the error message "plugin unsupported: org.apache.cordova.startapp @ 0.3.0".

I guess it happens because your plugin is not registred in Phonegap 3rd party plugins, any thoughts if and when will you register it?

Thanks.

Skype call issue

If I want to open skype and call directly then what will be the "key" and "value" ? please help me.

navigator.startApp.start([
    "com.skype.raider", 
    "com.skype.raider.Main",
    "", // what key should be?
    "" // what value should be?
], function(message) { 
    console.log(message); // => OK
}, 
function(error) { 
    console.log('47', error);
});

No feedback if the app isn't on user's device

It would be nice if the javascript call would return a true or false, dependent on if the app exists or not.

If I am JavaScript, I have no clue if the app I asked to open was opened or not, so I couldn't tell the user that the app is not available or not installed.

iOS 9 issue

  if(device.platform === 'iOS') {
            scheme = 'instagram://';
        }
        else if(device.platform === 'Android') {
            scheme = 'com.instagram.android';
        }
navigator.startApp.start(scheme, function(message) {  /* success */
                            console.log(message); // => OK
                        }, 
                        function(error) {  /* error */
                            console.log(error);
                        });

still getting error after update for iOS9

i did a test, before the update works fine, after get only error.

Issue opening Uber in iOS 9.3

Hi!

First, thanks a lot for this plugin!

I have Cordova 6.1, latest Xcode, and when I try:

startApp.set("uber://").start();

I get the follwing error:

2733:1906788] -canOpenURL: failed for URL: "uber://" - error: "This app is not allowed to query for scheme uber"

How do I apply for permissions?

Thanks a lot!!

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.