File tree Expand file tree Collapse file tree 4 files changed +9
-62
lines changed Expand file tree Collapse file tree 4 files changed +9
-62
lines changed Original file line number Diff line number Diff line change @@ -9,23 +9,17 @@ import { Application } from '@nativescript/core';
9
9
// LoginManager.init();
10
10
11
11
// uncomment to test Ionic Portals
12
- // import { IonicPortalManager } from '@nativescript/ionic-portals';
12
+ import { IonicPortalManager } from '@nativescript/ionic-portals' ;
13
13
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>' ) ;
17
17
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');
20
20
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
+ } ) ;
30
24
31
25
Application . run ( { moduleName : 'app-root' } ) ;
Original file line number Diff line number Diff line change @@ -70,35 +70,12 @@ pod 'CapacitorCamera', '~> 1.2.0'
70
70
pod 'CapacitorFilesystem', '~> 1.1.0'
71
71
```
72
72
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
-
93
73
94
74
### API
95
75
96
76
* ` IonicPortalManager.register(apiKey: string) ` : Register Portals when your app boots
97
77
* https://ionic.io/docs/portals/getting-started/guide#configure
98
78
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
-
102
79
* ` IonicPortalManager.create(portalId: string, startDir?: string) ` : Create a Portal
103
80
* ` portalId ` : The portal id to register
104
81
* ` 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.
Original file line number Diff line number Diff line change 1
1
import { IonicPortalCommon } from './common' ;
2
2
3
3
export declare class IonicPortalManager {
4
- /**
5
- * Names of registered Capacitor plugins for use within your portals
6
- */
7
- static registeredPlugins : Array < string > ;
8
4
/**
9
5
* Register Portals when your app boots
10
6
* https://ionic.io/docs/portals/getting-started/guide#configure
@@ -21,11 +17,5 @@ export declare class IonicPortalManager {
21
17
* Android: App_Resources/Android/src/main/asssets/webPortal
22
18
*/
23
19
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 ;
30
20
}
31
21
export declare class IonicPortal extends IonicPortalCommon { }
Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ import { Application, OrientationChangedEventData } from '@nativescript/core';
2
2
import { IonicPortalCommon } from './common' ;
3
3
4
4
export class IonicPortalManager {
5
- static registeredPlugins : Array < string > ;
6
-
7
5
static register ( apiKey : string ) {
8
6
PortalManager . register ( apiKey ) ;
9
7
}
@@ -13,13 +11,6 @@ export class IonicPortalManager {
13
11
. setStartDir ( startDir || portalId )
14
12
. create ( ) ;
15
13
}
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
- }
23
14
}
24
15
25
16
export class IonicPortal extends IonicPortalCommon {
@@ -40,11 +31,6 @@ export class IonicPortal extends IonicPortalCommon {
40
31
}
41
32
42
33
initNativeView ( ) {
43
- if ( IonicPortalManager . registeredPlugins ) {
44
- for ( const plugin of IonicPortalManager . registeredPlugins ) {
45
- this . ios . bridge . pluginWithName ( plugin ) ;
46
- }
47
- }
48
34
// auto-handle orientation
49
35
this . _handleOrientationFn = this . _updateWebViewSize . bind ( this ) ;
50
36
Application . on ( Application . orientationChangedEvent , this . _handleOrientationFn ) ;
You can’t perform that action at this time.
0 commit comments