nCubed / TheMovieDbWrapper

C# wrapper for common requests against themoviedb.org API.
MIT License
24 stars 12 forks source link

Xamarin.iOS #11

Closed hrafnl closed 7 years ago

hrafnl commented 7 years ago

When I try to install TheMovieDbWrapper into a Xamarin.iOS project, I get the following error:

Could not install package 'TheMovieDbWrapper 0.7.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

What is the problem here?

nCubed commented 7 years ago

I'm not entirely sure the Movie Db Wrapper is compatible with Xamain; let us look into the requirements and get back with you. @hrafnl, would you be available to help test (or even contribute if you know what the problem is) if we found a path forward?

hrafnl commented 7 years ago

Yes, I would be available to help with the testing.

FYI: Next week (November 28th) I'm starting teaching a course on App Development (using Xamarin). I'm currently looking for a Movie DB wrapper that I can use as part of students' projects.

I have been able to get https://github.com/miguelhasse/Net.TMDb to work for iOS, but not for Droid (see https://github.com/miguelhasse/Net.TMDb/issues/9) and therefore I started looking into your wrapper.

nCubed commented 7 years ago

Excellent! Given you'll be using this with several students in your class, we'll make this a priority to get you up and running. We'd love to have our wrapper in front of as many people as possible :)

hrafnl commented 7 years ago

FYI: I'm currently using the code for TheMovieDBWrapper as a shared project in the student's projects that I'm creating. It works, but of course it would be nice to be able to use the NuGet package :-)

nCubed commented 7 years ago

We are trying to figure out the hoops we need to jump through to convert the project. With the current state of .netcore / .netstandard / pcl right now, traversing the conversion has been a bit rocky. We're targeting this weekend to either complete the conversion, or defer until .netstardard v2.0 is officially released with the underlying libraries upgraded to vNext.

nCubed commented 7 years ago

We have a beta-preview of a Nuget package source: TheMovieDbWrapper.0.7.3.nupkg.zip

If you're still up for testing, could you download and set up a local Nuget package source?

A local source is really easy:

  1. Select a directory anywhere on your machine: c:\Dev\Nuget
  2. Unzip the attached and drop the TheMovieDbWrapper.0.7.3.nupkg into the above directory
  3. In VS, add a local Nuget source: Tools > Options > Nuget > Package Source: click the + button and then in the bottom half of the UI, add the "Name" and "Source". Where Name can be whatever and Source is the directory you dropped the .nupkg in, i.e., c:\Dev\Nuget

Once you've created the local source, you should be able to see TheMovieDbWrapper by managing Nuget packages in Visual Studio 2015 and selecting the local package source in the upper right hand side of the Nuget package manager UI (there are other options in the drop down for nuget.org, Microsoft and .NET).

I've tested on IOS libraries and Android libraries. I believe that in order for the Xamarin project to consume the Nuget package, you'll need to make sure the project is targeting .netstandard. See: https://blog.xamarin.com/net-standard-library-support-for-xamarin/

I'm currently targeting .netstandard 1.1 with TheMovieDbWrapper, which should be the most flexible without having to target every Xamarin specific project.

Please let me know how things go. Thanks!

hrafnl commented 7 years ago

I tried it on a Xamarin project that targets both iOS and Droid. Worked without any problems. Excellent work and thanks for the effort!

Any chance of getting this NuGet package into production before Monday?

nCubed commented 7 years ago

The entire project had to be converted to target .netstandard which resulted in a fundamental change in the composition of the API's; specifically, MEF has been re-written and has moved towards a different model. For now, I'm OK with the changes and I should be able to push it up to Nuget today.

I'd be interested in hearing from you/your students if the API wrapper is easily understandable and what changes you/they'd like to see.

Thanks for testing!