240 Commits

Author SHA1 Message Date
Han Young
4ff5232e8a fix incorrect return enum 2023-02-02 03:57:38 +00:00
Apollo Zhu
f850f41499 Update Screenshot/Testing Workflow for Xcode 14 and iOS 16
- Fix CI config
- Update Package.resolved format
- Since SwiftUI `List` is now implemented using collection view, tests that use `tables` are updated to use alternatives
- Generate additional screenshots for 6.7" display (iPhone 14 Pro Max) for App Store Connect
2023-02-02 03:53:03 +00:00
Apollo Zhu
60cd54f130 Release 0.3.1 v0.3.1 2023-01-30 17:09:13 -08:00
Apollo Zhu
54ea9f3038 [Fix] Implement chunk based file transfer
Currently, share plugin will load all the files been transferred into app's memory. This is problematic because iOS limits how much memory each app can use, so transferring large files will cause the app to run out of memory and crash. To make the matter worse, somehow bridging between `NSData` and `Data` caused Swift to make a copy of `NSData`'s contents, doubling the memory needed to transfer files.

This merge requests implements chunk based file transfer, where only a small portion of file contents is loaded into memory, while most remain on disk, for both sending and receiving. To simplify the logic, urls to payloads (i.e. file contents) are now stored in separate arrays for sending and receiving, so locking mechanism is simpler: use `_pendingLSockets` for locking shared resources for sending out files, and `_pendingRSockets` for receiving. Thus, it should also fix the "refresh discovery freezes app" issue that people have reported.

During the implementation process I've identified some potential issues to be fixed, but they remain TODOs to keep the diff/change in behavior more contained.

## Testing

The app's memory usage remained around 30MB before, during, and after the file transfer process. I was able to successfully receive large files such as Xcode.xip (around 7GB) with up to 20MiB/s transfer speed, receive multiple files transferred together, send a single/multiple file/photos/videos between KDE Connect iOS and KDE Connect Qt macOS client, and between iOS and iOS (with and without chunked file transfer)

![Transfer Speed can be up to 20 MiB per second](/uploads/56fca1ff12f4219e9a6f977fcbcbf20f/Screenshot_2022-10-26_at_23.47.33.png)

Transfer speed dropped to around 10 MiB/s during when I tried to transfer another large file, but I suspect this is likely due to network condition instead of problem in the implementation. The following shows CPU, memory, disk, and network usage:

![Xcode](/uploads/5e8767fb52acaae557fa72f350d7bfdd/Xcode.png)
2022-11-06 17:40:43 +00:00
Han Young
b2d0927dca support keyboard input in remote input 2022-11-03 19:13:53 +00:00
Apollo Zhu
75710877ca [Fix] Add keychain access group to entitlement
Fix crash on launch for running as iOS app on Mac

## Suggested Way of Testing

1. Install and run 0.3.0 (6) on Mac with Apple Silicon, it should crash on launch
2. Build, install, and run with changes in this MR, it should not crash on launch
2022-10-30 10:57:11 +00:00
Apollo Zhu
fdb7de1ee1 Use User Assigned Device Name on iOS 16
Resolve https://phabricator.kde.org/T15849

![iOS_16_with_actual_device_name](/uploads/4a432255c9bfc36327e72aabfd9462e1/iOS_16_with_actual_device_name.jpg)
2022-10-26 18:55:44 +00:00
Apollo Zhu
479ea9e382 Fix battery icon color on iOS 16
On iOS 16, list selections in Split View now have a new default row background. This change updates the battery icon color to use the correct primary label color.

## Screenshots

### iOS 16

||Light (Fixed)|Dark (No change)|
|--|--|--|
|Old|![Old_iOS_16_Light](/uploads/6ac6fc83779e09c702a231a41d06647d/Old_iOS_16_Light.png)|![Old_iOS_16_Dark](/uploads/c7ac4ba3799bf33e44009800157273f0/Old_iOS_16_Dark.png)|
|New|![New_iOS_16_Light](/uploads/7b74d8e3685905330363964a6843717c/New_iOS_16_Light.png)|![New_iOS_16_Dark](/uploads/802c3992c3f792a22cd4c84d92f067fc/New_iOS_16_Dark.png)|

### iOS 15

No change

|Light|Dark|
|--|--|
|![New_iOS_15_Light](/uploads/ab679d6c3f068ccbfaf54ebee233b1f3/New_iOS_15_Light.png)|![New_iOS_15_Dark](/uploads/e2340dc92f9d2a4b2e80f9935ca4de9c/New_iOS_15_Dark.png)|

### iOS 14

**It has the same problem, but no change.** I was not able to find a solution.


|Light|Dark|
|--|--|
|![New_iOS_14_Light](/uploads/9ed2aa1214d79fee237bcd250e141521/New_iOS_14_Light.png)|![New_iOS_14_Dark](/uploads/ed79c791e88dd555d177d026afe53998/New_iOS_14_Dark.png)|
2022-10-26 18:49:48 +00:00
Apollo Zhu
9ee93dd587 Pin dependencies to exact version or commit
This helps prevent accidentally reverting dependency update in the future.
2022-09-28 03:08:26 +00:00
Apollo Zhu
4ceda1d4c3 Fix empty IP textfield crash on iOS 16
Tested on iOS 14, 15 and 16 simulator; and iPhone running iOS 16.

## Reproduce

1. Go to "Configure Devices by IP"
2. Tap "+" button
3. Tap "return" key on the keyboard
4. Crash before this change, does not crash with this change.
2022-09-28 00:42:22 +00:00
Ruixuan Tu
5f6242178f [Fix] Opaque TabView for iOS 15+
fix: (tf 220731) Devices tab at the bottom overlaps with sidebar
2022-09-27 22:31:20 +00:00
Apollo Zhu
644f9737c9 Update CocoaAsyncSocket to fix iOS 16 crash
https://github.com/robbiehanson/CocoaAsyncSocket/pull/802

This is a high impact bug that significantly increased our number of crashes. On iOS 16, the app crashes on refresh (or even launch sometimes), especially if another reachable/paired device is present.

Tested the fix on iPhone running iOS 16
2022-09-26 01:32:32 +00:00
Apollo Zhu
6dd062286e Release 0.3.0 v0.3.0 2022-06-25 19:06:53 -07:00
Apollo Zhu
df2b273428 Bump OpenSSL 1.1.1200 -> 1.1.1501 2022-06-26 01:38:38 +00:00
Apollo Zhu
d5e192a0d5 [Feature] Generate Screenshots with UI Tests
## Changelog

- Lower test targets to iOS 14 (same as the main app)
- Separate Device initialization from network package
- Write UI test to take screenshots for most parts of the app
- Add fastlane as a dependency
- Force xcodebuild to use arm64 architecture when run by GitLab CI

## Usage

Install [fastlane](https://fastlane.tools/), navigate to KDE Connect folder in terminal, and run `fastlane screenshots`

## Motivation

As we are preparing for release on the App Store, one requirement is to provide screenshots. Automating the process (as much as we can) allows us to focus on other aspects of the development.

## Demo

![Screenshots of KDE Connect on different devices required by the App Store](/uploads/48e095d68ad9b1701691de7d0900bb59/Screen_Shot_2022-02-25_at_20.08.27.png)

```
+---------------------------------------+-------+
|               snapshot results                |
+---------------------------------------+-------+
| Device                                | en-US |
+---------------------------------------+-------+
| iPhone 8 Plus                         |  💚   |
| iPhone 13 Pro Max                     |  💚   |
| iPad Pro (12.9-inch) (2nd generation) |  💚   |
| iPad Pro (12.9-inch) (5th generation) |  💚   |
+---------------------------------------+-------+

[20:01:31]: Generating HTML Report
[20:01:31]: Successfully created HTML file with an overview of all the screenshots: '~/kdeconnect-ios/KDE Connect/fastlane/screenshots/screenshots.html'

+------+---------------------------------------------------------------+-------------+
|                                  fastlane summary                                  |
+------+---------------------------------------------------------------+-------------+
| Step | Action                                                        | Time (in s) |
+------+---------------------------------------------------------------+-------------+
| 1    | default_platform                                              | 0           |
| 2    |        if [ -z "`xcrun simctl list devices available | grep ' | 0           |
| 3    | capture_screenshots                                           | 280         |
+------+---------------------------------------------------------------+-------------+

[20:01:33]: fastlane.tools finished successfully 🎉
```
2022-06-26 01:31:40 +00:00
Apollo Zhu
cf953f23ed [Feature] Developer Tools
## Changelog

- Added SwiftUI-Introspect as a dependency
- Replaced all `NSLog` and `print` with `OSLog`
- Added a hidden developer mode, activatable by:
   - tapping the build version 10 consecutive times, 
   - activate the build version label with VoiceOver, or
   - in `DEBUG` mode with `isDebugging` in the launch argument (enabled by default)
- Added a OSLog view to see the logs, with basic filters and search
- Added a Network Package composer to author network packages 
   - Added a hidden network package debug mode that sets capabilities to all network packges, activatable by:
      - typing `isDebuggingNetworkPackage` in the Network Package composer payload text editor
      - in `DEBUG` mode with `isDebuggingNetworkPackage` in the launch argument (disabled by default)
- Replace `[self]` with `[weak self]` everywhere
   - Address crash on `Battery.sendBatteryStatusOut()`
   - log Battery instance leak for debugging

## Note

- Debug messages are only available for viewing when attached to a debugger
- Privacy redaction is not applied to network packages (device's UUID assigned by KDE Connect and name will be exposed in the log)
- These logs are stored on users' devices only and we have no way of accessing them. Users must manually export/screenshot the logs 

## Known Issues

- OSLog vieweing is only available on iOS 15 because Apple didn't have time to deliver it for iOS 14
- Network Package Composer does not support adding file payload because the existing payload mechanism consumes too much memory and is hard to work with
- Contributors need to learn OSLog: https://invent.kde.org/network/kdeconnect-ios/-/wikis/Logging-with-OSLog

## Demo

![OSLog and developer tools](/uploads/45313a3cd24c683709868cdc69b7f0bb/KDE_Connect_iOS_-_OSLog___Developer_Tool.mp4)

![Network Package composer](/uploads/9910dd4f49bd7d172ecb029a65dca5b0/IMG_0713.PNG)
2022-06-26 00:50:28 +00:00
Apollo Zhu
56789f54dc [UI/UX] Refine Interface for iPad
## Changelog

- Use the default navigation view style for all devices
- Move the device discovery help to the bottom toolbar (since footers might not always be displayed)
- Adjust layout of Settings view for accessibility font
- Choose better presenter view layout based on size class
2022-06-26 00:23:38 +00:00
Apollo Zhu
bed5ce0b04 [Doc] Update for App Store
Update README with information about App Store.

- Include link to App Store in TLDR
- Move TestFlight to a later section, and specify it supports iOS app on Mac with Apple silicon
2022-06-25 23:25:36 +00:00
Apollo Zhu
ab9836bd30 [i18n] Make Xcode export all user interface strings for localization
## Changelog

- Enabled "Use Compiler to Extract Swift Strings" (`SWIFT_EMIT_LOC_STRINGS`) in build settings
- `Contributors.json` is replaced by `Contributors.swift` so it's easier for us to implement !67 
- Internationalize `ColorScheme` (app theme) picking UI
- Added `NSLocalizedString` to parts of the program that's missing it
- Fixed typos and unified spellings

## Example XLIFF

[en.xliff](/uploads/896b985db5bd616fb0cf0c214f3933f2/en.xliff)

## Detours

I was initially misguided by [Preparing Views for Localization](https://developer.apple.com/documentation/swiftui/preparing-views-for-localization) saying that "Xcode doesn’t parse these views [other than Text] for localization, you need to manually add the localization strings." The code that switch all `LocalizedStringKey` to `Text` can be found at https://invent.kde.org/apollozhu/kdeconnect-ios/-/commits/work/localization/xcodebuild-exportLocalizations-backup, and it produced [en.xliff](/uploads/703d947032c6b2eb5f5b0b9352d2423e/en.xliff).
2022-06-25 23:20:40 +00:00
Apollo Zhu
6368f2a09c [Doc] Link to Troubleshooting in device discovery help
Inform people to try configure firewall if device discovery isn't working by checking out the [User Manual](https://userbase.kde.org/KDEConnect#Troubleshooting):


![image](/uploads/7cdf252dcf9b646be1ed04b07dbcc781/image.png)

https://www.reddit.com/r/kde/comments/uo6v0s/has_anyone_gotten_their_iphone_to_work_with_kde/
2022-06-25 23:09:40 +00:00
Apollo Zhu
102e6125cf [Fix] Address Missing Remote Device Certificate After Pairing
Fixing the error tone that sometimes happens after pairing succeeds.

## Reproduce Error Tone

### Setup

1. Pair devices
2. Verify that both can see the certificates' SHA256.
3. Quite the app

### Test

1. Saved Device
2. Unpair
3. Self or other pair
2022-06-25 23:08:11 +00:00
Apollo Zhu
86249ffb0d [Fix] Fix photo/video picker not responsive
## Changelog

- Fixed app getting stuck on importing media when a large number of images/videos are selected
- Show detailed progress bar when loading images/videos
- Update text while loading images to "Preparing Media…" due to confusion about "Importing Media..." (since we should be sending those out)
- Load original HEIC images instead of jpg/png when possible

## Dependency Changes

- SwiftUI-MediaPicker 0.0.1 -> 0.2.0
2022-06-25 23:04:49 +00:00
Apollo Zhu
de67fd003a [Config] Enable Analyzer and Fix Related Issues 2022-06-25 23:02:07 +00:00
Apollo Zhu
cdff8cc714 [Doc] Update features list
- Pairing works fine with Ubuntu now, but there are quite a few reports about not working with Windows
- Someone suggested that we can implement clipboard sync through custom Siri Shortcuts and asked for URL Scheme
- We can't forward notifications, but it seems to be possible for other KDE Connect clients to retrieve iOS notifications https://invent.kde.org/network/kdeconnect-ios/-/wikis/Random-Notes#notification
- Emphasis that app can't work in the background:

![image](/uploads/2fda6c8bb7cff3c05b3e600d9a1aeb0e/image.png)
2022-06-25 23:00:41 +00:00
Apollo Zhu
ca02f326e2 [Fix] use correct keychain access group
Should no longer print "Result -34018" (errSecMissingEntitlement)

https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps#2973738
2022-06-25 22:58:12 +00:00
Claudio Cambra
cb368fbf55 Split up Backend.swift into several different files
At the moment `Backend.swift` gathers a number of different things that don't have much of a relation to each other.

This MR separates parts of `Backend.swift` into their own files.
2022-06-10 08:22:18 +00:00
Apollo Zhu
d24e5ca5eb [Fix] Allow commandList JSON to Avoid Crashing
Fixes crash caused by GSConnect implementation https://github.com/GSConnect/gnome-shell-extension-gsconnect/issues/1051

Justification: this "bug" has already been fixed by GSConnect, which now sends a String instead of JSON. However, this fix is to ensure that older version of GSConnect (which are quite common as they're version-freezes by Long-Term-Support distribution releases) don't cause crashes with KDE Connect iOS.

## Test

> Test case found in https://github.com/GSConnect/gnome-shell-extension-gsconnect/pull/1053

Check that a network package body like this always works:

```json
{
    "commandList": "{\"command-uuid\":{\"name\": \"Test Command\",\"command\":\"ls\"}}"
}
```

Check that a network package body like this only works with this fix:

```json
{
    "commandList": {
        "command-uuid": {
            "name": "Test Command",
            "command": "ls"
        }
    }
}
```
2022-05-09 06:21:41 +00:00
Apollo Zhu
43d2ecbbb7 Release 0.2.1 2022-05-08 01:46:09 -07:00
Apollo Zhu
1bb5c5454b [Fix] Load saved devices on launch
Fixes saved devices not showing up until the `_devices` state changes again.

## Discussions

Have to include devicesListsMap in signature because the first invocation is before initialization is done

## Testing

Confirmed master is not working. Checked in the simulator with a previously paired device.
2022-05-08 06:07:06 +00:00
Apollo Zhu
cd83e3e018 [UX] Automatically set empty IP address text field as first responder
Finishing touch of !42, alerts queue.

## Changelog

- Fix crash on iOS 14 when finish editing
- Add auto focus empty ip address text field
- Add SwiftUI Introspect as dependency
- Add new folder for iOS 14 compatibility views

## Why was this not a part of Season of KDE

1. I wish I had more time to set this up, but we ran out of time
2. Implementation requires understanding of UIKit, Combine, property wrapper, and generics
2022-05-08 01:15:25 +00:00
Apollo Zhu
9e9cd5aee2 [Fix] Address Ubuntu 20.04 not pairing
Only consider payloadTransferInfo is for payload if with port specified. 

## Bug Reports

- https://forum.kde.org/viewtopic.php?f=18&t=173218
- Various on TestFlight
- In KDE Connect group chat

## Testing

Tested to ensure that pairing and file transfer works with iOS, macOS, Android, and Ubuntu.
2022-05-08 01:06:26 +00:00
Apollo Zhu
21adaf4be7 [Config] App Uses Non-Exempt Encryption : No
Per discussions in https://phabricator.kde.org/T15317, the app qualifies for exemption "**(c) Limited to authentication, digital signature**, or the decryption of data or files" provided in Category 5, Part 2 of the U.S. Export Administration Regulations. Thus, we add [ITSAppUsesNonExemptEncryption](https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption)

**Update, May 7th 2022:**

**Justification of exemption decision from the KDE Connect iOS developers:**

KDE Connect iOS uses encryption for the sole purpose of securing traffic between KDE Connect clients over the network and its related authentication. Therefore, it is reasonable to describe KDE Connect's usage of TLS encryption as a "message carrier" that carries the sole purpose of securing data during transfer, where it's not localized on the device on which the clients are installed onto.

To establish this secure transfer link, KDE Connect also uses encryption and digital signature to authenticate devices upon connection and pairing. This ensures that only devices that are authorized and trusted can be used to establish any secure connections for data transfer.

**Since KDE Connect's use of encryption lies solely for the purposes stated above, we (the KDE Connect developers) believe that all of the usage cases fall under the term "limited to authentication, digital signature, or the decryption of data or files" as defined by category (c) of the encryption. Therefore, we (the KDE Connect developers) believe that KDE Connect iOS is exempt from the App Store encryption compliance policies, with no additional actions required to release KDE Connect iOS on the App Store.**

Selecting the exempt option (as described above) in the App Store Connect portal effectively ends the encryption compliance process with the verdict that the app is not required to submit any further information regarding its use of encryption for the US regulations or French regulations. If our decision that KDE Connect iOS's qualification under exemption (c) is valid, no further actions would be needed in terms of encryption compliance to release the app on the App Store.
2022-05-07 23:25:06 +00:00
Stefan Kowalczyk
dca72ef742 [Feature] Alerts queue
**Feature goal:** To implement a system that allows for queuing multiple alerts.

**Motivation:** Currently, if more than one alert were to appear on-screen, only the first one is displayed, the rest gets dismissed without showing them to the user.
2022-04-24 09:20:47 +00:00
Claudio Cambra
e9f62499ee Replace UIFeedbackImpactGenerator array with enum extension
Hi, this PR replaces the UIFeedbackImpactGenerator array in `Backend.swift` with an enum extension of FeedbackStyle. This should make calling the different levels of haptics more elegant and allows us to have to do fewer ugly rawValue conversions in the rest of the code
2022-04-20 08:07:46 +00:00
Claudio Cambra
35d2bc0995 Remove unidiomatic '-> Void'
A small clean up removing usage of '-> Void'
2022-03-28 20:35:13 +00:00
Claudio Cambra
57e7c896cd Use an individual enum for AudioServicePlaySounds() instead of individual constants
Hey all, found this task on Phabricator and took it, review welcome 😄 

This PR replaces the previous constants with a single enum with a play method, per the suggestion in the comments of `Backend.swift`
2022-03-25 09:17:20 +00:00
Apollo Zhu
a6011fc863 [UI/UX] Add Features List
## Changelog

Add a list of KDE Connect features and their implementation status in Settings.

## Rationale

There have been quite a few bug reports about the app not working in the background and questions about "is X available in KDE Connect iOS?" Having a features list allows us to:

1. be more transparent about what works what doesn't work, and hopefully reduce the number of questions about this
2. have a clear roadmap about what remains unimplemented and open for work

## Demo

|iOS 14|iOS 15|
|--|--|
|![iOS14](/uploads/faa9bb335b595c11519e9dfc24e4532d/iOS14.mp4)|![iOS15](/uploads/86a088a9e0a2fd8add1af4e25350cc16/iOS15.mp4)|
2022-03-06 02:10:22 +00:00
Apollo Zhu
1c7b72a747 [Feature] [UI/UX] Alternative App Icon
Seeking feedback about the new app icon design and feel free to let us know what you think!

## Suggested Feedback Template

1. How do you feel about the new logos?
2. Do the new logos better adhere to the [iOS Human Interface Design Guidelines](https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/app-icon/) than the old logo?
3. Are the new logos more recognizable as KDE Connect than the old logo, in general and when displayed among other apps?
4. In conclusion, would you suggest switching to one of the new logos? Why or why not?
5. If yes, should we provide the old/other logos as options for users to choose in-app?
6. Any other suggestions, questions, concerns, or things you'd like us to know?

---

## Rationale

1. Transparent, irregular-shaped icons don't work well on iOS; they will instead have a solid black background.
2. Icons are usually displayed with a small size, making the current one hard to distinguish from other apps. One TestFlight feedback suggests:

> UI/UX modification requests: 1. iOS devices use square icons with rounded corners. Current KDE connect logo on iPhone looks completely out of place, making it harder to recognize. Use the attached png logo instead. [image source: https://freesvg.org/kde-logo ] For ideal use - breeze grey color kde logo with white background if ios system theme is light and revese the colors if system is in dark mode.

## New Logos

The SVG versions are in the [Wiki](https://invent.kde.org/network/kdeconnect-ios/-/wikis/Logos) for future use.

||old|new|old on device|new on device|
|--|--|--|--|--|
|iOS (Android)|![KDE Connect iOS old icon](/uploads/20eac12cac8df6ea9a1606a0f649be19/KDE_Connect_iOS_old.png)|![KDE_Connect_iOS-Android](/uploads/fe12fbeed2ded6399e196c16579abad5/KDE_Connect_iOS-Android.png)|![old icon on iOS](/uploads/32176bd79c19064141692afadd20f613/old_iOS.png)|![KDE_Connect_iOS-Android_on_Device](/uploads/29c54d0b609f07e50ef3514b6827d976/KDE_Connect_iOS-Android_on_Device.png)|
|iOS (macOS)|![KDE Connect iOS old icon](/uploads/20eac12cac8df6ea9a1606a0f649be19/KDE_Connect_iOS_old.png)|[![KDE Connect iOS new icon](/uploads/6062b67ed6905c37159f921cb35b1518/KDE_Connect_iOS.png)](https://dribbble.com/shots/17573735-KDE-Connect-iOS-App-Icon)|![old icon on iOS](/uploads/32176bd79c19064141692afadd20f613/old_iOS.png)|![new icon on iOS](/uploads/2d921e8e26afc14b07fcbaba1497a49b/new_iOS.png)|

### iOS (Android)

0. This is the new default logo
1. Based on https://invent.kde.org/network/kdeconnect-android/-/merge_requests/279
2. The removal of gradient and higher contrast with orange background significantly improved the legibility

### iOS (macOS)

1. Preserves the device bezels (and most of the current design) to differentiate from KDE as a whole https://invent.kde.org/network/kdeconnect-android/-/merge_requests/119#note_22722
2. Having a non-vertical bezel hints that we not only support iPhones but also iPads (and Apple Silicon Macs)
3. Works with another new macOS icon candidate (not included in this MR) for when we make KDE Connect iOS serve as KDE Connect macOS in the future (note: not to replace the icon of the Qt version):

||old|new|old on device|new on device|
|--|--|--|--|--|
|macOS|![KDE Connect macOS old icon](/uploads/7284dfd2c4211ee4cf7c94b1f566f195/1024-apps-kdeconnect.png)|[![KDE Connect macOS new icon](/uploads/a018bc6e14116b0416b921731dd4aec9/kDE_Connect_macOS.png)](https://dribbble.com/shots/17573418-KDE-Connect-macOS-11-App-Icon)|![old icon on macOS Dock](/uploads/ca0cf6e278a348df639f33a44095ca53/Screen_Shot_2022-02-22_at_23.50.06.png)![old icon on macOS Launcher](/uploads/2ac9a891350b0064f36b8e63c9a4f261/Screen_Shot_2022-02-22_at_23.49.38.png)|![new icon on macOS Dock](/uploads/5a94d6b31c434da9041358bc6761a7d9/image.png)![new icon on macOS Launcher](/uploads/642f6a9ce9a9068e32544540d4989ec2/Screen_Shot_2022-02-22_at_23.49.08.png)|

## UI Changes in App

|light mode|dark mode|
|--|--|
|![new rounded rectangle app icon in About, light](/uploads/7b3fc14dcf32492bf5ff5881c05eed63/image.png)|![new default app icon in About, dark](/uploads/1f3a2dbdd377531e8ab0e94392462d13/image.png)|

## Demo

![alternative icon is working](/uploads/a10e8b6eec3ae2f8de8661540fb8bf48/icon.mp4)

## References

- [iOS App Icon Guideline](https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/app-icon/)
- [macOS App Icon Guideline](https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon/)
- [Other macOS KDE icon designs](https://macosicons.com/#/kde)
2022-03-06 01:50:53 +00:00
Apollo Zhu
30844f8f90 [Refactor] Remove Unused folder (T15152)
Implements https://phabricator.kde.org/T15152

- `KeychainItemWrapper` is still in use, moved to `ObjC Backend` 
- Deleted files from Unused and saved to https://invent.kde.org/network/kdeconnect-ios/-/snippets/2031 for future reference
  - `SettingsListCellView` and `PlaceholderView` are not saved as they are easy to recreate
- Remove unused `import UIKit`, and import UIKit where they are used (where currently implicitly imported)
  - This prepares us to have a better understanding of what needs to be done for enabling macOS target

**Context:** The "unused" folder was first introduced by @lucaswzx in July/August 2021 as a /tmp directory to house various files and code that were either removed from the active project during development, or housed temporarily for use later. At the time of this merge request, most of the files inside the directory are definitively unused in the project and likely wouldn't be included in any short-term future development plans.
2022-03-06 01:19:19 +00:00
Apollo Zhu
5359942ccc [UI/UX] Reorganize README (T15105)
## Changelog

- Removed TODOs & Plans from README since we are using Phabricator now
- Updated Lucas' website URL to the correct working one
- Lowered minimum iOS version to participate in TestFlight from 15 to 14
- Restructured README to have a clearer division between sections
- Misc wording and style changes

## Preview

https://invent.kde.org/apollozhu/kdeconnect-ios/-/tree/update-readme
2022-03-06 00:50:26 +00:00
Nicolás Alvarez
a19cb2267b Fix GitLab CI by setting iOS 15.2
The GitLab CI script was building for iOS 15.0,
but it seems our Mac only has 15.2 simulator now.
2022-03-05 03:35:52 +00:00
Apollo Zhu
7cf0025c3d [Hotfix] Address crashes for paired device without battery plugin
No longer force unwrap the battery plugin that may not exist.

## Testing

- Tested to ensure the UI remains unchanged and auto-updates whenever changes happen
- Tested with no battery plugin added and the app no longer crashes
2022-03-03 09:09:25 +00:00
Weixuan Xiao
c23649edf1 [Feature] Add text and URL sharing handler
Copy to clipboard if text sharing received;
Open the URL by following the URL scheme in iOS if URL sharing received.
2022-02-27 12:54:56 +00:00
Apollo Zhu
e5cec8b598 [UI/UX] Rephrase DevicesView Instructions
Change instructions to provide scenario-based help in DevicesView.

## Changelog

- Simplified the text displayed when each section is empty
- Adds a dedicated help popup for fixing device discovery issues
- Only include footer help for reconnecting previously connected devices if there are remembered devices

## Rationale

> **People look for help when they can’t figure out how to *accomplish a goal.*** Although users sometimes want a quick reference guide, they’re more likely to seek help with specific tasks. In general, describe control usage in the context of accomplishing a task.
> https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/help/#apple-help

We received a question about KDE Connect iOS not being able to discover other devices, and they were able to resolve it by following the instruction listed as the section footer, which is "Configure Devices by IP." Despite the current phrasing accurately identifying why the problem happened, it isn't clear to the users that the instruction is for such a problem.

Additionally, we have feedback on TestFlight that states:

> UI/UX modification requests: 4. Shorten the Discoverable Devices warning on the main opening page to this: "No new devices discovered. Please refresh discovery and check if other devices are running KDE connect & are on the same network as this this device." Current warning has some grammatical errors and lengthy text becomes distracting/confusing to user.

Thus, we could mimic examples from the iOS Settings App:

|Footer|Popover|
|--|--|
|![iOS 14 Dictation](/uploads/b44b7952d54e1267ffe4e65ec8a3a51e/iOS_14_Dictation.png)|![iOS 14 Dictation_Privacy](/uploads/8804156d9c07a7cbedfa038b5549114c/iOS_14_Dictation_Privacy.png)|
|![iOS 15 VoiceOver](/uploads/4a2b81e8c57a7ec7641f3d373f38b8b6/iOS_15_VoiceOver.PNG)|![iOS 15 VoiceOver Learn More](/uploads/804805652d20b87e38432adf0fcd8439/iOS_15_VoiceOver_Learn_More.PNG)|

## Demo

### iOS 15

<details><summary>1. All sections are empty, no additional help other than for discovery</summary>
![1. iOS 15 No Nothing](https://invent.kde.org/network/kdeconnect-ios/uploads/6e4c1f11be7e6da06e836b84c4bba6bb/1._iOS_15_No_Nothing.png)
</details>
<details><summary>2. Has no remembered device</summary>
![2. iOS 15 No Remembered](https://invent.kde.org/network/kdeconnect-ios/uploads/c030d82fab956e597a5ad962db00bbf4/2._iOS_15_No_Remembered.png)
</details>
<details><summary>3. Has no discovered and no remembered device</summary>
![3. iOS 15 No Discovered](https://invent.kde.org/network/kdeconnect-ios/uploads/8bfb7c99feb57093e17b6a0560d4814f/3._iOS_15_No_Discovered.png)
</details>
<details><summary>4. Has remembered device, provides additional help about reconnecting remembered devices</summary>
![4. iOS 15 Has Remembered](https://invent.kde.org/network/kdeconnect-ios/uploads/3608caf392316c756ddf4b18a5e7bb00/4._iOS_15_Has_Remembered.png)
</details>
<details><summary>5. Help for device discovery</summary>
![5. iOS 15 Device Discovery Help](https://invent.kde.org/network/kdeconnect-ios/uploads/cde480043ac2d16d36b151e4af993edf/5._iOS_15_Device_Discovery_Help.png)
</details>

#### iPad

<details><summary>Help for device discovery on iPad takes only readable width</summary>
![iOS 15 Device Discovery Help iPad](https://invent.kde.org/network/kdeconnect-ios/uploads/4c66131435348beddca5346d683409b3/IMG_0692.PNG)
</details>

## iOS 14 (difference only)

<details><summary>Footer is displayed as just another row</summary>
![4. iOS 14 Has Remembered](https://invent.kde.org/network/kdeconnect-ios/uploads/a639053f6ccc307f2c0b640312309960/4._iOS_14_Has_Remembered.png)
</details>
2022-02-27 12:46:22 +00:00
Apollo Zhu
82620e33ff [Fix] Small Correctness Changes
## Changelog

- Dangerous options are now in red on iOS 14
- Use `initWithData` instead of `stringWithUTF8String` for non-null terminated data to prevent memory access issues
- Reset navigation title to default behavior (use navigationTitle, removed the workaround to reduce top inset)
   - **Rationale**: the workaround forced all Settings details views to use inline title because the hard-coded value is not working for those screens

## Screenshots

|iOS 14|iOS 15|
|--|--|
|![iOS 14 dangerous options](/uploads/8692e596cf79069d4ba80b91620f931d/iOS_14_dangerous.png)|![iOS 15 dangerous options](/uploads/3ee280bf67b9b3d6e3be5c49cb6b7fb2/iOS_15_dangerous.png)|
2022-02-27 09:59:58 +00:00
Ruixuan Tu
46d270bff5 [Feature] Add about screen (T15154)
In this merge request, we have implemented the about screen to show useful links, authors, and third-party libraries as well as an abstract view to display any ```NSAttributedString``` for compatibility with iOS 14.

As we do not sort deserialized arrays in code, future maintainers of ```contributors.json``` and ```libs.json``` should keep the order by ```name``` for ```contributors.json``` and ```id``` (project name) for ```libs.json```.

There are two places that can be improved by future development:
1. for function ```func getContributorListAttributedText(template: String, for category: KeyPath<Contributors, [Contributor]>) -> NSAttributedString```, the complexity of the current implementation is $`O(n^2)`$, and it might be optimized to $`O(n)`$
2. for section ```Actions```, we have tried ```LazyHGrid```, but it is not flexible enough for enlarged text (accessibility) and landscape orientation, so future development should take a look on how to implement a list similar to the Android app

Screenshots:
![image](/uploads/d462ff4c1a3b215030b2bf877bfadb10/image.png)
![image](/uploads/b6169a2d16c323f54e5921bc434336c8/image.png)
2022-01-24 09:49:41 +00:00
Apollo Zhu
2cc75c13a7 [Refactor] Reduce code duplication for iOS 14 support
## Changelog

- Replaced `iOS14CompatibilityAlertView` with a more general `View+iOS14Compatibility.swift`
- Added modifiers mimicking SwiftUI 3 `alert` and `refreshable` to reduce code duplication
   - Unfortunately, we don't have access to `SwiftUI.Button`'s internal workings, so we have to introduce `_Button`
   - However, we can still use `Button` to construct either `SwiftUI.Button` or `_Button` depending on the arguments


## What happens when we drop iOS 14 support?

1. Delete `View+iOS14Compatibility.swift`
3. Done

## Testing

Manually tested on iOS 14.5 and iOS 15 simulators for all alerts.

## Known Issues

- Pull to refresh `refreshable` remains unimplemented for iOS 14
2022-01-21 06:09:10 +00:00
Apollo Zhu
b2b8673fc3 [Feature] Directly Share Photos and Videos
## Changelog

* Added SwiftUI-MediaPicker's pre-release 0.0.1 (up to next major) as a dependency
* Changed "Send files" to "Send Files" to be consistent with "Push Local Clipboard"
* Implemented sending images and videos from Photos Library

## Motivation

Currently, it's very inconvenient to send a photo saved in the Photos Library. Users expect to be able to directly select photos/videos from the Photos Library in-app without any additional steps (e.g. exporting to Files app and then selecting as a normal file). The Safari file selection dialog (which can be triggered using examples on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept) looks like:

![There are 3 options in the dropdown: Photo Library, Take Photo or Video, and Choose Files with their respective SF Symbol icons](/uploads/2acdf913beb98f92a0dbf20930be4b8a/IMG_0538.jpg)

## Approach

Integrate 3rd party dependency https://github.com/UWAppDev/SwiftUI-MediaPicker (which is under MIT License) through Swift Package Manager. ***Requires latest Xcode 13.2.1 release*** because it uses Swift Concurrency features and KDE Connect iOS supports iOS 14.

## Demo

![Share_Photos](https://invent.kde.org/network/kdeconnect-ios/uploads/4a752d97e32299f09260f4cbeeb9be0f/Share_Photos.mp4)
2022-01-03 07:00:27 +00:00
Apollo Zhu
82b05720f6 Refactor - Separate View from Model 2021-12-21 08:06:43 +00:00
Apollo Zhu
62da24200f Fix - Display Correct Device Icon 2021-12-18 08:06:04 +00:00