Giter Site home page Giter Site logo

cordova-plugin-app-launcher's Introduction

GitHub NPM StackOverflow

Twitter LinkedIn

cordova-plugin-app-launcher's People

Contributors

hewittv avatar mmey3k avatar mrmasterix avatar nchutchind 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-app-launcher's Issues

Loop in iOs, canLaunch

I use "canLaunch" and when it make success, the "launch" function open e-mail in iOs smartphone.
In this e-mail, there is a url for open my app (for confirm address). If i tap it, the system open my app, but it call "canLaunch", without I say to do, and it call mail again, in infinite loop.

Difference between Android 10 and 11

Hi,
I'm using the code below to open and pass parameters to another application.

window.plugins.launcher.launch({packageName:'com.vjnicacio.detksign'}, successCallback, errorCallback);

On Android 10 the aperture works, but not the parameters.
And on Android 11, it doesn't even work the opening informing.
Giving the error below Activity not found for package name.

Design question and enhancement.

I'm working on adding some features to a cordova app that's not available through cordova hybrid app. So what I want to do is use your launcher to call a java library I've built and included my aar file in the android build project. Called the activity with intent extra data, this works fine. Now I want to do the same thing for IOS. Is this possible or will your plugin need some modifications to do this. I have not yet coded the IOS library.

Launch app itself

Can i use this to launch my app itself? For example my app was force closed and there was a trigger that will launch my app.
Also, how can i find my app's URI?

Open email apps (gmail, outlook)

I am using this

var filename =
"https://mail.google.com/mail/u/0/fs=1&[email protected]&su=SUBJECT&body=BODY&[email protected]&tf=cm";

                    window.plugins.launcher.launch({
                                             packageName: 'com.google.android.gm',
                                             uri: filename, successCallback, errorCallback
                               });

to open gmail compose screen, but its not opening. Getting Erro! Application not found for uri.

same app

when open in other cordova app.. create new webview in the same app

build failed (iOS)

hello, work fine on android but trying to build my app for iOS it give this
build failed
error code 65

/Users/daren/myapp/platforms/ios/myapp/Plugins/com.hutchind.cordova.plugins.launcher/Launcher.m:14:40: No visible @interface for 'CDVPluginResult' declares the selector 'toSuccessCallbackString:'

/Users/daren/myapp/platforms/ios/myapp/Plugins/com.hutchind.cordova.plugins.launcher/Launcher.m:17:40: No visible @interface for 'CDVPluginResult' declares the selector 'toErrorCallbackString:'

/Users/daren/myapp/platforms/ios/myapp/Plugins/com.hutchind.cordova.plugins.launcher/Launcher.m:21:39: No visible @interface for 'CDVPluginResult' declares the selector 'toErrorCallbackString:'

/Users/daren/myapp/platforms/ios/myapp/Plugins/com.hutchind.cordova.plugins.launcher/Launcher.m:35:40: No visible @interface for 'CDVPluginResult' declares the selector 'toSuccessCallbackString:'

/Users/daren/myapp/platforms/ios/myapp/Plugins/com.hutchind.cordova.plugins.launcher/Launcher.m:38:40: No visible @interface for 'CDVPluginResult' declares the selector 'toErrorCallbackString:'

/Users/daren/myapp/platforms/ios/myapp/Plugins/com.hutchind.cordova.plugins.launcher/Launcher.m:42:39: No visible @interface for 'CDVPluginResult' declares the selector 'toErrorCallbackString:'

How to get data back from the opened app?

Thanks for this wonderfuI plugin!!. I am able to navigate to and fro between two apps flawlessly but how to get the data from one app to another.

In the provided mx player example ,json.extras has lots of attributes(end_by, position,duration) coming from mxplayer but how could I send these attributes from mxplayer.
I want to achieve same functionality with my app A which is calling app B. But how to get data back from app B to app A.

Any help would be really appreciated!!
Thanks!!

plugin unsupported in phonegap

I have deloped one app in PhoneGap using this plugin i have tested and it's fine but when i try to build using PhoneGap build using my PhoneGap adobe id it shows me this error plugin unsupported: com.hutchind.cordova.plugins.launcher .
Does anyone have sloution?

App not launching in ios

I am trying to launch one app from another app. But it's not working in ios.

I have two apps 'A' and 'B'. Url scheme of app 'B' is ' xyz '. If I used Url scheme of app 'B' in safari then it opens that app. But when I try to do it from app 'A' using following method, it gives error of app not being installed:

window.plugins.launcher.launch({uri:"xyz://"},
function(json){//alert("Success : "+ json)
},
function(err){alert("Install App.")});

I would like to know what I am doing wrong in this.

Application crashes on opening

Hello, I am using the plugin to open bank applications to assist with payments.
When I perform the "launch" function the application opens but crashes the whole system (even the message "System UI has stopped" appears).

"cordova-android": "^7.1.4",
"cordova-plugin-app-launcher": "git+https://github.com/nchutchind/cordova-plugin-app-launcher.git",

Device: Samsung Galaxy A8 (Android 9)

I tried to find references from people who had the same problem, but found nothing to help.
Can someone help me?

Twitter

uri:'facebook://' works fine on iOS and Android
uri:'twitter://' works fine on iOS
packageName:'com.twitter.android' works fine on Android.

Can anybody tell me why uri:'twitter://' doesn't work on Android? When opening mobile.twitter.com an icon is shown pointing to twitter:// so you would expect it to work, right?

canLaunch is not working properly in iOS

Hi I am using this plugin with my react code in cordova. I wanted to Check which browsers are installed on iOS device so I used canLaunch method with my URL but I didn't get appList in response.

ionic 5 and capacitor 3 this plugin is not launching another app from base app

Currently i am using ionic5 with capacitor3 . i want to open workday app within my app. i checked with appAvailability plugin it returns true or false based on app installed or not. i installed workday and trying to launch from my app. its not opening any app not only workday i tried with whatsapp and calendar too.
No errors also.. Please help us to solve this ASAP.

Cordova >= 7 cannot install plugin

Hello,

After I updated cordova to 7.0.1 the plugin cannot be installed because cordova cannot find it on npm registry.

"Error: Failed to fetch plugin com.hutchind.cordova.plugins.launcher@~0.3.0 via registry."

I think this can be fix by registering the plugin to https://www.npmjs.com/.
Thank you.

app launched more than 1 times

Hello, I have 2 apps. Both have singleInstance in androidmanifest.xml.
One is a cordova app (that uses this plugin) and the other one is a flutter app.
If I call the cordova app from flutter app, the cordova app is opened only 1 time, and if it's already running the focus goes on it without opening a second instance (of course because I have singleInstance).
If i call the flutter app from cordova app using this plugin, the flutter app is opening even if a previous instance is already running, and the new instance is "included" in my cordova app, so I have 2 flutter apps. This is a problem for me, I need to have only 1 instance. Where can be the problem?

Error Application is not installed

Hello,

I try to launch com.android.packageinstaller to install file.apk

my code is

var sdcard = "file:///sdcard/apk/";
var file1 = sdcard + "myapp.apk";

var successCallback = function(data) {
alert("Success!");
};
var errorCallback = function(errMsg) {
alert("Error! " + errMsg);
}

window.plugins.launcher.canLaunch({
    packageName:'com.android.packageinstaller',
    uri:file1,
}, successCallback, errorCallback);

When I run the command I've got error msg

"Error Application is not installed"

Please suggest

launcher add support for return info from app

Hello,

I would like to be able to pass extras to the app and get the returned info from the app.
Things like video Position , play lists , ect...

Return info would include position , video duration , play complete .. ect ..

See below info for the player ...

I am using android and phonegap build site

The app I would like to start with is the MX player ...
I have attached the extras request parameters ...

Thanks
Michael T.

API - Intent definition
Intent definition to launch playback activity of MX Player. Also check sample codes attached below.

Unlike its page name, this is not actually an API definition but just an Intent definition for playing back videos through MX Player.

Using this Intent definition,

You CAN;

Play single or multiple videos.
Provide subtitles to be drawn together.
Select decoder and simple options such as video zoom, etc.
Receive playback result including whether it is completed or not, last playback position, etc.

You CANNOT;

Play or pause playback.
Touch user interface.
Change playback options except provided ones.
Change settings.
Access native features of MX Player such as extracting thumbnails, search videos, etc.

[Supported Version]

Since 1.6

[Package]

com.mxtech.videoplayer.pro - Pro Edition

com.mxtech.videoplayer.ad - Free Edition.

[Action: android.intent.action.VIEW]

Data: 

    Uri pointing to a media source.

Extras: 

    (All extras are optional)

    decode_mode

    Type: byte

    Values: 1 - h/w decoder 2 - s/w decoder


    fast_mode

    Type: boolean

    Values: true to use s/w fast mode when s/w decoder is seelcted.

    Fast mode is deprecated. Even though this can improve decoding speed in some cases, there are also chances degrade video output quality. It is not recommended at all.

    video_list

    Type: parcelable array (android.net.Uri[])

    Values: video play list including uri provided on Data.

    To prevent loading next file automatically, provide single sized array having only "Data".

    The uri used as the Intent data should be included in the video_list either.
    For example, to play 1.mp4, 2.mp4, 3.mp4 in sequence, set data to 1.mp4 and put { 1.mp4, 2.mp4, 3.mp4 } to video_list.

    If uri points to a file, it should be canonicalized. See File.getCanonicalPath.

    video_list.name  Added in 1.7.31
    Type: String[]
    Values: Custom video titles for each videos in video_list to be displayed to users.

    Array should have same size as video_list. Array elements can point to null instead of valid string. In this case, default name will be used.

    If video_list.name and title is provided together, video_list.name will be used and title will be ignored.

    subs

    Type: parcelable array (android.net.Uri[])

    Values: subtitle list used for given video uri (in data field)

    subs.name  Added in 1.7.31

Type: String[]
Values: Custom subtitle names to be displayed to users.

Array should have same size as subs. Array elements can point to null instead of valid string. In this case, default name will be used.

Even if this extra is provided, custom name will not be used for subtitles defining name inside script or containing multiple tracks in a script file such as SAMI subtitles.


    subs.enable  Added in 1.6e
    Type: parcelable array (android.net.Uri[])
    Values: Initially visible subtitles.

    In the following cases, subtitle URI is different from file URI since single file can contain multiple subtitle tracks.

        SAMI Subtitles: {file-uri}#{track-name} ex) file:///sdcard/movie1.smi#encc

    title

    Type: String

    Values: video title text.

    position

    Type: int

    Values: resume position in milliseconds. presence of this extra forces to resume given position not giving user a chance to play from the beginning.

    return_result

    Type: boolean

    Values: set true to receive resulting intent through Activity.onActivityResult() call.

    headers  Added in 1.7.11
    Type: String[]
    Values: the headers to be sent together with the request for the uri.

    Key and value should appear in turn. e.g) String[] headers = { "User-Agent", "Mozilla compatible/1.0", "Extra-Header", "Extra-header-value" };

    This feature has limitation if used for HW decoder; 1) It only works with Android 2.2 and above. 2) Before Android 4.0, default header cannot be overriden. For example, if you pass "User-Agent", it will not replace default User-Agent to given value but default and given header will be passed altogether.

    suppress_error_message  Added in 1.7.14
    Type: boolean
    Value: If set to true and error occurs, activity will play next video or close itself not showing error message.

    secure_uri   Added in 1.7.14
    Type: boolean
    Value: If set to true, video uri will not be displayed in the property dialog box.

    video_zoom   Added in 1.7.23
    Type: int
    Value: Override video zoom setting. Available values are: Fit to screen=1, Stretch=0, Crop=3, 100%=2

    DAR_horz, DAR_vert  Added in 1.7.23
    Type: float
    Value: Override default DAR(display aspect ratio). Both extras should be provided together.

    sticky  Added in 1.7.23
    Type: boolean
    Value: Override background play setting.

[Result: com.mxtech.intent.result.VIEW]

Code:

    Activity.RESULT_OK : when playback was completed or stoped by user request.

Data:

    last played video uri. 

Extras:
decode_mode
Type: byte
Value: Used decoding mode

position
Type: int
Value: Last playback position in milliseconds. This extra will not exist if playback is completed.

duration  Added in 1.7.23
Type: int
Value: Duration of last played video in milliseconds. This extra will not exist if playback is completed.

end_by  Added in 1.7.19
Type: String
Value: Indicates reason of activity closure. Can be one of following values:

    "user": User requested to leave activity.
    "playback_completion": All playback completed.

[MIME Type]

By setting proper MIME type, you can avoid ActivityNotFoundException exception regardless of passing URI.

Even if MIME type is not provided, Intent can be delivered to MX Player depending on the file extension of Intent uri(data). Most popular extensions are supported including avi, mkv, mp4, 3gp, asf, divx, flv, ts, wmv and so forth.

*CAVEAT: For http/https URIs, result will not be returned unless directly specifying activity class name by calling Intent.setClassName(). Class name for free edition is com.mxtech.videoplayer.ad.ActivityScreen and pro edition is com.mxtech.videoplayer.ActivityScreen.     

For example,

    Intent intent = new Intent(Intent.ACTION_VIEW);

    Uri videoUri = Uri.parse("http://host:port/playlist.m3u8");

    intent.setDataAndType( videoUri, "application/x-mpegURL" );

    intent.setPackage( "com.mxtech.videoplayer.pro" );

    startActivity( intent );


Supported MIME types:

    video/*

    */rmvb

    */avi

    */mkv

    application/sdp

    application/mp4

    application/mpeg*

    application/ogg
    application/x-ogg

    application/vnd.rn-realmedia*

    application/3gpp*

    application/vnd.3gp*

    application/vnd.dvd*

    application/vnd.dolby*

    application/x-mpegURL

    application/vnd.apple.mpegurl

    application/x-quicktimeplayer
    application/x-shockwave-flash

Plugin not able to check app availability in Android 11 devices

Plugin is not able to check if app is installed in Android 11 devices using either package name or custom URI scheme. Tested and working on all devices running in lower versions of android.

Error:

2021-09-27 14:47:31.772 19270-19666/com.invokerApp D/Launcher Plugin: No Activities found that handle uri: sampleApp://

Issue In Usage

There is an issue in 3rd step(window.plugins.launcher.launch()).
It should be called like this,
var launcher = new Launcher(); // create launcher object as function launch is private
launcher.launch({packageName:'com.facebook.katana'}, successCallback, errorCallback);

Nexus 6 + Android 7.1.1 back button Error

Pressing the back button on Nexus 6 + Android 7.1.1 will generate an error

E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(org.json.JSONObject)' on a null object reference
E AndroidRuntime: at com.hutchind.cordova.plugins.launcher.Launcher.onActivityResult(Launcher.java:475)
E AndroidRuntime: at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:152)
E AndroidRuntime: at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:358)
E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:6932)
E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:4085)
E AndroidRuntime: ... 11 more

In Nexus 6, launching the application in launcher.launch starts with a single task
Pressing the back button in this state will generate onActivityResult
Application is crashing with callback.success because callback is NULL

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
	super.onActivityResult(requestCode, resultCode, intent);
	if (callback == null) {
		return;
	}

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.