Giter Site home page Giter Site logo

filestack / filestack-ios Goto Github PK

View Code? Open in Web Editor NEW
53.0 18.0 35.0 13.43 MB

Official iOS SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.

Home Page: https://www.filestack.com

License: MIT License

Objective-C 0.17% Ruby 0.28% Swift 96.80% Shell 2.75%
filestack filestack-ios-sdk xcode carthage picker cloud-providers files upload uploader

filestack-ios's People

Contributors

andrasmendik avatar pappapproved avatar rnine avatar sventiigi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filestack-ios's Issues

Unable to install via Pods

Podfile - the below configuration works with '~> 1.5'

platform :ios, '11.0'

abstract_target 'MobileAbstract' do
# target 'Mobile' do

  pod ...
  pod ...
  pod ...
  pod ...

   source 'https://github.com/CocoaPods/Specs.git'
   use_frameworks!


    target 'Mobile' do
        pod 'Filestack', '~> 2.0'
    end

    target 'Mobile-Dev_Staging' do
        pod 'Filestack', '~> 2.0'
    ends

end

Error:

[!] CocoaPods could not find compatible versions for pod "Filestack":
  In Podfile:
    Filestack (~> 2.0)

None of your spec sources contain a spec satisfying the dependency: `Filestack (~> 2.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

Parameters are invalid for client.upload

I'm trying following code


  @objc(upload:callback:)
  func upload(file: String, callback: @escaping RCTResponseSenderBlock) {
    let localURL = URL(string: file)!
    
    client?.upload(from: localURL, uploadProgress: { (progress) in
      // Here you may update the UI to reflect the upload progress.
      print("progress = \(String(describing: progress))")
    }) { (response) in
      // Try to obtain Filestack handle
      if let json = response?.json, let handle = json["handle"] as? String {
        // Use Filestack handle
        print(json)
        callback([json]);
      } else if let error = response?.error {
        // Handle error
        print(error)
        callback([error]);
      }
      print(response)
    }
  }

I'm getting progress data so I supose image is uploading. But getting error - aborted

here is print of response in the MultipartUpload.swift

(request: Optional(https://upload.filestackapi.com/multipart/complete),response: Optional(<NSHTTPURLResponse: 0x6000032664e0> { URL: https://upload.filestackapi.com/multipart/complete } { Status Code: 400, Headers {
    "Access-Control-Allow-Headers" =     (
        "Origin,Content-Type,Accept,User-Agent,UJID,UJID-Path,Filestack-Upload-Region,Filestack-Source"
    );
    "Access-Control-Allow-Methods" =     (
        "HEAD,OPTIONS,POST,PUT"
    );
    "Access-Control-Allow-Origin" =     (
        "*"
    );
    Allow =     (
        "HEAD, OPTIONS, POST, PUT"
    );
    Connection =     (
        "keep-alive"
    );
    "Content-Length" =     (
        128
    );
    "Content-Type" =     (
        "text/plain; charset=utf-8"
    );
    Date =     (
        "Thu, 13 Dec 2018 17:11:35 GMT"
    );
    Server =     (
        nginx
    );
    "X-Filestack-Apikey" =     (
        xxxxxxxxxxxxx
    );
} }), json: Optional(["i": , "c": {
    ujid = "c916857b-0a22-4305-9324-6f1055b610f2";
    "ujid_path" = "ul-0";
}, "error": Parameters are invalid, "t": 1544721095]), error: nil)

Am I doing anything wrong?

Does not build with XCode 10.2.1 Swift 5

error: expression
resolves to an unused property
get { callbackURLScheme }
^~~~~~~~~~~~~~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Internal/PhotoEditor/SelectionList/SelectionListView
Controller.swift:99:48: error: type 'UIColor?' has no member 'systemBackground'
collectionView?.backgroundColor = .systemBackground
^~~~~~~~~~~~~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:14:52: error: type
'UIColor' has no member 'systemBlue'
fileprivate(set) var tintColor: UIColor = .systemBlue
^~~~~~~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:18:25: error: type
'UIColor' has no member 'label'
return .label
^~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:28:25: error: type
'UIColor' has no member 'systemBackground'
return .systemBackground
^~~~~~~~~~~~~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:36:25: error: type
'UIColor' has no member 'label'
return .label
^~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:46:25: error: type
'UIColor' has no member 'secondarySystemBackground'
return .secondarySystemBackground
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:54:25: error: type
'UIColor' has no member 'separator'
return .separator
^~~~~~~~~
/Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:62:25: error: type
'UIColor' has no member 'systemBackground'
return .systemBackground
^~~~~~~~~~~~~~~~
Could not build the application for the simulator.
Error launching application on iPhone Xʀ.

Does not build with XCode 10.2.1 Swift 5

Screen Shot 2019-10-29 at 12 16 51 PM

error: expression resolves to an unused property get { callbackURLScheme } ^~~~~~~~~~~~~~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Internal/PhotoEditor/SelectionList/SelectionListView Controller.swift:99:48: error: type 'UIColor?' has no member 'systemBackground' collectionView?.backgroundColor = .systemBackground ^~~~~~~~~~~~~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:14:52: error: type 'UIColor' has no member 'systemBlue' fileprivate(set) var tintColor: UIColor = .systemBlue ^~~~~~~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:18:25: error: type 'UIColor' has no member 'label' return .label ^~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:28:25: error: type 'UIColor' has no member 'systemBackground' return .systemBackground ^~~~~~~~~~~~~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:36:25: error: type 'UIColor' has no member 'label' return .label ^~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:46:25: error: type 'UIColor' has no member 'secondarySystemBackground' return .secondarySystemBackground ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:54:25: error: type 'UIColor' has no member 'separator' return .separator ^~~~~~~~~ /Users/mherkarapetyan/Desktop/flutter/filestack_flutter/example/ios/Pods/Filestack/Filestack/UI/Public/Models/Stylizer.swift:62:25: error: type 'UIColor' has no member 'systemBackground' return .systemBackground ^~~~~~~~~~~~~~~~ Could not build the application for the simulator. Error launching application on iPhone Xʀ.

iOS SDK Parallel Upload Issue

Hey everyone, we have an issue uploading multiple files in parallel.

Our approach is the following:

  1. A user selects or takes an image.
  2. Those images ares stored in the file system temporary so we receive a file URL.
    Note: When checking this URL we verified that each URL points to the correct image.
  3. The Filestack SDK provided upload method is called for those Uploadable images
    Note: We verified that each Uploadable URL porints to the correct image.
  4. We receive a success response from the Filestack SDK. When inspecting the response we receive filestackHandles (In our example two filestackHandles).

Bug: Each filestackHandles point to the same picture! However the size differs i.e. there must be an issue either in the Filestack SDK or on the API. This problem also occurs in earlier versions of the SDK.

Does not build with XCode 10.2 Swift 5

XCode 10.2 dropped support for SWIFT_VERSION '3.0'.
filestack-ios depends on Alamofire 4.7.3 as well as OHHTTPStubs 6.1 which uses that swift version.

Please update the dependencies to more current versions that are supported by 10.2

the same is probably true for filestack-swift

Swift 3 secured upload not working

Hello,
I am using the filestack-ios in Swift3 application. However, when I make a push to a secured store, with policy and signature, that are correct, I get problem:

Optional(Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x618000448940 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x608000480000 [0x1073ffdf0]>{length = 16, capacity = 16, bytes = 0x100201bb22c007530000000000000000}, _kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}},

The thing is that even if I use the URL generated by this SDK it doesn't even work in postman, saying signature is a problem. Seems for me that there is a problem with file sending - if I use it with JS, it is totally fine. But same URL generated by iOS SDK doesnt work.

LocalSources inaccessible because they are internal

small issue, your example code seems not to work:

        let config = Filestack.Config.builder
            .with(appUrlScheme: "your-scheme")
            .with(videoQuality: .typeHigh)
            .with(imageUrlExportPreset: .current)
            .with(maximumSelectionLimit: 10)
            .withEditorEnabled()
            .with(availableCloudSources: [.dropbox, .googleDrive, .googlePhotos, .customSource])
            .with(availableLocalSources: [.camera])
            .build()

'camera' is inaccessible due to 'internal' protection level

this is also the case in the DemoApp when trying to not use LocalSources.All()

AVFileTypeHEIC' has been renamed to 'AVFileType.heic'

Attempting to update from 0.3.9 to 1.1 I get various compilation errors.

AVFileTypeHEIC' has been renamed to 'AVFileType.heic'

and

FilestackSDK.MultipartUpload:7:17: Non-'@objc' method 'cancel()' does not satisfy requirement of '@objc' protocol 'CancellableRequest'

Installation problem

When installing via CocoaPods I get this :

"[!] Unable to satisfy the following requirements:

  • Filestack (~> 0.3.2) required by Podfile
  • Filestack (~> 0.3.2) required by Podfile
  • Filestack (~> 0.3.2) required by Podfile
  • Filestack (~> 0.3.2) required by Podfile

Specs satisfying the Filestack (~> 0.3.2) dependency were found, but they required a higher minimum deployment target."

I just pasted " pod "Filestack", "~> 0.3.2" " into my pod file and ran pod install as per your guide. My target app is is 9.3 if that helps.

Any fix? Apologies if this a problem unique to me and thanks in advance!

Julien

Upload multiple files from Picker

At the moment it does not seem to be possible to allow a user to select and upload multiple files at the same time when using client.picker()

is this correct? Users are asking for the return of this feature after we switched over from FSPicker which did not allow to set compatibility (apple heic format). And we were told that it would not actively get maintained.

thanks

Minimum Deployment Target Conflict

After updating Xcode to Version 12.5 (12E262), I see a build error.

~/Filestack/Sources/Filestack/UI/Internal/Controllers/DocumentPickerUploadController.swift:11:8: 
Compiling for iOS 11.0, but module 'ZIPFoundation' has a minimum deployment target of iOS 12.0: 
~/Library/Developer/Xcode/DerivedData/FleetioGo-fxjdwlvgtzeweqftrnwfwuqjhdpi/Build/Products/Debug-iphonesimulator/ZIPFoundation/ZIPFoundation.framework/Modules/ZIPFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

It looks like in release 2.7.1 The target is still building for 11.0.
Screen Shot 2021-04-27 at 2 10 58 PM

Status Update?

Hi, I just wanted to check on the status of this project. We've successfully been using the Filestack pod to upload files (without picker) for the past month. Now, we're looking to integrate the picker for another part of the app. Is the 'FSPicker-release' branch ready for testing? Right now we have conflicts trying to run both Filestack and Filepicker at the same time and it'd be nice to switch over to Filestack entirely, but we're not sure on the status.

Having issues with v1.3 on XCode 9.3.1 (Swift 4.1/3.3)

Hello there,

After updating my pod version from 0.3.9 to 1.3 I'm unable to build my project. I get the following errors in Client.swift:
image

I'm assuming is because XCode 9.3.1 uses swift 3.3 but you are supporting 3.2? I tried building using 3.3 and 4.1 but no luck.

Any ideas if this is the reason or something else?

Thank you!

Swift 3 policy

Hello,
why the policy in FSSecurity is String type? When I am generating signature and converting Data feed to UTF8 String, usually it results in nil. ASCII on the other hand is not working. Or am I doing something wrong? Here is my code:
`
var timeInterval: Int = Int(Date().timeIntervalSince1970)
timeInterval += 7 * 24 * 60 * 60

    let policy = "{ \"expiry\" : " + String(timeInterval) + ", \"call\" : [\"pick\", \"store\"]}"
    print(policy)
    let base64encoded = policy.data(using: .utf8)?.base64EncodedData()
    let base64encodedString = policy.data(using: .utf8)?.base64EncodedString()
    let dataArray = [UInt8](base64encoded!)
    let signed = try! HMAC(key: self.filestackApiKey, variant: .sha256).authenticate(dataArray)
    let signedData = Data(signed)
    let signedString = String.init(data: signedData, encoding: .ascii)`

Swift SDK appears to generate incorrect URL for transforms

pod 'FilestackSDK', '2.3.1'

I'm trying to use your SDK to resize an image I previously successfully uploaded to S3 (via the upload call) and from which I got a handle.

func transform(path: String, filename: String, handle: String, completion: @escaping (String, String) -> Void) {
        
        let transformable = filestackClient.transformable(handle: handle)
        transformable.add(transform: ResizeTransform().width(150).height(200))
        let storeOptions = StorageOptions(location: .s3, path: "a", filename: "b", mimeType: "image/jpeg", access: .private)
        
        transformable.store(using: storeOptions, base64Decode: false) { (handle, response) in
            
        if let json = response.json,
            let key = json["key"] as? String,
            let url = json["url"] as? String {
            completion(key, url)
        } else {
            completion("", "")
        }
            
        }
        
        
    }

This generates a URL like

https://www.filestackapi.com/api/store=location:S3,path:a,filename:b,access:private,base64decode:false/security=policy:[policy],signature:[sig]

which returns HTTP 404 as the result of the POST call. I know my client is configured correctly (policy/sig) since the upload call works.

It appears that something like https://www.filestackapi.com/api/store/S3?xyz would be valid.

Am I doing something wrong?

Problem with 2.5.1 version

Hi,

After building my project and running it on a device I get the following exception:

Thread 1: "Could not find a storyboard named 'Picker' in bundle NSBundle Frameworks/Filestack.framework> (loaded)"

This happens when I try to pick a photo.

I'm using cocoapods.

I noticed that the files UI/Storyboards/PhotoPicker.storyboard and UI/Storyboards/Picker.storyboard are missing from the Pod installation folder:

/Pods/Filestack/Filestack

The last working version that I used was 2.3.2

Missing FSSecurity option for Filestack.remove()

Currently Filestack remove:completionHandler: seems to be missing the support for passing in a FSSecurity. The other 2 methods pickURL:completionHandler: anddownload:completionHandler: seems to be having the same issue.

Am I missing something on how to use these 3 methods with security enabled?

Upload Data

Before I could simply upload Data with FileStack. This simplified the flow when using drag and drop of an image on iPad.

let keyToUse = "\(ProcessInfo.processInfo.globallyUniqueString)\(fileExtension)"
let fileStack = Filestack(apiKey: Constants.fileStackApiKey)
let storeOptions = FSStoreOptions()
storeOptions.fileName = keyToUse
fileStack?.store(dataToSend, with: storeOptions, progress: { (progress) in

This seem to have been replaced now? Is there a way to just upload Data with the new 1.1 SDK?

Crash when upload is cancelled

steps to reproduce:

  1. go to Photo Library : Camera Roll
  2. select picture and hit Done
  3. observe the Camera Roll being dismissed
  4. hit Cancel before Upload Progress appears
  5. observe crash

the problem seems to be that the user can hit Cancel after he initiated an upload because there is a delay between the dismissal of the selection screen and the display of the progress screen.

we see this crash reported in the wild:

2018-10-11_09-40-00.0244_-0400-a5be1edc04a813cfcc0c17670888c41f1fe81b8.txt

Cocoapods version missing Storyboard

I tried using the Filestack SDK via Cocoapods.

When I try to show a picker using the demo app, it crashes saying the Storyboard "Picker" cannot be found. If I look through the 'Pods' directory the Storyboard isn't there.

If I download the full source from GitHub, then copy the Storyboard, add it to the Pod folder in Xcode, then add a Build Phase to the Pods project to copy the Storyboard to the bundle, it starts working correctly.

Therefore, I think your Pod setup is incorrectly configured.

The podspec needs something along the following:

s.resource_bundle = { 'Filestack' => [ 'FilestackBundle/**/*.{png,storyboard,lproj}' ] }

client.picker completion handler

If you use the complete PickerNavigationController solution via client.picker(::), there is currently no way to monitor the upload and get any kind of result. This makes it basically unusable, as the user will upload files, but you won't know which ones they are and so will be unable to do anything with them.

The other options allow you to specify a completion handler, but then you have to implement the UI for all the different data sources yourself, which as seen in the library is quite a lot of code and many different ViewControllers.

Camera option leads to PhotoPicker

since we re-enabled multi file upload via:
config.maximumSelectionAllowed = Config.kMaximumSelectionNoLimit

we had reports from users stating that they could not use the camera as a local source anymore.

you can reproduce this by adding the line config.maximumSelectionAllowed = 2 to the DemoApp and try to take a Photo with the Camera

Skimming thru the code i have this question:
does it mean that by using either a maximumSelection higher than 1 or using showEditorBeforeUpload = true we prevent the user from using the Camera as source?

CocoaPods v1.5.2 build is incorrectly using Swift 4.2?

When using CocoaPods to install v1.5.1 of the Filestack pod I can build using Swift v4, but when using CocoaPods to install v1.5.2 of the Filestack pod, I am forced to use Swift v4.2? Surely this is a mistake as I don't see the Swift v4.2 updates in master?

pickerStoredFile is being called before uploadMonitorViewController.dismiss

Because uploadMonitorViewController.dismiss() is being called in a DispatchQueue.main.asyncAfter(deadline: .now() + 0.25), the picker.pickerDelegate?.pickerStoredFile is being called too early. This means when my pickerStoredFile callback is trying to picker.dismiss() on a successful response, it is failing as the uploadMonitorViewController is still trying to be dismissed.

I figure the pickerDelegate?.pickerStoredFile should be called only when the uploadMonitorViewController is fully dismissed after 0.25s?

// Set progress to 100%
uploadMonitorViewController.updateProgress(value: 1.0)
// After 0.25 seconds, dismiss monitor view controller, and remove strong reference to it.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
uploadMonitorViewController.dismiss(animated: true) {
self.uploadMonitorViewController = nil
}
}
}
if let picker = self.navigationController as? PickerNavigationController {
picker.pickerDelegate?.pickerStoredFile(picker: picker, response: response)
}

Cannot build 0.5-pre1 with Carthage

Trying to build 0.5-pre1 using Carthage update fails on the Arcane-Mac submodule.
I'm trying to build for iOS using Xcode 9.0.1 on MacOS 10.13.
It looks like it's Xcode related since the log refers to a problem with the Swift version:-

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
warning: no umbrella header found for target 'Arcane-Mac', module map will not be generated

** BUILD FAILED **```

iOS display image

iOS Documentation needs update or explanation.
I want to display image but get error.

Code official doc says:

  1. import FilestackSDK
  2. let filelink = transformable(handle: "g8fLXNCRT4K3TJSUFrRW")

Github gives nothing on this, only about displaying picker/upload
https://filestack.github.io/filestack-ios/

commit `1a2cc0f2ea0fe93d30e39c7a82600cd3c3bd9a2f` compile error

The following change in AlbumListViewController.swift breaks compilation in latest swift:

78 - let indicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
78 + let indicator = UIActivityIndicatorView(style: .gray)

Error: /Users/tovi/Wear/repos/TMS-iOS/Pods/Filestack/Filestack/UI/PhotoPicker/AlbumList/AlbumListViewController.swift:78:23: 'init(style:)' has been renamed to 'init(activityIndicatorStyle:)'

conv20 provider error: Failed to identify the file, probably corrupted image provided (idx 0)

I Am Working with FileStack for couple of days.

Its working fine (Upload and download) prior iOS version 11(Simulator and Real Device).

But when i try it in iOS 12+(Both Simulator and Real Device) version image file is uploading successfully but while downloading image am getting(Blank Image).

When i paste the Image URL in the browser am getting this error.
conv20 provider error: Failed to identify the file, probably corrupted image provided (idx 0)

After Success upload i get this response :

["status": Stored, "size": 61506, "handle": phNwIORJG1YMSWptXXWA, "mimetype": image/heic, "url": https://cdn.filestackcontent.com/phNwIORJG1YMSWptXXWA, "filename": 023BAD24-A993-4336-BC4E-9540B292CED4.heic]

My XCode version : 11.6.
Testing iOS version : 13.6(Real Device).
FileStack Version 2.3.2.

Please help me to solve this.

modal presentation style

Hei Team

both uploadFrom... methods present a modal picker with the flag .currentContext
this made me run into a problem where after the dismissal of the picker my layout was totally corrupted because the presentingViews width would get constraint to 0 and break.

the only way i found to resolve the issue was by forking and changing the pickers presentation to .overFullScreen.

now that i can use versions 1.3 fabulous picker (thanks again) this is not a problem for me anymore. but maybe in the future you want to give the implementor the capability to choose how he wants the picker to be presented?

for reference:
auto-layout-invalid-after-presenting-view-controller-and-many-situation
view-unusable-after-dismissviewcontrolleranimatedcompletion

uploadFromDocumentPicker(viewController: UIViewController,
            storeOptions: StorageOptions = StorageOptions(location: .s3),
            useIntelligentIngestionIfAvailable: Bool = true,
            queue: DispatchQueue = .main,
            uploadProgress: ((Progress) -> Void)? = nil,
            completionHandler: @escaping (NetworkJSONResponse?) -> Void) -> CancellableRequest

public func uploadFromImagePicker(viewController: UIViewController,
            sourceType: UIImagePickerControllerSourceType,
            storeOptions: StorageOptions = StorageOptions(location: .s3),
            useIntelligentIngestionIfAvailable: Bool = true,
            queue: DispatchQueue = .main,
            uploadProgress: ((Progress) -> Void)? = nil,
            completionHandler: @escaping (NetworkJSONResponse?) -> Void) -> CancellableRequest

Unable to support the Alamofire 5.0

pod 'Filestack' has dependency with Alamofire 4.x.x version. However, I have a Alamofire 5.0 which works fine for other pods (with dependency on alamofire). How to resolve this issue ?

Upload works, but PickerNavigationControllerDelegate handlers doesn't work.

picker.pickerDelegate = self in ViewController

extension ViewController: PickerNavigationControllerDelegate {
    func pickerUploadedFiles(picker _: PickerNavigationController, responses _: [NetworkJSONResponse]) {
        print("Picker Uploaded Files")
    }
    func pickerStoredFile(picker _: PickerNavigationController, response: StoreResponse) {
            print("Stored file response:")
    }
    func pickerReportedUploadProgress(picker: PickerNavigationController, progress: Float) {
        print("Picker \(picker) reported upload progress: \(progress)")
    }
}

Image editor is not showing up

Hello, I need some help with the Image Editor, is not showing app, I do have the option on my Config object.

let config = Filestack.Config.builder .with(callbackURLScheme: "***") .with(imageURLExportPreset: .compatible) .with(maximumSelectionLimit: 20) .withEditorEnabled() .with(photosPickerFilter: [.images]) .with(imageExportQuality: 0.8) .with(availableLocalSources: [.camera, .photoLibrary]) .build()

I'm using FilestackSDK 2.8.0.

Thank you!

Localize picker text

Hi all, how can I localize to my native language picker titles and other labels .... ?

Undefined Symbols when importing with SwiftPM

Xcode 2.5 (12E262)
Swift 5.4
SwiftPM - Xcode's Bundled version
Project Minimum iOS Version: 13

filestack-ios: 2.7.2

When importing the library using Xcode's UI for adding Swift Packages to our iOS Target, we add the following code:

import Filestack
import FilestackSDK

extension ViewController {
  private func doSomething() {
    let client = Client(apiKey: "")
    print(client)
  }
}

when we build, Xcode gives us the following errors:

Undefined symbols for architecture arm64:
  "type metadata accessor for FilestackSDK.Client", referenced from:
      Peek_Pro.PKViewOrderViewController.(doSomething in _0192BE462E8B9F880CB09CA425A161D1)() -> () in PKViewOrderViewController.o
  "FilestackSDK.Client.__allocating_init(apiKey: Swift.String, security: FilestackSDK.Security?) -> FilestackSDK.Client", referenced from:
      Peek_Pro.PKViewOrderViewController.(doSomething in _0192BE462E8B9F880CB09CA425A161D1)() -> () in PKViewOrderViewController.o
ld: symbol(s) not found for architecture arm64

Undefined symbol: type metadata accessor for FilestackSDK.Client
Undefined symbol: FilestackSDK.Client.__allocating_init(apiKey: Swift.String, security: FilestackSDK.Security?) -> FilestackSDK.Client

I've narrowed it down to only receiving build errors when importing FilestackSDK, importing Filestack itself is fine

Multipart upload is broken (content-type error)

The problem happens both on ios and on macOS. Here are the steps to reproduce the problem on a mac:

  • git clone [email protected]:filestack/filestack-ios.git
  • cd filestack-ios
  • pod install
  • Open the workspace in xcode, run Filestack-mac-demo
  • Click Multipart Upload button, select a file.

Errors in the output box:

upload error: Error Domain=com.alamofire.error.serialization.response 
Code=-1011 "Request failed: bad request (400)" 
UserInfo={NSUnderlyingError=0x6180006419e0 {Error Domain=com.alamofire.error.serialization.response 
Code=-1016 "Request failed: unacceptable content-type: text/plain" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x618000424980> 
{ URL: 
...

I am getting the same error when I try to use multipart upload in ios.

Upload Chunking

Hello,

I see an option to upload a file, is there a way to chunk an upload into multiple parts when uploading? Is this something supported by the SDK?

Thanks!

'Client' is ambiguous for type lookup in this context

While integrating Filestack into my project I ran into a build time error "'Client' is ambiguous for type lookup in this context"

Here is the code that produces the issue:

struct FileStackAbstractor {
    //MARK: Properties
    
    //MARK: Init
    init() {
        
    }
    
    //MARK: Functions
    func retrievePolicy() -> Policy {
        let oneDayInSeconds: TimeInterval = 60 * 60 * 24
        return Policy(expiry: Date(timeIntervalSinceNow: oneDayInSeconds), call: [PolicyCall.pick, PolicyCall.read, PolicyCall.store])
    }
    
    func retrieveSecurity() throws -> Security {
        let keys = UEFileStackKeys()
        return try Security(policy: self.retrievePolicy(), appSecret: keys.secret)
    }
    
    func retrieveClient() throws -> Client {
        let security = try self.retrieveSecurity()
        let config = Filestack.Config()
        let keys = UEFileStackKeys()
        let client = Filestack.Client(apiKey: keys.appID, security: security, config: config, token: nil)
        return client
    }
    
}

The error comes from the last function in the struct. Both the Filestack and FilestackSDK pods seem to have a Client object.

Include uploaded file's name in the response object

The filename returned in pickerUploadedFiles is a guid. It would be great to include the actual file's name (the name of the file uploaded by the user) similar to how it is handled in the android SDK so that we can match the name to the new handle/url during multi upload.

Picker does not limit selections to provided documentPickerAllowedUTIs

Expected Behavior

files available in picker should be limited by list of documentPickerAllowedUTIs in config similarly to how android picker options are limited by mimeTypes.

Observed Behavior

.mov, .docx, .pdf all available to be uploaded when only config set with only "public.image"

Additional Information

I was not able to find any information regarding this config setting in the documentation.

Picker and config initialization

DispatchQueue.main.async {
        let config = Filestack.Config.builder
          .with(appUrlScheme: "suitable")
          .with(videoQuality: .typeHigh)
          .with(imageUrlExportPreset: .compatible)
          .with(maximumSelectionLimit: 1)
          .with(availableCloudSources: [.dropbox, .googleDrive, .facebook, .instagram])
          .with(availableLocalSources: self.availableLocalSources)
          .with(documentPickerAllowedUTIs: ["public.image"])
          .build()
        self.client = Filestack.Client(apiKey: API_KEY, security: nil, config: config);
        let storeOptions = StorageOptions(location: .s3, access: .public);
        let pickerController = self.client.picker(storeOptions: storeOptions);
        pickerController.delegate = self;
        pickerController.pickerDelegate = self;
        
        let appDelegate = UIApplication.shared.delegate
        appDelegate?.window??.rootViewController?.present(pickerController, animated: true);
      }

Easiest way to customize the picker?

We need to customize the picker, in particular changing the text a bit, replacing the icons and colors. What's the best way of doing this? Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.