Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions ios/InternxtFileProvider/FileProviderEnumerator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// FileProviderEnumerator.swift
// InternxtFileProvider
//
// Created by Ramon Candel on 9/4/26.
//

import FileProvider

class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {

private let enumeratedItemIdentifier: NSFileProviderItemIdentifier
private let anchor = NSFileProviderSyncAnchor("an anchor".data(using: .utf8)!)

init(enumeratedItemIdentifier: NSFileProviderItemIdentifier) {
self.enumeratedItemIdentifier = enumeratedItemIdentifier
super.init()
}

func invalidate() {
// TODO: perform invalidation of server connection if necessary

Check warning on line 21 in ios/InternxtFileProvider/FileProviderEnumerator.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeCRDIaptS4_XU2F&open=AZ6lYeCRDIaptS4_XU2F&pullRequest=484
}

func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {

Check warning on line 24 in ios/InternxtFileProvider/FileProviderEnumerator.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "page" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeCRDIaptS4_XU2G&open=AZ6lYeCRDIaptS4_XU2G&pullRequest=484
/* TODO:
- inspect the page to determine whether this is an initial or a follow-up request

If this is an enumerator for a directory, the root container or all directories:
- perform a server request to fetch directory contents
If this is an enumerator for the active set:
- perform a server request to update your local database
- fetch the active set from your local database

- inform the observer about the items returned by the server (possibly multiple times)
- inform the observer that you are finished with this page
*/
observer.didEnumerate([FileProviderItem(identifier: NSFileProviderItemIdentifier("a file"))])
observer.finishEnumerating(upTo: nil)
}

func enumerateChanges(for observer: NSFileProviderChangeObserver, from anchor: NSFileProviderSyncAnchor) {
/* TODO:
- query the server for updates since the passed-in sync anchor

If this is an enumerator for the active set:
- note the changes in your local database

- inform the observer about item deletions and updates (modifications + insertions)
- inform the observer when you have finished enumerating up to a subsequent sync anchor
*/
observer.finishEnumeratingChanges(upTo: anchor, moreComing: false)
}

func currentSyncAnchor(completionHandler: @escaping (NSFileProviderSyncAnchor?) -> Void) {
completionHandler(anchor)
}
}
61 changes: 61 additions & 0 deletions ios/InternxtFileProvider/FileProviderExtension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// FileProviderExtension.swift
// InternxtFileProvider
//
// Created by Ramon Candel on 9/4/26.
//

import FileProvider
import InternxtSwiftCore

class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension {
required init(domain: NSFileProviderDomain) {

Check warning on line 12 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "domain" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBHDIaptS4_XU1o&open=AZ6lYeBHDIaptS4_XU1o&pullRequest=484
// TODO: The containing application must create a domain using `NSFileProviderManager.add(_:, completionHandler:)`. The system will then launch the application extension process, call `FileProviderExtension.init(domain:)` to instantiate the extension for that domain, and call methods on the instance.

Check warning on line 13 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBHDIaptS4_XU1p&open=AZ6lYeBHDIaptS4_XU1p&pullRequest=484
super.init()
}

func invalidate() {
// TODO: cleanup any resources

Check warning on line 18 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBHDIaptS4_XU1q&open=AZ6lYeBHDIaptS4_XU1q&pullRequest=484
}

func item(for identifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) -> Progress {

Check warning on line 21 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "request" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBHDIaptS4_XU1r&open=AZ6lYeBHDIaptS4_XU1r&pullRequest=484
// resolve the given identifier to a record in the model

// TODO: implement the actual lookup

Check warning on line 24 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBHDIaptS4_XU1s&open=AZ6lYeBHDIaptS4_XU1s&pullRequest=484

completionHandler(FileProviderItem(identifier: identifier), nil)
return Progress()
}

func fetchContents(for itemIdentifier: NSFileProviderItemIdentifier, version requestedVersion: NSFileProviderItemVersion?, request: NSFileProviderRequest, completionHandler: @escaping (URL?, NSFileProviderItem?, Error?) -> Void) -> Progress {

Check warning on line 30 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "request" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1v&open=AZ6lYeBIDIaptS4_XU1v&pullRequest=484

Check warning on line 30 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "itemIdentifier" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1t&open=AZ6lYeBIDIaptS4_XU1t&pullRequest=484

Check warning on line 30 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "requestedVersion" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1u&open=AZ6lYeBIDIaptS4_XU1u&pullRequest=484
// TODO: implement fetching of the contents for the itemIdentifier at the specified version

Check warning on line 31 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1w&open=AZ6lYeBIDIaptS4_XU1w&pullRequest=484

completionHandler(nil, nil, NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
return Progress()
}

func createItem(basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents url: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress {

Check warning on line 37 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "url" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1y&open=AZ6lYeBIDIaptS4_XU1y&pullRequest=484

Check warning on line 37 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "request" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU10&open=AZ6lYeBIDIaptS4_XU10&pullRequest=484

Check warning on line 37 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "fields" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1x&open=AZ6lYeBIDIaptS4_XU1x&pullRequest=484

Check warning on line 37 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "options" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1z&open=AZ6lYeBIDIaptS4_XU1z&pullRequest=484
// TODO: a new item was created on disk, process the item's creation

Check warning on line 38 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU11&open=AZ6lYeBIDIaptS4_XU11&pullRequest=484

completionHandler(itemTemplate, [], false, nil)
return Progress()
}

func modifyItem(_ item: NSFileProviderItem, baseVersion version: NSFileProviderItemVersion, changedFields: NSFileProviderItemFields, contents newContents: URL?, options: NSFileProviderModifyItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress {

Check warning on line 44 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "request" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU17&open=AZ6lYeBIDIaptS4_XU17&pullRequest=484

Check warning on line 44 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "changedFields" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU14&open=AZ6lYeBIDIaptS4_XU14&pullRequest=484

Check warning on line 44 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "item" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU12&open=AZ6lYeBIDIaptS4_XU12&pullRequest=484

Check warning on line 44 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "version" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU13&open=AZ6lYeBIDIaptS4_XU13&pullRequest=484

Check warning on line 44 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "options" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU16&open=AZ6lYeBIDIaptS4_XU16&pullRequest=484

Check warning on line 44 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "newContents" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU15&open=AZ6lYeBIDIaptS4_XU15&pullRequest=484
// TODO: an item was modified on disk, process the item's modification

Check warning on line 45 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU18&open=AZ6lYeBIDIaptS4_XU18&pullRequest=484

completionHandler(nil, [], false, NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
return Progress()
}

func deleteItem(identifier: NSFileProviderItemIdentifier, baseVersion version: NSFileProviderItemVersion, options: NSFileProviderDeleteItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (Error?) -> Void) -> Progress {

Check warning on line 51 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "options" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1_&open=AZ6lYeBIDIaptS4_XU1_&pullRequest=484

Check warning on line 51 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "request" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU2A&open=AZ6lYeBIDIaptS4_XU2A&pullRequest=484

Check warning on line 51 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "version" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU1-&open=AZ6lYeBIDIaptS4_XU1-&pullRequest=484

Check warning on line 51 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "identifier" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU19&open=AZ6lYeBIDIaptS4_XU19&pullRequest=484
// TODO: an item was deleted on disk, process the item's deletion

Check warning on line 52 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU2B&open=AZ6lYeBIDIaptS4_XU2B&pullRequest=484

completionHandler(NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
return Progress()
}

func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest) throws -> NSFileProviderEnumerator {

Check warning on line 58 in ios/InternxtFileProvider/FileProviderExtension.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused function parameter "request" or name it "_".

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeBIDIaptS4_XU2C&open=AZ6lYeBIDIaptS4_XU2C&pullRequest=484
return FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier)
}
}
45 changes: 45 additions & 0 deletions ios/InternxtFileProvider/FileProviderItem.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// FileProviderItem.swift
// InternxtFileProvider
//
// Created by Ramon Candel on 9/4/26.
//

import FileProvider
import UniformTypeIdentifiers

class FileProviderItem: NSObject, NSFileProviderItem {

// TODO: implement an initializer to create an item from your extension's backing model

Check warning on line 13 in ios/InternxtFileProvider/FileProviderItem.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeCGDIaptS4_XU2D&open=AZ6lYeCGDIaptS4_XU2D&pullRequest=484
// TODO: implement the accessors to return the values from your extension's backing model

Check warning on line 14 in ios/InternxtFileProvider/FileProviderItem.swift

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=internxt_drive-mobile&issues=AZ6lYeCGDIaptS4_XU2E&open=AZ6lYeCGDIaptS4_XU2E&pullRequest=484

private let identifier: NSFileProviderItemIdentifier

init(identifier: NSFileProviderItemIdentifier) {
self.identifier = identifier
}

var itemIdentifier: NSFileProviderItemIdentifier {
return identifier
}

var parentItemIdentifier: NSFileProviderItemIdentifier {
return .rootContainer
}

var capabilities: NSFileProviderItemCapabilities {
return [.allowsReading, .allowsWriting, .allowsRenaming, .allowsReparenting, .allowsTrashing, .allowsDeleting]
}

var itemVersion: NSFileProviderItemVersion {
NSFileProviderItemVersion(contentVersion: "a content version".data(using: .utf8)!, metadataVersion: "a metadata version".data(using: .utf8)!)
}

var filename: String {
return identifier.rawValue
}

var contentType: UTType {
return identifier == NSFileProviderItemIdentifier.rootContainer ? .folder : .plainText
}
}
19 changes: 19 additions & 0 deletions ios/InternxtFileProvider/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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>NSExtension</key>
<dict>
<key>NSExtensionFileProviderDocumentGroup</key>
<string>group.com.internxt.snacks</string>
<key>NSExtensionFileProviderSupportsEnumeration</key>
<true/>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.fileprovider-nonui</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).FileProviderExtension</string>
</dict>
<key>RCTNewArchEnabled</key>
<true/>
</dict>
</plist>
15 changes: 15 additions & 0 deletions ios/InternxtFileProvider/InternxtFileProvider.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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>com.apple.security.application-groups</key>
<array>
<string>group.com.internxt.snacks</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)group.com.internxt.snacks</string>
</array>

</dict>
</plist>
12 changes: 12 additions & 0 deletions ios/InternxtFileProvider/InternxtFileProvider.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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">
<!--
InternxtFileProvider.plist
Internxt

Created by Ramon Candel on 9/4/26.
Copyright (c) 2026 ___ORGANIZATIONNAME___. All rights reserved.
-->
<plist version="1.0">
<dict/>
</plist>
Loading