Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Xamarin PCL Refit 3.0.1 , Doesn't look like a Refit interface

$
0
0

I recently started working on a Xamarin Android/iOS project with a PCL class where I want to put all the logic in. Like my Refit interfaces, ReactiveUI ViewModels et cetera, but every time when trying to execute my code I get a error saying that my interface is not a Refit interface. Currently my interface looks like this.

public interface IMyApi{    [Post("/authenticate")]    IObservable<Models.ApiResponses.AuthenticationResponse> SigninRaw([Body] JObject credentials);    [Get("/service")]    IObservable<Models.ApiResponses.MyListResponse> GetServiceListRaw();    [Get("/service/{id}/idstatus")]    IObservable<Models.ApiResponses.IdResponse> GetIdStatusRaw(string Id);}

As far as I know this looks good and this also works when I'm trying to load this from a specific platform like iOS project. But when trying to do it from a PCL if fails! I have installed the Refit package in both of my platform specific project Android & iOS and I referenced a dll in the PCL, what did I miss?

If there is need for more information or you have any question, please do not hesitate to ask.Well without further ado, thank you for reading and hopefully someone can assist me with this, because I starting to loose my mind the past couple of days.

Edit: added calling method.Here I calling it from a ViewModel

var client = new HttpClient(NetCache.UserInitiated){    BaseAddress = new Uri("https://api.address.com")};var api = RestService.For<IMyApi>(client); <= here it crashesvar response = api.SigninRaw(token);

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>