Skip to main content

Getting Started Guide

Signup#

Ionic Portals is a free product, but it does require a product key to use. Getting a key is easy. Just head to the Ionic Dashboard and click "Get Access".

This will present you with a form asking for some additional information. After submitting the page will refresh and you will immediately see the key that can be used to unlock the use of Portals in your app.

info

You can always use this shareable link to signup for a Product Key: ionic.io/register-portals

Install#

Ionic Portals is publicly available on Maven Central, Cocoapods, and NPM.

To add Portals to your iOS project, put the following line to your Podfile:

Podfile
pod 'IonicPortals', '~> 0.2.2'

And then run pod install.

info

It is important to keep the version of Portals in sync between all the platforms.

Configure#

After installing the depenency you need to register your copy of Ionic Portals at runtime. This will work both offline and in production. You'll need to call PortalManager.register(myApiKey) before creating any Portals in your app. Below is a simple example of how to bootstrap Ionic Portals before loading any Portal instances in your app. To get an API Key, refer to the Sign Up section.

AppDelegate.swift
import SwiftUIimport IonicPortals
@mainclass AppDelegate: NSObject, UIApplicationDelegate {    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {        PortalManager.register("MY_API_KEY")        // setup portals...        return true    }}
caution

Avoid committing your Portals key to source code repositories where it may be publicly visible!