@capacitor/app 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +16 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java +9 -0
- package/dist/esm/definitions.d.ts +8 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/AppPlugin.m +1 -0
- package/ios/Plugin/AppPlugin.swift +4 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app@1.0.7...@capacitor/app@1.1.0) (2022-01-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **android:** support for minimizeApp ([#743](https://github.com/ionic-team/capacitor-plugins/issues/743)) ([3ec2008](https://github.com/ionic-team/capacitor-plugins/commit/3ec2008bc0311c837346ecbdd0afd105149b427a))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.0.7](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app@1.0.6...@capacitor/app@1.0.7) (2021-12-08)
|
|
7
23
|
|
|
8
24
|
|
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ const checkAppLaunchUrl = async () => {
|
|
|
75
75
|
* [`getInfo()`](#getinfo)
|
|
76
76
|
* [`getState()`](#getstate)
|
|
77
77
|
* [`getLaunchUrl()`](#getlaunchurl)
|
|
78
|
+
* [`minimizeApp()`](#minimizeapp)
|
|
78
79
|
* [`addListener('appStateChange', ...)`](#addlistenerappstatechange)
|
|
79
80
|
* [`addListener('appUrlOpen', ...)`](#addlistenerappurlopen)
|
|
80
81
|
* [`addListener('appRestoredResult', ...)`](#addlistenerapprestoredresult)
|
|
@@ -151,6 +152,21 @@ Get the URL the app was launched with, if any.
|
|
|
151
152
|
--------------------
|
|
152
153
|
|
|
153
154
|
|
|
155
|
+
### minimizeApp()
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
minimizeApp() => Promise<void>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Minimizes the application.
|
|
162
|
+
|
|
163
|
+
Only available for Android.
|
|
164
|
+
|
|
165
|
+
**Since:** 1.1.0
|
|
166
|
+
|
|
167
|
+
--------------------
|
|
168
|
+
|
|
169
|
+
|
|
154
170
|
### addListener('appStateChange', ...)
|
|
155
171
|
|
|
156
172
|
```typescript
|
package/android/build.gradle
CHANGED
|
@@ -105,6 +105,15 @@ public class AppPlugin extends Plugin {
|
|
|
105
105
|
call.resolve(data);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
@PluginMethod
|
|
109
|
+
public void minimizeApp(PluginCall call) {
|
|
110
|
+
Intent startMain = new Intent(Intent.ACTION_MAIN);
|
|
111
|
+
startMain.addCategory(Intent.CATEGORY_HOME);
|
|
112
|
+
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
113
|
+
getActivity().startActivity(startMain);
|
|
114
|
+
call.resolve();
|
|
115
|
+
}
|
|
116
|
+
|
|
108
117
|
/**
|
|
109
118
|
* Handle ACTION_VIEW intents to store a URL that was used to open the app
|
|
110
119
|
* @param intent
|
|
@@ -146,6 +146,14 @@ export interface AppPlugin {
|
|
|
146
146
|
* @since 1.0.0
|
|
147
147
|
*/
|
|
148
148
|
getLaunchUrl(): Promise<AppLaunchUrl | undefined>;
|
|
149
|
+
/**
|
|
150
|
+
* Minimizes the application.
|
|
151
|
+
*
|
|
152
|
+
* Only available for Android.
|
|
153
|
+
*
|
|
154
|
+
* @since 1.1.0
|
|
155
|
+
*/
|
|
156
|
+
minimizeApp(): Promise<void>;
|
|
149
157
|
/**
|
|
150
158
|
* Listen for changes in the App's active state (whether the app is in the foreground or background)
|
|
151
159
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface AppInfo {\n /**\n * The name of the app.\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The identifier of the app.\n * On iOS it's the Bundle Identifier.\n * On Android it's the Application ID\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The build version.\n * On iOS it's the CFBundleVersion.\n * On Android it's the versionCode.\n *\n * @since 1.0.0\n */\n build: string;\n\n /**\n * The app version.\n * On iOS it's the CFBundleShortVersionString.\n * On Android it's package's versionName.\n *\n * @since 1.0.0\n */\n version: string;\n}\n\nexport interface AppState {\n /**\n * Whether the app is active or not.\n *\n * @since 1.0.0\n */\n isActive: boolean;\n}\n\nexport interface URLOpenListenerEvent {\n /**\n * The URL the app was opened with.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * The source application opening the app (iOS only)\n * https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey/1623128-sourceapplication\n *\n * @since 1.0.0\n */\n iosSourceApplication?: any;\n /**\n * Whether the app should open the passed document in-place\n * or must copy it first.\n * https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey/1623123-openinplace\n *\n * @since 1.0.0\n */\n iosOpenInPlace?: boolean;\n}\n\nexport interface AppLaunchUrl {\n /**\n * The url used to open the app.\n *\n * @since 1.0.0\n */\n url: string;\n}\n\nexport interface RestoredListenerEvent {\n /**\n * The pluginId this result corresponds to. For example, `Camera`.\n *\n * @since 1.0.0\n */\n pluginId: string;\n /**\n * The methodName this result corresponds to. For example, `getPhoto`\n *\n * @since 1.0.0\n */\n methodName: string;\n /**\n * The result data passed from the plugin. This would be the result you'd\n * expect from normally calling the plugin method. For example, `CameraPhoto`\n *\n * @since 1.0.0\n */\n data?: any;\n /**\n * Boolean indicating if the plugin call succeeded.\n *\n * @since 1.0.0\n */\n success: boolean;\n /**\n * If the plugin call didn't succeed, it will contain the error message.\n *\n * @since 1.0.0\n */\n error?: {\n message: string;\n };\n}\n\nexport interface BackButtonListenerEvent {\n /**\n * Indicates whether the browser can go back in history.\n * False when the history stack is on the first entry.\n *\n * @since 1.0.0\n */\n canGoBack: boolean;\n}\n\nexport type StateChangeListener = (state: AppState) => void;\nexport type URLOpenListener = (event: URLOpenListenerEvent) => void;\nexport type RestoredListener = (event: RestoredListenerEvent) => void;\nexport type BackButtonListener = (event: BackButtonListenerEvent) => void;\n\nexport interface AppPlugin {\n /**\n * Force exit the app. This should only be used in conjunction with the `backButton` handler for Android to\n * exit the app when navigation is complete.\n *\n * Ionic handles this itself so you shouldn't need to call this if using Ionic.\n *\n * @since 1.0.0\n */\n exitApp(): never;\n\n /**\n * Return information about the app.\n *\n * @since 1.0.0\n */\n getInfo(): Promise<AppInfo>;\n\n /**\n * Gets the current app state.\n *\n * @since 1.0.0\n */\n getState(): Promise<AppState>;\n\n /**\n * Get the URL the app was launched with, if any.\n *\n * @since 1.0.0\n */\n getLaunchUrl(): Promise<AppLaunchUrl | undefined>;\n\n /**\n * Minimizes the application.\n *\n * Only available for Android.\n *\n * @since 1.1.0\n */\n minimizeApp(): Promise<void>;\n\n /**\n * Listen for changes in the App's active state (whether the app is in the foreground or background)\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'appStateChange',\n listenerFunc: StateChangeListener,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Listen for url open events for the app. This handles both custom URL scheme links as well\n * as URLs your app handles (Universal Links on iOS and App Links on Android)\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'appUrlOpen',\n listenerFunc: URLOpenListener,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * If the app was launched with previously persisted plugin call data, such as on Android\n * when an activity returns to an app that was closed, this call will return any data\n * the app was launched with, converted into the form of a result from a plugin call.\n *\n * On Android, due to memory constraints on low-end devices, it's possible\n * that, if your app launches a new activity, your app will be terminated by\n * the operating system in order to reduce memory consumption.\n *\n * For example, that means the Camera API, which launches a new Activity to\n * take a photo, may not be able to return data back to your app.\n *\n * To avoid this, Capacitor stores all restored activity results on launch.\n * You should add a listener for `appRestoredResult` in order to handle any\n * plugin call results that were delivered when your app was not running.\n *\n * Once you have that result (if any), you can update the UI to restore a\n * logical experience for the user, such as navigating or selecting the\n * proper tab.\n *\n * We recommend every Android app using plugins that rely on external\n * Activities (for example, Camera) to have this event and process handled.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'appRestoredResult',\n listenerFunc: RestoredListener,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Listen for the hardware back button event (Android only). Listening for this event will disable the\n * default back button behaviour, so you might want to call `window.history.back()` manually.\n * If you want to close the app, call `App.exitApp()`.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'backButton',\n listenerFunc: BackButtonListener,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all native listeners for this plugin\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @deprecated Use `RestoredListenerEvent`.\n * @since 1.0.0\n */\nexport type AppRestoredResult = RestoredListenerEvent;\n\n/**\n * @deprecated Use `URLOpenListenerEvent`.\n * @since 1.0.0\n */\nexport type AppUrlOpen = URLOpenListenerEvent;\n"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,GAAG,GAAG,cAAc,CAAY,KAAK,EAAE;IAC3C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;CACrD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,GAAG,GAAG,cAAc,CAAY,KAAK,EAAE;IAC3C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;CACrD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { AppPlugin } from './definitions';\n\nconst App = registerPlugin<AppPlugin>('App', {\n web: () => import('./web').then(m => new m.AppWeb()),\n});\n\nexport * from './definitions';\nexport { App };\n"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC;QACE,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC;QACE,KAAK,EAAE,CAAC;QA4BF,2BAAsB,GAAG,GAAG,EAAE;YACpC,MAAM,IAAI,GAAG;gBACX,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI;aACnC,CAAC;YAEF,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC,CAAC;QAjCA,QAAQ,CAAC,gBAAgB,CACvB,kBAAkB,EAClB,IAAI,CAAC,sBAAsB,EAC3B,KAAK,CACN,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CASF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { AppInfo, AppPlugin, AppLaunchUrl, AppState } from './definitions';\n\nexport class AppWeb extends WebPlugin implements AppPlugin {\n constructor() {\n super();\n document.addEventListener(\n 'visibilitychange',\n this.handleVisibilityChange,\n false,\n );\n }\n\n exitApp(): never {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getInfo(): Promise<AppInfo> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getLaunchUrl(): Promise<AppLaunchUrl> {\n return { url: '' };\n }\n\n async getState(): Promise<AppState> {\n return { isActive: document.hidden !== true };\n }\n\n async minimizeApp(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n private handleVisibilityChange = () => {\n const data = {\n isActive: document.hidden !== true,\n };\n\n this.notifyListeners('appStateChange', data);\n };\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst App = registerPlugin('App', {\n web: () => import('./web').then(m => new m.AppWeb()),\n});\nexport * from './definitions';\nexport { App };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AppWeb extends WebPlugin {\n constructor() {\n super();\n this.handleVisibilityChange = () => {\n const data = {\n isActive: document.hidden !== true,\n };\n this.notifyListeners('appStateChange', data);\n };\n document.addEventListener('visibilitychange', this.handleVisibilityChange, false);\n }\n exitApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getLaunchUrl() {\n return { url: '' };\n }\n async getState() {\n return { isActive: document.hidden !== true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,GAAG,GAAGA,mBAAc,CAAC,KAAK,EAAE;AAClC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACxD,CAAC;;ACFM,MAAM,MAAM,SAASC,cAAS,CAAC;AACtC,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE,CAAC;AAChB,QAAQ,IAAI,CAAC,sBAAsB,GAAG,MAAM;AAC5C,YAAY,MAAM,IAAI,GAAG;AACzB,gBAAgB,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI;AAClD,aAAa,CAAC;AACd,YAAY,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACzD,SAAS,CAAC;AACV,QAAQ,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC1F,KAAK;AACL,IAAI,OAAO,GAAG;AACd,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAC5D,KAAK;AACL,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAC5D,KAAK;AACL,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AAC3B,KAAK;AACL,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;AACtD,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst App = registerPlugin('App', {\n web: () => import('./web').then(m => new m.AppWeb()),\n});\nexport * from './definitions';\nexport { App };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AppWeb extends WebPlugin {\n constructor() {\n super();\n this.handleVisibilityChange = () => {\n const data = {\n isActive: document.hidden !== true,\n };\n this.notifyListeners('appStateChange', data);\n };\n document.addEventListener('visibilitychange', this.handleVisibilityChange, false);\n }\n exitApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getLaunchUrl() {\n return { url: '' };\n }\n async getState() {\n return { isActive: document.hidden !== true };\n }\n async minimizeApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,GAAG,GAAGA,mBAAc,CAAC,KAAK,EAAE;AAClC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACxD,CAAC;;ACFM,MAAM,MAAM,SAASC,cAAS,CAAC;AACtC,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE,CAAC;AAChB,QAAQ,IAAI,CAAC,sBAAsB,GAAG,MAAM;AAC5C,YAAY,MAAM,IAAI,GAAG;AACzB,gBAAgB,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI;AAClD,aAAa,CAAC;AACd,YAAY,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACzD,SAAS,CAAC;AACV,QAAQ,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC1F,KAAK;AACL,IAAI,OAAO,GAAG;AACd,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAC5D,KAAK;AACL,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAC5D,KAAK;AACL,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AAC3B,KAAK;AACL,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;AACtD,KAAK;AACL,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;AAC5D,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -28,6 +28,9 @@ var capacitorApp = (function (exports, core) {
|
|
|
28
28
|
async getState() {
|
|
29
29
|
return { isActive: document.hidden !== true };
|
|
30
30
|
}
|
|
31
|
+
async minimizeApp() {
|
|
32
|
+
throw this.unimplemented('Not implemented on web.');
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst App = registerPlugin('App', {\n web: () => import('./web').then(m => new m.AppWeb()),\n});\nexport * from './definitions';\nexport { App };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AppWeb extends WebPlugin {\n constructor() {\n super();\n this.handleVisibilityChange = () => {\n const data = {\n isActive: document.hidden !== true,\n };\n this.notifyListeners('appStateChange', data);\n };\n document.addEventListener('visibilitychange', this.handleVisibilityChange, false);\n }\n exitApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getLaunchUrl() {\n return { url: '' };\n }\n async getState() {\n return { isActive: document.hidden !== true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,GAAG,GAAGA,mBAAc,CAAC,KAAK,EAAE;IAClC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACxD,CAAC;;ICFM,MAAM,MAAM,SAASC,cAAS,CAAC;IACtC,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE,CAAC;IAChB,QAAQ,IAAI,CAAC,sBAAsB,GAAG,MAAM;IAC5C,YAAY,MAAM,IAAI,GAAG;IACzB,gBAAgB,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI;IAClD,aAAa,CAAC;IACd,YAAY,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACzD,SAAS,CAAC;IACV,QAAQ,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAC1F,KAAK;IACL,IAAI,OAAO,GAAG;IACd,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC5D,KAAK;IACL,IAAI,MAAM,OAAO,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC5D,KAAK;IACL,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IAC3B,KAAK;IACL,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;IACtD,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst App = registerPlugin('App', {\n web: () => import('./web').then(m => new m.AppWeb()),\n});\nexport * from './definitions';\nexport { App };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AppWeb extends WebPlugin {\n constructor() {\n super();\n this.handleVisibilityChange = () => {\n const data = {\n isActive: document.hidden !== true,\n };\n this.notifyListeners('appStateChange', data);\n };\n document.addEventListener('visibilitychange', this.handleVisibilityChange, false);\n }\n exitApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async getLaunchUrl() {\n return { url: '' };\n }\n async getState() {\n return { isActive: document.hidden !== true };\n }\n async minimizeApp() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,GAAG,GAAGA,mBAAc,CAAC,KAAK,EAAE;IAClC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IACxD,CAAC;;ICFM,MAAM,MAAM,SAASC,cAAS,CAAC;IACtC,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE,CAAC;IAChB,QAAQ,IAAI,CAAC,sBAAsB,GAAG,MAAM;IAC5C,YAAY,MAAM,IAAI,GAAG;IACzB,gBAAgB,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI;IAClD,aAAa,CAAC;IACd,YAAY,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACzD,SAAS,CAAC;IACV,QAAQ,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAC1F,KAAK;IACL,IAAI,OAAO,GAAG;IACd,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC5D,KAAK;IACL,IAAI,MAAM,OAAO,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC5D,KAAK;IACL,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IAC3B,KAAK;IACL,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;IACtD,KAAK;IACL,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC5D,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/AppPlugin.m
CHANGED
|
@@ -8,5 +8,6 @@ CAP_PLUGIN(AppPlugin, "App",
|
|
|
8
8
|
CAP_PLUGIN_METHOD(getInfo, CAPPluginReturnPromise);
|
|
9
9
|
CAP_PLUGIN_METHOD(getLaunchUrl, CAPPluginReturnPromise);
|
|
10
10
|
CAP_PLUGIN_METHOD(getState, CAPPluginReturnPromise);
|
|
11
|
+
CAP_PLUGIN_METHOD(minimizeApp, CAPPluginReturnPromise);
|
|
11
12
|
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone);
|
|
12
13
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/app",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The App API handles high level App state and events.For example, this API emits events when the app enters and leaves the foreground, handles deeplinks, opens other apps, and manages persisted plugin state.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "f18ee6482e1ec8e5fb0290d51f598397133af990"
|
|
83
83
|
}
|