From 23b760bb0162f27f4dfeea2d99968b62acdbe5d9 Mon Sep 17 00:00:00 2001 From: mcelotti Date: Thu, 12 Apr 2018 17:09:19 +0200 Subject: [PATCH] fix(web-intent): fix options param (#2450) * fix(web-intent): fix options param for startService, sendBroadcast, startActivityForResult, startActivity * Update index.ts * Update index.ts --- src/@ionic-native/plugins/web-intent/index.ts | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/@ionic-native/plugins/web-intent/index.ts b/src/@ionic-native/plugins/web-intent/index.ts index f435afa19..5aeebc54d 100644 --- a/src/@ionic-native/plugins/web-intent/index.ts +++ b/src/@ionic-native/plugins/web-intent/index.ts @@ -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} */ @Cordova() - startActivity(options: { - action: any; - extras?: any; - url: string; - type?: string; - }): Promise { + startActivity(options: IntentOptions): Promise { 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} */ @Cordova() - startActivityForResult(options: { - action: any; - url: string; - type?: string; - }): Promise { + startActivityForResult(options: IntentOptions): Promise { 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} */ @Cordova() - sendBroadcast(options: { - action: string; - extras?: { option: boolean }; - }): Promise { + sendBroadcast(options: IntentOptions): Promise { return; } /** * Request that a given application service be started - * @param options {Object} { action: string, extras?: { option: boolean } } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startService(options: { - action: string; - extras?: { option: boolean }; - }): Promise { + startService(options: IntentOptions): Promise { return; }