Native

supported plugins in native config array

camera, device, dialogs, file, geolocation, inappbrowser, media, media-capture, keyboard, secure-storage, network, screen-orientation, statusbar, vibration, document-viewer, file-opener, fingerprint-aio, native-storage, qr-scanner, sqlite-storage,

usage

config/config.ts

export default {
  appType: 'cordova',
  native: ['file', 'device', 'camera', 'qr-scanner'],   // add the plugin name you want to add to the array, you can find the plugin name above.
};

then run

alita native

documents

camera

cordova-plugin-camera

config.xml config

<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>need camera access to take pictures</string>
</edit-config>

<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>need photo library access to get pictures from there</string>
</edit-config>

<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
    <string>need location access to find things nearby</string>
</edit-config>

<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
    <string>need photo library access to save pictures there</string>
</edit-config>

device

cordova-plugin-device

dialogs

cordova-plugin-dialogs

file

cordova-plugin-file

secure-storage

cordova-plugin-secure-storage

config.xml config

<platform name="ios">
    <preference name="KeychainAccessibility" value="WhenUnlocked"/>
</platform>

supported values:

AfterFirstUnlock
AfterFirstUnlockThisDeviceOnly
WhenUnlocked (default)
WhenUnlockedThisDeviceOnly
WhenPasscodeSetThisDeviceOnly (this option is available only on iOS8 and later)

geolocation

cordova-plugin-secure-geolocation

  • ios
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
    <string>need location access to find things nearby</string>
</edit-config>

inappbrowser

cordova-plugin-secure-inappbrowser

media

cordova-plugin-secure-media

media-capture

cordova-plugin-media-capture

  • ios
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>need microphone access to record sounds</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>need to photo library access to get pictures from there</string>
</edit-config>

keyboard

cordova-plugin-ionic-keyboard

network

cordova-plugin-network-information

screen-orientation

cordova-plugin-screen-orientation

statusbar

cordova-plugin-statusbar

vibration

cordova-plugin-vibration

file-opener

cordova-plugin-file-opener2

document-viewer

cordova-plugin-document-viewer

fingerprint-aio

cordova-plugin-fingerprint-aio

config

  • iOS - XCode 9.2 or higher required Please set <preference name="UseSwiftLanguageVersion" value="4.0" /> in your config.xml
  • if use face id, NSFaceIDUsageDescription need to be added in info.plist

native-storage

cordova-plugin-nativestorage

qr-scanner

cordova-plugin-qrscanner

sqlite-storage

cordova-sqlite-storage

Next
核心概念