Web Intent

Improve this doc

$ ionic plugin add https://github.com/Initsogar/cordova-webintent.git
$ npm install --save @ionic-native/web-intent

Repo: https://github.com/Initsogar/cordova-webintent.git

Supported platforms

Usage

For usage information please refer to the plugin's Github repo.

import { WebIntent } from '@ionic-native/web-intent';

constructor(private webIntent: WebIntent) { }

...

const options = {
  action: this.webIntent.ACTION_VIEW,
  url: 'path/to/file',
  type: 'application/vnd.android.package-archive'
};

this.webIntent.startActivity(options).then(onSuccess, onError);

Instance Members

ACTION_SEND

Convenience constant for actions

ACTION_VIEW

Convenience constant for actions

EXTRA_TEXT

Convenience constant for extras

EXTRA_SUBJECT

Convenience constant for extras

EXTRA_STREAM

Convenience constant for extras

EXTRA_EMAIL

Convenience constant for extras

ACTION_CALL

Convenience constant for actions

ACTION_SENDTO

Convenience constant for actions

startActivity(options)

Launches an Android intent

Param Type Details
options Object

{ action: any, url: string, type?: string }

Returns: Promise<any>

hasExtra(extra)

Checks if this app was invoked with specified extra

Param Type Details
extra string

Returns: Promise<any>

getExtra(extra)

Gets the extra that this app was invoked with

Param Type Details
extra string

Returns: Promise<any>

getUri()

Gets the Uri the app was invoked with

Returns: Promise<any>

onNewIntent()

Returns: Observable<string>

sendBroadcast(options)

Sends a custom intent passing optional extras

Param Type Details
options Object

{ action: string, extras?: { option: boolean } }

Returns: Promise<any>

API

Native

General