Skip to content

Commit

Permalink
Merge branch 'ios-setup'
Browse files Browse the repository at this point in the history
  • Loading branch information
christocracy committed Apr 2, 2024
2 parents 7e18b56 + f7848ea commit 9fbd103
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 51 deletions.
51 changes: 4 additions & 47 deletions example/ios/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
PrivacyInfo.xcprivacy
TSLocationManager
Runner
Created by Christopher Scott on 2024-03-20.
Copyright (c) 2024 Christopher Scott. All rights reserved.
Created by Christopher Scott on 2024-04-02.
Copyright (c) 2024 The Chromium Authors. All rights reserved.
-->
<plist version="1.0">
<dict>
<key>NSPrivacyTrackingDomains</key>
<array/>

<key>NSPrivacyAccessedAPITypes</key>
<array>
<!-- background-fetch & background-geolocation -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>

<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
<string>1C8F.1</string>
</array>
</dict>
<!-- CocoaLumberjack (required by background-geolocation) -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
<string>0A2A.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>

</array>

<key>NSPrivacyCollectedDataTypes</key>
<array/>

<key>NSPrivacyTracking</key>
<false/>
</dict>
<dict/>
</plist>
86 changes: 82 additions & 4 deletions help/INSTALL-IOS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# iOS Installation

### Permissions & Background Modes

#### Using XCode
## Permissions & Background Modes

Open the Xcode project `ios/Runner/Runner.xcworkspace`

Expand All @@ -23,7 +21,7 @@ Open the Xcode project `ios/Runner/Runner.xcworkspace`

![](https://dl.dropboxusercontent.com/s/wyoejgko6xq4pi4/iOS-permissions.png?dl=1)

#### Or edit `Info.plist` directly
### Or edit `Info.plist` directly

:open_file_folder: `ios/Runner/Info.plist`

Expand All @@ -45,6 +43,86 @@ Open the Xcode project `ios/Runner/Runner.xcworkspace`
</plist>
```

## Privacy Manifest

Apple now requires apps provide a [Privacy Manifest for "sensitive" APIs](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api?language=objc) which could be abused for "fingerprinting" a user for malicious marketing activity.

If your app does not yet have a *Privacy Manifest* (__`PrivacyInfo.xcprivacy`__), create one now:

<details>
<summary>ℹ️ Click here for detailed instructions...</summary>

- In XCode, __`File -> New -> File...`__:

![](https://dl.dropboxusercontent.com/scl/fi/n28028i3fbrxd67u491w2/file-new-PrivacyInfo.png?rlkey=sc7s1lyy8fli2c1hz2cfa4cpm&dl=1)

- Be sure to enable your `Targets: [x] YourApp`:

![](https://dl.dropboxusercontent.com/scl/fi/pmbfn5jypvns6r5pyhnui/file-new-PrivacyInfo-targets.png?rlkey=epvjffar23bxgyi9xax9ys40i&dl=1)


</details>


It's best to edit this file's XML manually.
- :open_file_folder: `ios/PrivacyInfo.xcprivacy`
- Add the following __4 blocks__ within the `NSPrivacyAccessedAPITypes` `<array>` container:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<!-- [1] background_fetch: UserDefaults -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>

<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>

<!-- [2] background_geolocation: UserDefaults -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>

<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
<string>1C8F.1</string>
</array>
</dict>
<!-- [3] background_geolocation (CocoaLumberjack): FileTimestamp -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
<string>0A2A.1</string>
</array>
</dict>
<!-- [4] background_geolocation (CocoaLumberjack): DiskSpace -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>
</array>
</dict>
</plist>
```

## [Configure `background_fetch`](https://github.com/transistorsoft/flutter_background_fetch/blob/master/help/INSTALL-IOS.md)

The BackgroundGeolocation SDK makes use internally on __`background_fetch`__ (also created by [Transistor Software](https://www.transistorsoft.com)). Regardless of whether you instend to implement the BackgroundFetch Dart API in your app, you **must** perform the [Background Fetch iOS Setup](https://github.com/transistorsoft/flutter_background_fetch/blob/master/help/INSTALL-IOS.md) at the __`background_fetch`__ repo.

0 comments on commit 9fbd103

Please sign in to comment.