Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrossFilePicker doesn't work on iOS #49

Closed
grammatn opened this issue May 21, 2017 · 9 comments
Closed

CrossFilePicker doesn't work on iOS #49

grammatn opened this issue May 21, 2017 · 9 comments

Comments

@grammatn
Copy link

I tried to use CrossFilePicker PickFile function to choose file in my xamarin form but it doesn't work.

It said "This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."

@ctrippel1
Copy link

ctrippel1 commented Jun 2, 2017

For NuGet 1.1.0: It appears (to me) to be a NuGet package problem. When I installed the package to the iOS project it located the FilePicker.dll in the 'portable...' folder. This assembly uses a compiler directive in CrossFilePicker.cs to throw the message you are seeing (i.e. this portable assembly shouldn't be used for the native projects). I believe the assembly in the MonoTouch10 folder is the correct assembly to be referenced. I've already merged the source into my project (to figure this problem out) so am not in a position to verify the assembly in the MonoTouch10 folder will actually work. (Visual Studio 2015, BTW)

@Greg767
Copy link

Greg767 commented Aug 18, 2017

I confirm this. You must reference manually the DLLs from the MonoTouch10 folder and the plugin will work on iOS.

@ismailsameer12
Copy link

Hi Greeg767,
i was tried to add reference manually in xamarin iOS but NSInternalinconsistencyexception occur.
how to solve this?

@Greg767
Copy link

Greg767 commented Nov 7, 2017

Sorry I have no idea about that problem. I never had that one before.

@ismailsameer12
Copy link

Hi Greg767,
Thanks for you response,its ok

@johankson
Copy link

For more information, on iOS I had to change the TakeMediaAsync() method to not re-read the file again. Don't know if it's worth to do a PR since the project seems to be badly managed at the moment?

Handler = (s, e) => {
var tcs = Interlocked.Exchange(ref _completionSource, null);

 Func<Stream> streamGetter = null;
if(e.FileByte != null)
{
    streamGetter = () => new MemoryStream(e.FileByte);
}
else
{
    streamGetter = () => File.OpenRead(e.FilePath);
}

tcs?.SetResult(new FileData(e.FilePath, e.FileName, streamGetter));

@jfversluis
Copy link
Contributor

This should now be working in this NuGet: https://www.nuget.org/packages/Xamarin.Plugin.FilePicker/1.4.0-beta

If not, please open a issue on the new repo where development will be continued: https://github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows/issues

@lohitha123
Copy link

Hi,

It is not working in ios.

if any one got success in ios..Please post your solution

@jfversluis
Copy link
Contributor

@lohitha123 please see #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants