⚡️ A supercharged native Web View for iOS and Android ⚡️

Related tags

App ionic-portals
Overview

⚡️ A supercharged native Web View for iOS and Android ⚡️


Ionic Portals is a supercharged native Web View component for iOS and Android that lets you add web-based experiences to native mobile apps. It enables native and web teams to better collaborate and bring new and existing web experiences to mobile in a safe, controlled way.

Getting Started

See our docs to get started with Portals.

Registration

The Ionic Portals libraries for Android and iOS require a free license key to use. Once you have integrated Portals into your project, login to your ionic account to get a key. See our doc on how to register for free and get your Portals license key and refer to the Android or iOS getting started guides to see where to add your key.

FAQ

Is Portals Free?

Yes.

Is Portals Open Source?

See our license.

How is Portals Related to Capacitor and Ionic?

Ionic Portals is a solution that lets you add web-based experiences to your native mobile apps. Portals uses Capacitor as a bridge between the native code and the web code to allow for cross-communication between the two layers. Because Portals uses Capacitor under the hood, you are able to use any existing Capacitor Plugins and even most Cordova Plugins while continuing to use your existing native workflow.

Ionic Framework is the open-source mobile app development framework that makes it easy to build top quality native and progressive web apps with web technologies. Your web experiences can be developed with Ionic, but it is not necessary to use Portals.

Comments
  • NullPointerException in PortalFragment; potential problems with Fragment-recreations

    NullPointerException in PortalFragment; potential problems with Fragment-recreations

    Dear ionic-team,

    After using Portals successfully in production for multiple weeks, I noticed hundreds of NullPointerExceptions in my sentry.io crash-reports. Specifically, a NullPointerException happened in the following line: https://github.com/ionic-team/ionic-portals/blob/main/android/IonicPortals/src/main/kotlin/io/ionic/portals/PortalFragment.kt#L99

    Here is the stacktrace that was reported by sentry.io:

    java.lang.NullPointerException: null at io.ionic.portals.PortalFragment.load(PortalFragment.kt:99) at io.ionic.portals.PortalFragment.onViewCreated(PortalFragment.kt:44) at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2987) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:546) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282) at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128) at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072) at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251) at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502) at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435) at android.app.Activity.performStart(Activity.java:8231) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3853) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2317) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8625) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

    I suspect that this happens when a PortalFragment gets instantiated without an instance of the Portal-class. For example, such erroneous instantiations might happen when the following empty default-constructor of a PortalFragment gets invoked: https://github.com/ionic-team/ionic-portals/blob/main/android/IonicPortals/src/main/kotlin/io/ionic/portals/PortalFragment.kt#L27

    This makes me question whether there is a potential problem with Fragment-recreations. The Android-OS might destroy and recreate Fragments at any time, and this might trigger the NullPointerException.

    Perhaps I could "fix" the bug by adding more null-checks to the problematic code, but my goal would be to find a root-cause instead of only adding null-checks.

    opened by fkirc 10
  • breaking(plugin): Make `publish` generic over Message and not Message data

    breaking(plugin): Make `publish` generic over Message and not Message data

    This should allow for doing things like this:

    type Messages = 
      | { topic: "cart:dismiss", data: "clear" | "cancel" }
      | { topic: "user:delete", data: User }
    
    publish<Messages>({ topic: "cart:dismiss", data: "cancel" }) //totally fine
    publish({ topic: "something:else", data: 1 }) // totally fine
    publish<Messages>({ topic: "user:delete", data: "clear" }) // typescript error
    publish<Messages>({ topic: "something:else", data: 1 }) // typescript error
    

    Props to @eric-horodyski for the idea

    opened by Steven0351 5
  • Portals for ionic Angular

    Portals for ionic Angular

    Hi ionic team,

    Our project is using ionic 3, cordova, Angular. I would like to know if we can use Portals, Our company is very interested in this feature: Micro Frontends with Module Federation, but did not find documentation and Demo for ionic Angular.

    thanks!

    opened by vfmlucasguo 4
  • Unable to load web content

    Unable to load web content

    Following the QuickStart guides, it seems like in iOS the web content is expected to be a Capacitor app? The same built web app works for Android.

    Here's the error in the Xcode console:

    ⚡️ ERROR: Unable to find application directory at: "file:///private/var/containers/Bundle/Application/6C3DFA39-02A0-4878-A78B-3C3D535AD9EE/PortalsDemo.app/public"! Unable to find capacitor.config.json, make sure it exists and run npx cap copy. Unable to find config.xml, make sure it exists and run npx cap copy. 2022-06-15 12:11:53.660581-0700 PortalsDemo[5584:383934] [ViewportSizing] maximumViewportInset cannot be larger than frame 2022-06-15 12:11:53.660622-0700 PortalsDemo[5584:383934] [ViewportSizing] minimumViewportInset cannot be larger than frame ⚡️ ERROR: Unable to load /private/var/containers/Bundle/Application/6C3DFA39-02A0-4878-A78B-3C3D535AD9EE/PortalsDemo.app/public ⚡️ This file is the root of your web app and must exist before ⚡️ Capacitor can run. Ensure you've run capacitor copy at least ⚡️ or, if embedding, that this directory exists as a resource directory.

    opened by jrbj 3
  • Cocoapods Installation Error

    Cocoapods Installation Error

    [!] Error installing IonicLiveUpdates [!] /usr/bin/git clone https://github.com/ionic-team/live-updates-sdk.git /var/folders/wp/yy92cy4j28q2m49vszqs4srm0000gn/T/d20220209-54213-1wln4g6 --template= --single-branch --depth 1

    Cloning into '/var/folders/wp/yy92cy4j28q2m49vszqs4srm0000gn/T/d20220209-54213-1wln4g6'... remote: Repository not found. fatal: repository 'https://github.com/ionic-team/live-updates-sdk.git/' not found

    opened by tinahir 3
  • feat!(plugin): Non async initial context

    feat!(plugin): Non async initial context

    This is a breaking change, but reduces the unnecessary asynchronous method by removing it from the plugin class and making it a separate function exported by the library.

    Before:

    Portals.getInitialContext<{ startingRoute: string }>().then((context) => {
      ReactDOM.render(
        <React.StrictMode>
          <App context={context.value} />
        </React.StrictMode>,
        document.getElementById('root'),
      );
    });
    

    After:

    const initialContext = getInitialContext<{startingRoute: string}>();
    
    ReactDOM.render(
      <React.StrictMode>
        <App context={initialContext.value} />
      </React.StrictMode>,
      document.getElementById('root'),
    );
    
    opened by Steven0351 2
  • chore(docs): updated reference + upgrade guide

    chore(docs): updated reference + upgrade guide

    Update the "PortalsPlugin" and "Upgrade Guides" documentation to account for changes made in #166.

    Once this is merged, I would like to request a release of @ionic/[email protected] 😄

    opened by eric-horodyski 2
  • Missing cordova dependency in Android build

    Missing cordova dependency in Android build

    Im using this gradle dependency: implementation("io.ionic:portals:0.5.0")

    Gradle can compile build files but warns it missing dependecy to Cordova. I can however reference code from your lib.

    When building app project, it fails, its complains about missing Cordova dependency.

    > Could not resolve all files for configuration ':app:demoDebugRuntimeClasspath'.
       > Could not find org.apache.cordova:framework:7.0.0.
         Searched in the following locations:
           - https://dl.google.com/dl/android/maven2/org/apache/cordova/framework/7.0.0/framework-7.0.0.pom
           - https://repo.maven.apache.org/maven2/org/apache/cordova/framework/7.0.0/framework-7.0.0.pom
           - https://maven.shortcut.io/org/apache/cordova/framework/7.0.0/framework-7.0.0.pom
         Required by:
             project :app > io.ionic:portals:0.5.0 > com.capacitorjs:core:3.4.1
    

    Am i missing any other dependencies or?

    opened by madshgk 2
  • feat(ios): use @objc for bridge and auxiliary APIs

    feat(ios): use @objc for bridge and auxiliary APIs

    This allows Capacitor plugins to be registered with the bridge, for example: https://github.com/NativeScript/plugins/commit/644b896d8b5e3c5b8f89377e25b2797c2d50eb25#diff-8ccbf3f8847b6a1b15944609e0e0610409a8b5e910076d7298aeab62cd998e84R46

    opened by NathanWalker 2
  • CAPWebView not found

    CAPWebView not found

    I’ve been trying to build the Portals iOS framework from source (due to issues using Cocoapods with my ObjC project) but have come across this…

    In ‘PortalWebView.swift on line 64: ‘class InternalCapWebView: CAPWebView {‘

    This line fails as ‘CAPWebView’ cannot be found and I cannot see anywhere this is defined (in Portals or Capacitor). Am I missing something? (e.g. a specific Capacitor version).

    I assume it must be something I'm doing wrong as you must be able to build it there. Any help would be greatly appreciated.

    opened by andypoptacular 2
  • Minor documentation improvements

    Minor documentation improvements

    While reading through the documentation to learn about Portals, I fixed some spelling errors and made some edits to make things more clear for non-native English speakers.

    opened by ptmkenny 2
Releases(0.7.0)
Owner
Ionic
Powerful tools and services for building cross-platform mobile apps
Ionic
🌄 Photo editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and PhotoEditor (Android)

React Native Photo Editor (RNPE) ?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and Ph

Baron Ha. 242 Dec 28, 2022
📲💬 react-native-fontext is a lightweight library to integrate fonts in your React Native application that works seamlessly in android and iOS devices.

React Native Fontext react-native-fontext is a lightweight library to integrate fonts in your React Native application that works seamlessly in androi

mroads 9 Dec 3, 2021
Matomo wrapper for React-Native. Supports Android and iOS. Fixed issues for native platforms build that are present in the official package.

@mccsoft/react-native-matomo Matomo wrapper for React-Native. Supports Android and iOS. Fixed issues for native platforms build that are present in th

MCC Soft 4 Dec 29, 2022
A 2020s compatible React Native keyboard avoiding view for Android and iOS that just works.

react-native-keyboard-shift Example Snack coming soon Until then: Clone this repo: git clone https://github.com/FullStackCraft/react-native-keyboard-s

Full Stack Craft 66 Aug 16, 2022
An Animated Scrolling View for React Native applications, supported on both iOS and Android

react-native-focused-scroll An Animated Scrolling View for React Native applications, supported on both iOS and Android Preview react-native-focus-scr

Fatemeh Marzoughi (Saba) 3 Aug 12, 2022
Cody Engel 2 Apr 20, 2022
Initiate immediate phone call for React Native on iOS and Android.

react-native-immediate-call-library Initiate immediate phone call for React Native on iOS and Android. Getting started Using npm: npm install react-na

null 7 Sep 7, 2022
🚀 React Native Segmented Control, Pure Javascript for iOS and Android

Installation Add the dependency: npm i react-native-segmented-control-2 Peer Dependencies Zero Dependency ?? Usage Import import SegmentedControl from

FreakyCoder 11 Nov 10, 2022
A Python native extension written in Kotlin Native

Kotlin Python Ext This is a proof of concept for a Python extension in Kotlin. It is recommended to read the Official Python C API Documentation befor

Martmists 20 Jun 22, 2022
Native-loader - Safely load native libraries in Java

Native Loader ??️ Safe native loading in Java based off of the native-loader use

Mixtape 1 Oct 19, 2022
React-native-user-interface - Change React Native userinterface at runtime

react-native-user-interface change RN userinterface at runtime. Installation npm

Ahmed Eid 0 Jan 11, 2022
A package to include a standard Unlock premium view in iOS and Android apps

A package to include a standard Unlock premium view in iOS and Android apps

Groupe MINASTE 2 May 21, 2022
Simple Android web-view-based application. The primary purpose is to show the website in Kiosk mode.

Kiosk mode app Simple Android web-view-based application. The primary purpose is to show the website in Kiosk mode. By default, the app works in Scree

Mykola Kichatov 1 Oct 25, 2022
CMPLR Technologies 8 Apr 5, 2022
Open Super dApp - Your gateway to the new digital commons. Integrated mobile messenger, Ethereum wallet, and Web 3.0 browser built on open, decentralized, and encrypted protocols.

A fully open source, open standard, decentralized "super app" including a secure, encrypted Matrix compatible messenger based off of the Element Messenger, and an Ethereum crypto wallet and web3 browser based off of Alpha Wallet.

2Gather 6 Jul 25, 2022
Tonomy ID is the cross-platform mobile wallet (Android and iOS) for public and private EOSIO blockchains

Tonomy ID is the cross-platform mobile wallet (Android and iOS) for public and private EOSIO blockchains. This application allows you to sign transactions on the block chain, share your DID and Verifiable Credentials containing your identity with others in a consensual way and log into web2 and web3 applications. If you lose your phone several mechanisms exist to allow you to recover your account without trusting anyone with custody of your private keys.

null 7 Dec 24, 2022
sample codebase for E2E testing with Jest, Appium and WebDriverIO for Android and iOS

E2E testing for React Native with Jest, Appium and WebDriverIO (iOS and Android) In this repo you will find a sample project to showcase how to do E2E

Lorenzo Sciandra 23 Nov 9, 2022
A Android Web IDE supports code auto-completion and highlight, plugin (Supports Html, Css, JS, Json, Php etc)

WebDevOps A Android Web IDE supports code auto-completion and highlight, plugin (Supports Html, Css, JS, Json, Php etc) Join us QQ group number: 10314

SuMuCheng 22 Jan 3, 2023
Proof of concept of custom widgets and apps running on the Z Flip3 cover screen. Adds a widget to Z Flip3 cover screen that lets you launch a web browser-like app on the cover.

SubUI-browser Proof of concept of custom widgets and apps running on the Z Flip3 cover screen. Adds a widget to Z Flip3 cover screen that lets you lau

null 35 Dec 24, 2022