-
Notifications
You must be signed in to change notification settings - Fork 53
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
Comments
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) |
I confirm this. You must reference manually the DLLs from the MonoTouch10 folder and the plugin will work on iOS. |
Hi Greeg767, |
Sorry I have no idea about that problem. I never had that one before. |
Hi Greg767, |
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)); |
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 |
Hi, It is not working in ios. if any one got success in ios..Please post your solution |
@lohitha123 please see #87 |
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."
The text was updated successfully, but these errors were encountered: