fix(web-intent): fix options param (#2450)
* fix(web-intent): fix options param for startService, sendBroadcast, startActivityForResult, startActivity * Update index.ts * Update index.ts
This commit is contained in:
parent
84e0aa1f94
commit
23b760bb01
@ -2,6 +2,20 @@ import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IntentOptions {
|
||||
requestCode?: number;
|
||||
type?: string;
|
||||
package?: string;
|
||||
url?: string;
|
||||
extras?: object;
|
||||
action?: string;
|
||||
component?: {
|
||||
package: string;
|
||||
class: string;
|
||||
};
|
||||
flags?: number[];
|
||||
};
|
||||
|
||||
/**
|
||||
* @name Web Intent
|
||||
* @description
|
||||
@ -25,6 +39,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
* this.webIntent.startActivity(options).then(onSuccess, onError);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* IntentOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'WebIntent',
|
||||
@ -97,30 +113,21 @@ export class WebIntent extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Launches an Android intent
|
||||
* @param options {Object} { action: any, url: string, type?: string }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startActivity(options: {
|
||||
action: any;
|
||||
extras?: any;
|
||||
url: string;
|
||||
type?: string;
|
||||
}): Promise<any> {
|
||||
startActivity(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a new activity and return the result to the application
|
||||
* @param options {Object} { action: any, url: string, type?: string }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startActivityForResult(options: {
|
||||
action: any;
|
||||
url: string;
|
||||
type?: string;
|
||||
}): Promise<any> {
|
||||
startActivityForResult(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -166,27 +173,21 @@ export class WebIntent extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Sends a custom intent passing optional extras
|
||||
* @param options {Object} { action: string, extras?: { option: boolean } }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sendBroadcast(options: {
|
||||
action: string;
|
||||
extras?: { option: boolean };
|
||||
}): Promise<any> {
|
||||
sendBroadcast(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request that a given application service be started
|
||||
* @param options {Object} { action: string, extras?: { option: boolean } }
|
||||
* @param options {IntentOptions}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startService(options: {
|
||||
action: string;
|
||||
extras?: { option: boolean };
|
||||
}): Promise<any> {
|
||||
startService(options: IntentOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user