I've created an Ionic app and I'm trying to use the Custom Authentication option eg. Ionic.Auth.login('custom', authOptions, data).then(success, failure); However, I get an error message in the failure saying "Missing InAppBrowser plugin".
The plugin is installed and I've tried to uninstall and reinstall the plugin with no luck. When I use 'basic' the request goes through fine.
How do I fix this or get around it?
Plugins only work when running in native devices. You can't use them on browser with ionic serve.
You may want to start testing on a real android device or emulator.
Alternatively, there's a chrome plugin called Ripple that emulate an real devices with native-like features, allowing you to use some plugins on browser.
Related
I have created a new Ionic (Capacitor) app and I want to use the native facebook plugin, The plugin documentation says that is supported in the Android, iOS and Browser platforms, but when I run the app in the browser I get a Native: tried calling Facebook.login, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator error.
How can I run the facebook plugin from the browser?
We've developed a cordova app that shows one of our websites (which is also accessible using a web browser).
Recently, FIDO2 authentication using WebAuthn has been added to that website. This works fine in the tested browsers (Chrome and Firefox), but not in our cordova application, as it uses Android WebView, which doesn't implement the WebAuthn API.
Does anybody know if there is any cordova plugin to add this API to Android WebView?
Is there any website with information about the Android WebView roadmap (bugs that will be fixed in next release, new features that will be added, ...)?
You're correct that Android WebView doesn't support WebAuthn in Android 13. We hope to address that in the Android 14 timeframe but, for now, you have to inject Javascript hooks and use a Javascript bridge to implement it. It's certainly possible to do but I'm not aware of any packaged solutions that do it.
I am doing ionic application with capacitor.
I have to use https://ionicframework.com/docs/native/themeable-browser plugin for one funcationality but when I make build and upload to apple store app is rejected because of UiWebView issue.
Commands for installing themeable plugin
npm install cordova-plugin-themeablebrowser
npm install #ionic-native/themeable-browser
ionic cap sync
If I remove that plugin and upload it to apple build process pass successfully.
Apple no longer accepts new submissions using UIWebView:
https://forums.developer.apple.com/thread/122114
There is also an Ionic blog article: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/
You can use Capacitor's Browser API, but it is quite limited compared to some existing Cordova plugins. However it is built around WKWebView and is therefore compliant.
There is AFAIK no alternative but to move to WKWebView if you want your app to be on the Apple App Store.
I assume you are using Themeable Browser instead of InAppBrowser because you need to customize the toolbar and other components. Unfortunately Themeable Browser is no longer a supported project. In InAppBrowser version 5.0.0 https://cordova.apache.org/announcements/2021/02/16/inappbrowser-release-5.0.0.html only uses WKWebView and you can now set InAppBrowserStatusBarStyle to "darkcontent". Unfortunately, other changes have to be applied manually. I succeeded for Android and I fight for Ios :-)
I downloaded the example project from Auth0's website. When I run the project with the ionic serve command the main page pulls up fine, but when I press login it throws the error Cannot read property 'isAvailable' of undefined. I have tried running this app on an Android device and it does work. Any ideas on how to fix this error? Thanks.
#cyberabis is correct in his comment.
ionic serve does not load cordova plugins.
Auth0 uses auth0-cordova plugin which in turn requires:
cordova-plugin-safariviewcontroller
cordova-plugin-customurlscheme
All these require you to run the ionic app in your device or emulator if you want to test the login functionality.
In order to incorporate the Toastr ngCordova plugin.. I followed the following steps
bower install ngCordova
include ngCordova in my app
angular.module('app', ['ionic', 'ngCordova'])
Install plugin
cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
Use the plugin
app.controller('myController', function($cordovaToast) {
});
This seems pretty straight forward. However I encounter the following errors:
ionic.bundle.js:21157 TypeError: Cannot read property 'toast' of undefined
at Object.show (http://localhost:8100/lib/ngCordova/dist/ng-cordova.min.js:9:20474)
I am running the app in chrome browser.
What am I missing here ?
ngCordova plugins won't work in the browser.
From documentation:
Only develop on your phone
Cordova plugins do not work while developing in your browser, because each plugin accesses a specific API (such as camera, microphone, accelerometer) which is not available in your browser. Additionally, some plugins don't work in the emulator, such as the Camera plugin, so development on your physical device is required.
In this case be sure that your application works on your device.