Ionic 5/Capacitor ERR_CLEARTEXT_NOT_PERMITTED in Android
Add this to you AndroidManifest.xml in the application element <application android:usesCleartextTraffic=”true”
Add this to you AndroidManifest.xml in the application element <application android:usesCleartextTraffic=”true”
cordova-plugin-whitelist seems to be “mandatory” at present. install it : cordova plugin add cordova-plugin-whitelist configure config.xml You can keep your current setup with * or change for more restrictive rules add a html policy on index.html, you shall add a Policy also. To authorise everything, here it is : <meta http-equiv=”Content-Security-Policy” content=”default-src *; style-src ‘self’ … Read more
Please notice that section: Could not resolve all dependencies for configuration ‘:_armv7DebugCompile’. It can happen because building an android project with the crosswalk plugin try to build two apks : one for ARM, the other for x86. The solution is to install Android Support Repository : Open the SDK manager (from command line, type android). … Read more
By default, your controllers were cache and that is why your controller only fired once. To turn off caching for a certain controller you have to modify your .config(..).state and set the cache option to false. eg : .state(‘myApp’, { cache: false, url: “/form”, views: { ‘menuContent’: { templateUrl: “templates/form.html”, controller: ‘formCtrl’ } } }) … Read more
Personally I don’t like the read the config.json file by using the http.get way to handle configuration information, and even though there must be another way to just include and read the json file in your code, since we’re using Angular2 and Typescript, why not using classes, interfaces and doing it in a more fancy … Read more
I am Guessing that your are getting this because of android changes its http architecture. to make it working on Android go to your project root folder. yourAppFolder > resources > android > xml > network_security_config.xml Change your network security config to blow code. <?xml version=”1.0″ encoding=”utf-8″?> <network-security-config> <base-config cleartextTrafficPermitted=”true”> <trust-anchors> <certificates src=”https://stackoverflow.com/questions/59306640/system” /> </trust-anchors> … Read more
However, ideally I need another way, like the angular 1 $watch, as there are other ways my complex object can be changed, not just simple input fields I was working in a Google Autocomplete Component, and I was dealing with a similar issue: when the user types an address and select one from the Google … Read more
You will need to use ng-pdfviewer. AngularJS PDF viewer directive using pdf.js. <button ng-click=”prevPage()”><</button> <button ng-click=”nextPage()”>></button> <br> <span>{{currentPage}}/{{totalPages}}</span> <br> <pdfviewer src=”https://stackoverflow.com/questions/43496455/test.pdf” on-page-load=’pageLoaded(page,total)’ id=”viewer”></pdfviewer> and in your AngularJS code: var app = angular.module(‘testApp’, [ ‘ngPDFViewer’ ]); app.controller(‘TestCtrl’, [ ‘$scope’, ‘PDFViewerService’, function($scope, pdf) { $scope.viewer = pdf.Instance(“viewer”); $scope.nextPage = function() { $scope.viewer.nextPage(); }; $scope.prevPage = function() { … Read more
Steps to Configure authentication in Device(android) ionic start newApp ionic platform add android cordova plugin add cordova-plugin-inappbrowser bower install ngCordova bower install ng-cordova-oauth -S include both script into index.html above cordova.js <script src=”https://stackoverflow.com/questions/37523038/lib/ngCordova/dist/ng-cordova.min.js”></script> <script src=”lib/ng-cordova-oauth/dist/ng-cordova-oauth.js”></script> <script src=”https://stackoverflow.com/questions/37523038/cordova.js”></script> Dependency injection include below code $scope.googleLogin = function() { console.log(‘In My Method’); $cordovaOauth.google(“Client ID”, [“https://www.googleapis.com/auth/urlshortener”, “https://www.googleapis.com/auth/userinfo.email”]).then(function(result) { console.log(JSON.stringify(result)); … Read more
I’ve achieved that creating a template config.xml (the file is config.tpl.xml) and a before_prepare cordova hook to replace the variables in the template with the correct values and save the generated content in config.xml. The cordova hook uses the npm package es6-template-strings: npm install es6-template-strings –save-dev The hook is: #!/usr/bin/env node var fs = require(‘fs’); … Read more