8000 chore: cleanup · NativeScript/plugins@bd83213 · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit bd83213

Browse files
committed
chore: cleanup
1 parent 1cac808 commit bd83213

File tree

4 files changed

+9
-62
lines changed

4 files changed

+9
-62
lines changed

apps/demo/src/app.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,17 @@ import { Application } from '@nativescript/core';
99
// LoginManager.init();
1010

1111
// uncomment to test Ionic Portals
12-
// import { IonicPortalManager } from '@nativescript/ionic-portals';
12+
import { IonicPortalManager } from '@nativescript/ionic-portals';
1313

14-
// Application.on(Application.launchEvent, () => {
15-
// // Register IonicPortals
16-
// IonicPortalManager.register('<portal-api-key>');
14+
Application.on(Application.launchEvent, () => {
15+
// Register IonicPortals
16+
IonicPortalManager.register('<portal-api-key>');
1717

18-
// // Create as many Portals as you need to use in your app
19-
// IonicPortalManager.create('ionicWebPortalSample');
18+
// Create as many Portals as you need to use in your app
19+
// IonicPortalManager.create('ionicWebPortalSample');
2020

21-
// IonicPortalManager.create('ionicWebStart');
22-
// IonicPortalManager.create('ionicWebModal');
23-
24-
// IonicPortalManager.registerPlugins([
25-
// 'CapacitorStorage',
26-
// 'CapacitorCamera',
27-
// 'CapacitorFilesystem'
28-
// ]);
29-
// });
21+
IonicPortalManager.create('ionicWebStart');
22+
IonicPortalManager.create('ionicWebModal');
23+
});
3024

3125
Application.run({ moduleName: 'app-root' });

packages/ionic-portals/README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,35 +70,12 @@ pod 'CapacitorCamera', '~> 1.2.0'
7070
pod 'CapacitorFilesystem', '~> 1.1.0'
7171
```
7272

73-
You can then ensure they are registered after creating your portals:
74-
75-
```
76-
Application.on(Application.launchEvent, () => {
77-
// Register IonicPortals
78-
IonicPortalManager.register('<portal-api-key>');
79-
80-
// Create as many Portals as you need to use in your app
81-
IonicPortalManager.create('ionicWebStart');
82-
IonicPortalManager.create('ionicWebModal');
83-
84-
// Register any Capacitor plugins your Portals would like to use
85-
IonicPortalManager.registerPlugins([
86-
'CapacitorStorage',
87-
'CapacitorCamera',
88-
'CapacitorFilesystem'
89-
]);
90-
});
91-
```
92-
9373

9474
### API
9575

9676
* `IonicPortalManager.register(apiKey: string)`: Register Portals when your app boots
9777
* https://ionic.io/docs/portals/getting-started/guide#configure
9878

99-
* `IonicPortalManager.registerPlugins(names: Array<string>)`: Register Capacitor plugins to make available to your Portals
100-
* https://ionic.io/docs/portals/how-to/using-a-capacitor-plugin
101-
10279
* `IonicPortalManager.create(portalId: string, startDir?: string)`: Create a Portal
10380
* `portalId`: The portal id to register
10481
* `startDir`: Set the web applications directory. By default it will look for a folder named the same as the portalId as the location of the web assets. Use this optional 2nd arg if you would like the folder name to be different that the portalId.

packages/ionic-portals/index.d.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { IonicPortalCommon } from './common';
22

33
export declare class IonicPortalManager {
4-
/**
5-
* Names of registered Capacitor plugins for use within your portals
6-
*/
7-
static registeredPlugins: Array<string>;
84
/**
95
* Register Portals when your app boots
106
* https://ionic.io/docs/portals/getting-started/guide#configure
@@ -21,11 +17,5 @@ export declare class IonicPortalManager {
2117
* Android: App_Resources/Android/src/main/asssets/webPortal
2218
*/
2319
static create(portalId: string, startDir?: string): any;
24-
25-
/**
26-
* Register Capacitor plugins by name to make available to your portals
27-
* @param names names of Capacitor plugins
28-
*/
29-
static registerPlugins(names: Array<string>): void;
3020
}
3121
export declare class IonicPortal extends IonicPortalCommon {}

packages/ionic-portals/index.ios.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { Application, OrientationChangedEventData } from '@nativescript/core';
22
import { IonicPortalCommon } from './common';
33

44
export class IonicPortalManager {
5-
static registeredPlugins: Array<string>;
6-
75
static register(apiKey: string) {
86
PortalManager.register(apiKey);
97
}
@@ -13,13 +11,6 @@ export class IonicPortalManager {
1311
.setStartDir(startDir || portalId)
1412
.create();
1513
}
16-
17-
static registerPlugins(names: Array<string>) {
18-
if (!IonicPortalManager.registeredPlugins) {
19-
IonicPortalManager.registeredPlugins = [];
20-
}
21-
IonicPortalManager.registeredPlugins = names.filter((name) => !IonicPortalManager.registeredPlugins.includes(name));
22-
}
2314
}
2415

2516
export class IonicPortal extends IonicPortalCommon {
@@ -40,11 +31,6 @@ export class IonicPortal extends IonicPortalCommon {
4031
}
4132

4233
initNativeView() {
43-
if (IonicPortalManager.registeredPlugins) {
44-
for (const plugin of IonicPortalManager.registeredPlugins) {
45-
this.ios.bridge.pluginWithName(plugin);
46-
}
47-
}
4834
// auto-handle orientation
4935
this._handleOrientationFn = this._updateWebViewSize.bind(this);
5036
Application.on(Application.orientationChangedEvent, this._handleOrientationFn);

0 commit comments

Comments
 (0)
0