Исходный код вики Manifest
Редактировал(а) Alexandr Fokin 2022/07/22 17:23
Последние авторы
author | version | line-number | content |
---|---|---|---|
1 | **1) Разрешение подключения по http (без ssl).** | ||
2 | |||
3 | Android: [[Manifest>>Разработка.JVM.Java.Frameworks and Apps.Android.Manifest.WebHome]] | ||
4 | |||
5 | IOS: | ||
6 | Добавить | ||
7 | |||
8 | {{code language="xml"}} | ||
9 | <key>NSAppTransportSecurity</key> | ||
10 | <dict> | ||
11 | <key>NSAllowsArbitraryLoads</key> | ||
12 | <true/> | ||
13 | </dict> | ||
14 | {{/code}} | ||
15 | |||
16 | The resource could not be loaded because the App Transport Security policy requires the use of a secure connection | ||
17 | [[https:~~/~~/stackoverflow.com/questions/32631184/the-resource-could-not-be-loaded-because-the-app-transport-security-policy-requi>>url:https://stackoverflow.com/questions/32631184/the-resource-could-not-be-loaded-because-the-app-transport-security-policy-requi]] | ||
18 | |||
19 | ---- | ||
20 | |||
21 | **2) Доступ к файлам. Android** | ||
22 | |||
23 | [[Manifest>>Разработка.JVM.Java.Frameworks and Apps.Android.Manifest.WebHome]] | ||
24 | |||
25 | Xamarin forms: How to create folder and a file in device external storage? | ||
26 | [[https:~~/~~/stackoverflow.com/questions/66469608/xamarin-forms-how-to-create-folder-and-a-file-in-device-external-storage>>https://stackoverflow.com/questions/66469608/xamarin-forms-how-to-create-folder-and-a-file-in-device-external-storage]] | ||
27 | |||
28 | Xamarin-System.UnauthorizedAccessException: Access to the path is denied | ||
29 | [[https:~~/~~/stackoverflow.com/questions/46911486/xamarin-system-unauthorizedaccessexception-access-to-the-path-is-denied>>https://stackoverflow.com/questions/46911486/xamarin-system-unauthorizedaccessexception-access-to-the-path-is-denied]] | ||
30 | |||
31 | Access to the path "/storage/emulated/0/NewTxt.txt" is denied.' | ||
32 | [[https:~~/~~/social.msdn.microsoft.com/Forums/en-US/5931f217-8590-4289-8a33-c9a5c07faf50/access-to-the-path-quotstorageemulated0newtxttxtquot-is-denied?forum=xamarinforms>>url:https://social.msdn.microsoft.com/Forums/en-US/5931f217-8590-4289-8a33-c9a5c07faf50/access-to-the-path-quotstorageemulated0newtxttxtquot-is-denied?forum=xamarinforms]] | ||
33 | |||
34 | Can't write to Android External storage even with permissions set | ||
35 | [[https:~~/~~/stackoverflow.com/questions/60569224/cant-write-to-android-external-storage-even-with-permissions-set/60594975#60594975>>url:https://stackoverflow.com/questions/60569224/cant-write-to-android-external-storage-even-with-permissions-set/60594975#60594975]] | ||
36 | |||
37 | {{code language="c#"}} | ||
38 | //Пример кода с явным запросом прав на доступ | ||
39 | var PackageName = AppInfo.PackageName; | ||
40 | var requiredPermissions = new string[] { | ||
41 | Manifest.Permission.ReadExternalStorage, | ||
42 | Manifest.Permission.WriteExternalStorage | ||
43 | }; | ||
44 | |||
45 | var needPermissionRequest = false; | ||
46 | foreach (var elem in requiredPermissions) | ||
47 | { | ||
48 | if (PackageManager.CheckPermission(elem, PackageName) != Permission.Granted) | ||
49 | { | ||
50 | needPermissionRequest = true; | ||
51 | } | ||
52 | } | ||
53 | |||
54 | if (needPermissionRequest) | ||
55 | { | ||
56 | RequestPermissions( | ||
57 | requiredPermissions, | ||
58 | 1 | ||
59 | ); | ||
60 | } | ||
61 | {{/code}} |