How to style form autofill CSS in Ionic 5/Angular:
// AUTOFILL CSS // put in your global css file input:-webkit-autofill, input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px white inset; -webkit-text-fill-color: #333; }
How to style form autofill CSS in Ionic 5/Angular:
// AUTOFILL CSS // put in your global css file input:-webkit-autofill, input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px white inset; -webkit-text-fill-color: #333; }
How to use the https://github.com/chemerisuk/cordova-plugin-idfa plugin in Ionic v3.
I had some issues using the example provided so I had to call the exec directly:
// first install the plugin // cordova plugin add cordova-plugin-idfa // npm i cordova-plugin-idfa --save // add permissions to config.xml under ios platform <platform name="ios"> <edit-config target="NSUserTrackingUsageDescription" file="*-Info.plist" mode="merge"> <string> My tracking usage description </string> </edit-config> </platform>
// has to be called after platform is ready // this.platform.ready().then(() => {} askTrackingPermission() { if (this.platform.is('cordova') && this.platform.is('ios')) { if (window.cordova) { console.log('trying to request permission '); window.cordova.exec(win, fail, 'idfa', "requestPermission", []); } } function win(res) { console.log('success ' + JSON.stringify(res)); } function fail(res) { console.log('fail ' + JSON.stringify(res)); } } readTrackingPermission() { if (this.platform.is('cordova') && this.platform.is('ios')) { if (window.cordova) { window.cordova.exec(win, fail, 'idfa', "getInfo", []); } } function win(res) { console.log('success ' + JSON.stringify(res)); } function fail(res) { console.log('fail ' + JSON.stringify(res)); } }
Also, you can only test this from the iOS simulator (or device) running 14.5.1+ iOS. In your iOS device settings check privacy->tracking (setting) it has to be allowed to ask. And you will only be able to ask the user once.
Good luck!
How to Customize those little circles in the Ion-slide components?
This CSS snippet changes the slides pager to white circles.
.swiper-pagination-bullet { background: white; opacity: 0.2; } .swiper-pagination-bullet-active { opacity: 0.9; background: white; }
Good luck!
How to Open PDF/File in Ionic on Android?
If you recently tried to open a file in Ionic from the application dir using `fileOpener2` plugin you may have encountered an error `File Not Found` which could indicate permission error.
It turns out you can’t open a file from `applicationDirectory` directly, you have to copy it into another directory:
if (this.platform.is('android')) { const self = this; const targetFile = self.file.dataDirectory + '/' + yourFileName; self.file.copyFile(self.file.applicationDirectory + 'www/assets/', yourFileName, self.file.dataDirectory, yourFileName). then(function (res) { self.fileOpener.open(targetFile, 'application/pdf'); }); }
Install the Cordova Plugin here:
https://github.com/pwlin/cordova-plugin-file-opener2
https://ionicframework.com/docs/native/file-opener
import { SecurityContext } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; private sanitizer: DomSanitizer; downloadCSV() { let blob = new Blob([yourdata], { type: 'text/csv' }); let urlPath = this.sanitizer.sanitize(SecurityContext.URL, this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob))); let tempLink = document.createElement('a'); tempLink.href = urlPath; tempLink.setAttribute('download', 'download.csv'); tempLink.click(); }
These are the permissions Facebook app has on Android devices:
Device & app history:
Retrieve running apps
Storage:
– read the contents of your USB storage
– modify or delete the contents of your USB storage
Location:
– approximate location (network-based)
– precise location (GPS and network-based)
Phone:
– write call log
– read phone status and identity
– read call log
– directly call phone numbers
Microphone:
– record audio
Identity:
– add or remove accounts
– read your own contact card
– find accounts on the device
Wi-Fi connection information
– view Wi-Fi connections
SMS:
– read your text messages (SMS or MMS)
Calendar:
– add or modify calendar events and send email to guests without owners’ knowledge
– read calendar events plus confidential information
Contacts:
– read your contacts
– modify your contacts
– find accounts on the device
Device ID & call information:
– read phone status and identity
Photos/Media/Files:
– read the contents of your USB storage
– modify or delete the contents of your USB storage
Camera:
– take pictures and videos
Other:
download files without notification
receive data from Internet
adjust your wallpaper size
control Near Field Communication
create accounts and set passwords
toggle sync on and off
view network connections
send sticky broadcast
change your audio settings
set wallpaper
reorder running apps
modify system settings
read sync settings
install shortcuts
prevent device from sleeping
connect and disconnect from Wi-Fi
pair with Bluetooth devices
run at startup
read battery statistics
full network access
control vibration
expand/collapse status bar
access Bluetooth settings
draw over other apps
read Google service configuration
change network connectivity