Device
Provides methods to use native device capabilities.
Important
If you want to use the device API methods, you need to declare the usage of these method in feature-usage node in the manifest file.
Available for
Model-driven and canvas apps
Syntax
context.device
Methods
Method | Description |
---|---|
captureAudio | Invokes the device microphone to record audio. |
captureImage | Invokes the device camera to capture the image. |
captureVideo | Invokes the device camera to record video. |
getBarcodeValue | Invokes the device camera to scan the barcode information, such as product number. |
getCurrentPosition | Returns the current location using the device geolocation capability. |
pickFile | Opens a dialog box to select files for the upload. |
Example
private onUploadButtonClick(event: Event): void {
this._context.device.pickFile().then(this.processFile.bind(this), this.showError.bind(this));
}
Sample controls
Device API component
Image upload component
Related articles
Power Apps component framework API reference
Power Apps component framework overview
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για