I found an issue with ios filepicker and application switch to backround.
Steps to reproduce :
Open the file picker
Move application to background
Open application File
Move Fle to background
Open application
Click on filepicker "Cancel" button
Fist time, DocumentPickerDelegate.prototype.documentPickerWasCancelled is triggered, and the application receive empty array. Second time, DocumentPickerDelegate.prototype.documentPickerWasCancelled is not triggered
It's look like an issue related to delegate dealloc.
This code seems to fix the issue, I define a variable 'let delegate;', that is initialised with the DocumentPickerDelegate.initWithResolveReject :
export function openFilePicker(params) {
let documentTypes;
if (params.extensions && params.extensions.length > 0) {
documentTypes = Utils.ios.collections.jsArrayToNSArray(params.extensions);
}
// the delegate to avoir dealloc issue
let delegate;
return new Promise((resolve, reject) => {
// store delegate
delegate = DocumentPickerDelegate.initWithResolveReject(resolve, reject) as any;
controller.delegate = delegate;
I found an issue with ios filepicker and application switch to backround. Steps to reproduce :
Fist time, DocumentPickerDelegate.prototype.documentPickerWasCancelled is triggered, and the application receive empty array. Second time, DocumentPickerDelegate.prototype.documentPickerWasCancelled is not triggered
It's look like an issue related to delegate dealloc.
This code seems to fix the issue, I define a variable 'let delegate;', that is initialised with the DocumentPickerDelegate.initWithResolveReject :