Skip to content

Commit d0259ba

Browse files
authored
chore: readme
1 parent 985ae6c commit d0259ba

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

packages/ionic-portals/README.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,24 @@ npm install @nativescript/ionic-portals
1010

1111
## Usage
1212

13-
1. Register and create portals on app boot:
13+
1. Register and create portals on app boot - [Get a Portal API Key here](https://ionic.io/docs/portals/getting-started/guide):
1414

1515
```ts
1616
import { Application } from '@nativescript/core';
1717
import { IonicPortalManager } from '@nativescript/ionic-portals';
1818

19-
const portalApiKey = '<portal-api-key>';
20-
21-
const setupIonicPortals = () => {
19+
Application.on(Application.launchEvent, () => {
2220
// Register IonicPortals
23-
IonicPortalManager.register(portalApiKey);
21+
IonicPortalManager.register('<portal-api-key>');
2422

2523
// Create as many Portals as you need to use in your app
2624
// By default, the app will look for folders equal to the portal id you use here
2725
// For iOS: App_Resources/iOS/webPortal
2826
// For Android: App_Resources/Android/src/main/asssets/webPortal
2927
IonicPortalManager.create('webPortal');
30-
};
31-
32-
if (global.isIOS) {
33-
@NativeClass()
34-
class CustomAppDelegate extends NSObject implements UIApplicationDelegate {
35-
static ObjCProtocols = [UIApplicationDelegate];
36-
37-
applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary<string, any>) {
38-
39-
setupIonicPortals();
40-
41-
return true;
42-
}
43-
}
44-
Application.ios.delegate = CustomAppDelegate;
45-
} else {
46-
Application.on(Application.launchEvent, () => {
47-
setupIonicPortals();
48-
});
49-
}
50-
51-
// boot app here, e.g.
28+
});
29+
30+
// boot app here, for example:
5231
Application.run({ moduleName: 'app-root' });
5332
```
5433

0 commit comments

Comments
 (0)