I want to create a Ionic app which only shows a external website.
How can I do this?
Thanks for help.
I feel you can use cordova plugin to opening a link with your app, Also you can use the custom-url-scheme (cordova-plugin) So you can open external link on your app as on this way testapp://path?foo=bar.
Refer to this : Here the Link
================================================================================
So install InAppBrowser:
ionic cordova plugin add cordova-plugin-inappbrowser
npm install --save #ionic-native/in-app-browser
you can call as like:
window.open(url, '_system');
As described here : Refer the Link and also document
Related
I have a react-app webapp wrapped by an ionic-capacitor framework.
I already used a lot of cordova-plugins inside my code, like the phonegap-plugin-barcodescanner or the cordova-plugin-inappbrowser.
I understood that i can use them if I make:
npm install --save cordova-plugin-pluginName #ionic-native/plugin-name
then i could import them into my React environment with:
import {PluginName} from #ionic-native/plugin-name
and it's works like a magic!
The problem is:
when i need to use a cordova-plugin which requires configuration, it used to be cordova add plugin plugin-name --variable var=""
but in the react-capacitor environment i can't install the plugin with it's configuration! i should add it later somehow, via the androidManifest.xml or via the cordova:config.xml.
can someone help me please?
thanks a lot...
Ionic provides a tool for changing the ios/android configs using a separate file. It's called Trapeze. It does require a bit of extra configuration and an aditional build step but it will allow for the adding of these variables to the ios/android config.
When run this command:
ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="google-api-key" --variable API_KEY_FOR_IOS="google-api-key"
The ERROR occurs:
Installing "cordova-plugin-googlemaps" for android
Failed to install 'cordova-plugin-googlemaps': Error: ENOENT: no such
file or directory, open
'/Users/xxx/Desktop/xxx/platforms/android/AndroidManifest.xml'
i have sometimes the same problem, have open sublime or something like notepad?
if you have opened some notepad, check if exists the android directory and click inside of him(sometimes dont remove this directory with the notepad opened)
if dont exists the directory, the problem is easy you dont have the directory. You must to do these commands inside ionic proyect.
For ionic:
ionic platflorm remove android
ionic platform add android
For cordova cli:
ionic cordova platflorm remove android
ionic cordova platform add android
For check ionic version inside proyect:
ionic info
Greetings dherediat
As per Cordova Android CLI version 7.0.0 release note you need to change your AndroidManifest.xml path as mention below
This may affect plugin.xml files and config.xml files that use
edit-config, and make it so plugins that use edit-config will not be
able to be compatible with both Android 6.x and Android 7.x. To fix
this issue, please do the following in your XML files:
<!-- An existing config.xml -->
<edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
<!-- needs to change to -->
<edit-config file="app/src/main/AndroidManifest.xml" target="/manifest/application" mode="merge">
Check this official release note for Cordova Android CLI 7.0.0 Release Note.
Hope this will helps to solve your problem
When I try build app I get this error what I do?
I tried re-install node.js and cordova but it didn't work.
Why not use Ionic to build your app via Cloud.
First, run
ionic io init
Create account on Ionic website, put in the details on command live as asked.
Run the below command.
ionic package build android
No need to install anything, files will be built online.
I have the following implementation of Google Maps api (see link below). It works perfectly when I run ionic serve and test it in a browser. However, when I do cordova build and deploy the apk to my android 6.0.1 phone, it fails. The map does not load and it hangs on the loading spinner.
If anyone has any ideas, I would appreciate the help.
Thanks
https://forum.ionicframework.com/t/google-maps-working-in-browser-but-not-device/58819
SOLVED:
I ran the following, and low the map loads on the device too:
cordova plugin add cordova-plugin-geolocation
Run the following commands:
ionic plugin add cordova-plugin-geolocation
and
npm install --save #ionic-native/geolocation`
This link would be helpful.
I tried to use Childbrowser in phonegap 1.7.0 in my project.But it won't run as my expectation.
Error: ' PGPlugin.h' file is not found.
How to obtain the file 'PGPlugin.h'?
Does anyone meet this problem?
Does phonegap plugin not support the latest phonegap?
You want to use this version of the ChildBrowser instead as it is updated for use with Cordova.
https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ChildBrowser