Commit Graph

35 Commits

Author SHA1 Message Date
Davide d8c4e87239
Refactor in-app entities for StoreKit/Kvitto integration (#820)
Refactoring:

- Get receipts from StoreKit Transaction.currentEntitlements
- Search for the originally purchased build in the local receipt anyway
(Kvitto)
- Fall back to release receipt (Kvitto), if any, for feature eligibility
in TestFlight builds
- Parse and verify expiration date in subscriptions
- Decouple in-app identifier composition from BundleConfiguration
- Fix user level features only applied when a receipt was not found

Testing:

- Add StoreKit configuration
- Fake purchases with PP_FAKE_IAP
- Fake user level with PP_USER_LEVEL

Then for reactive receipt reload, detect app activation differently:

- iOS/tvOS on .scenePhase
- macOS on launch and NSWorkspace.didActivateApplicationNotification

As to features:

- Credit former "Full version" purchasers with all current AND future
features, except the Apple TV
2024-11-06 13:20:12 +01:00
Davide 1cb46e066c
Encapsulate behavior on app active (#812)
Implement inside AppContext.
2024-11-05 10:41:02 +01:00
Davide 9f22053fa9
Fix lifecycle of environment objects (#790)
#779 was happening because environment objects were set on contentView,
which is not the _outmost_ root view. This clarifies why the Theme
object was not being found in ThemeLockScreenModifier.

Also, do not hardcode LogoView as lock view.
2024-10-31 11:14:39 +01:00
Davide 944d6f8c28
Refactor AppUI for TV target (#775)
Split AppUI into AppUI and AppUIMain to allow for a new, simplified
AppUITV target tailored for the Apple TV.

As a PoC, present a view with a list of the shared profiles.
2024-10-29 14:30:41 +01:00
Davide 41de48789e
Show in Mac status bar plus Login Item (#773)
Add a status menu via SwiftUI MenuBarExtra where to:

- Show/hide app
- Launch on login via "Login Item" target
- Toggle profiles on/off

Only weird that the login item is not added to the list of "Open at
Login", but to "Allow in the Background", see
https://github.com/pilotmoon/Scroll-Reverser/issues/165

Requires some refactoring to bring AppContext initialization to the
AppDelegate.

Fixes #617
Fixes #482 
Fixes #696 
Fixes #505
2024-10-29 11:40:11 +01:00
Davide 92cf1985e2
Fix iOS app not reacting to open URL (#770)
Resort to SwiftUI .onOpenURL(), seems to do fine for single URL on iOS
(not on macOS).
2024-10-28 23:38:01 +01:00
Davide f2a141a189
Purge stale NetworkExtension/keychain data (#728)
- [x] NE managers were not deleted when unable to be decoded to a
profile
- [x] Keychain items were not deleted on profile removal
- [x] Perform clean-up on app launch
- [x] Perform clean-up on app active

Prematurely merged as #727 then reverted, this is the complete PR.
2024-10-11 17:48:37 +02:00
Davide d589f1162d
Reorganize shared objects (#716)
Mainly:

- Aggregate shared/mock entities in less scattered files
- Review package dependencies

Also:

- Decouple ProfileRepository from Core Data Repository in UtilsLibrary
(filters done by ProfileManager)
2024-10-10 16:20:36 +02:00
Davide 5fb6f4f4d2
Refactor static functions/entities in Library (#679)
Reduce the impact of hidden dependencies on BundleConfiguration and
Constants.shared

Fixes #656
2024-10-04 09:58:42 +02:00
Davide 211b3b83d3
Erase iCloud store from Settings (#675)
Also, fix SwiftUI not refreshing when remote profiles are updated. There
was no objectWillChange nor Published around
ProfileManager.allRemoteProfiles, and ProfileRowView was not treating it
as ObservedObject.

Closes #673
2024-10-03 23:25:51 +02:00
Davide a29495a69c
Decouple Constants from BundleConfiguration (#635)
Fixes #619
2024-09-28 19:05:47 +02:00
Davide 28a2017da2
Confirm quit on macOS (#634)
To do so, must prevent window from closing.

Fixes #223
2024-09-28 17:58:48 +02:00
Davide 5deb8ec763
Prepare for macOS settings (#629) 2024-09-28 12:47:33 +02:00
Davide De Rosa c0234b07a8
Fix missing Window on iOS
Broken by 9e6e59276b
2024-09-28 11:56:35 +02:00
Davide 9e6e59276b
Associate and handle imported files (#628) 2024-09-28 11:43:57 +02:00
Davide fbc6ece59d
Reorganize library into AppUI (#621)
Closes #611
2024-09-26 23:13:55 +02:00
Davide 4124ff5cae
Lock app with FaceID (#609)
Restore feature as-is from v2.

Closes #606
2024-09-25 19:32:07 +02:00
Davide 6cc86e8668
Import v3 code (#597)
Closes #565
2024-09-23 15:02:26 +02:00
Davide De Rosa 64d1131fdd
Update copyright
Closes #473
2024-01-14 14:36:55 +01:00
Davide De Rosa 5c5697762b
Add minimal TV app
Closes #315
2023-12-31 01:21:38 +01:00
Davide De Rosa a38e3fed7a
Look up TestFlight flag asynchronously (#352)
Xcode has been quite obnoxious recently with this issue. Start the app
with the most restrictive type (.undefined), relax restrictions after
looking up sandbox and app receipt.
2023-09-10 00:52:39 +02:00
Davide De Rosa a7ea010d4e
Extend error handler to modals (#327) 2023-07-06 19:29:10 +02:00
Davide De Rosa bf70c7c59a
Reorganize app folders (#323) 2023-07-04 22:29:43 +02:00
Davide De Rosa 278efaf347
Refactor domain errors (#310) 2023-07-02 12:51:50 +02:00
Davide De Rosa b4ad8dea0d Do some code clean up
- Use guard in validators

- Rename URL.openURL() to URL.open()

- Sort imports (SwiftLint)

- Drop unused VPNProtocolType.allTypes

- Drop unused imports
2023-05-21 11:48:03 +02:00
Davide De Rosa 6af4bb7e0f
Resolve issues with lock screen (#273)
* Make lock screen a View extension

- Reuse in global theme (apply to all modals)

- Use a ZStack rather than replace (retain content/navigation)

- Share lock state across all LockableView
2023-03-25 16:47:08 +01:00
Davide De Rosa 5f991d9cc2
Unlock app with biometrics (#271)
* Prevent app lock completely in macOS

* Add missing Face ID metadata for biometrics auth

* Ensure MainActor

* Reword option

* Fix lock logic on launch
2023-03-20 14:12:42 +01:00
Davide De Rosa 325e10845d
Option to lock app when entering background (#270) 2023-03-20 11:00:01 +01:00
Davide De Rosa 37354d1b87 Update copyright 2023-03-17 16:56:19 +01:00
Davide De Rosa 2c5f3d0bf0 Send app to background in OrganizerView handler
Keep handler in a single place.
2022-07-17 14:47:15 +02:00
Davide De Rosa 3f4b55a003 Implement Mac bundle with system menu
Use bundle as a means to provide Mac APIs to Catalyst app.

In order to cross the @objc wall set by the Mac Bundle mechanism,
Swift structures cannot be used directly and must be bridged
through ObjC facades.

Create NSMenu in MVVM style and install it on app launch. Make
sure to do it in AppDelegate.applicationDidFinishLaunching(),
because doing it as early as in PassepartoutApp.init() would
crash Mac code.

Use .representedObject to own view models.

With menu in place, app can be sent to background when main window
is closed. Requires multiple documents support for app not to die
instantly.
2022-07-16 17:39:42 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00
Davide De Rosa 10b4c321c8 Separate context responsibilities
- Split Core and App context

- Move .shared instantiation to extension

Context may differ by target.
2022-06-16 13:42:53 +02:00
Davide De Rosa 0047d095fb Adjust navigation style to all devices
- Mac
    - Drop all styles
    - Tweak hide title bar
    - Hide navigation bar

- Restore single section for all profiles
    - Allows using NavigationLink safely
    - Indirectly fixes multitasking
    - Retains selection on profile activation
    - Clean up presentActiveProfile

- Leave active profile in its position
    - Fixes Mac flashing row selection on profile activation

- Unify profile row appearance
    - Use fixed .headline font
    - Add subtitles to inactive profiles
    - Use padding rather than fixed row height

CAVEATS:

- Do not preselect active profile on iPad launch, as doing so
seems to present two ProfileView on top of each other, one from
MainView and one from the NavigationLink.

- Do not touch .listStyle() of master view, as it seems to break
navigation esp. in iPad multitasking.
2022-04-29 19:29:47 +02:00
Davide De Rosa bf65f76401 Merge project into iOS + macOS
Share views with both platforms initially. Will split specific
views step by step.
2022-04-19 16:14:23 +02:00