Closed espritm closed 5 years ago
Hello @espritm, sorry for the delay.
Initially PrestaSharp was only flavored for .NET Framework so the use with Xamarin was not supported. Since v1.0.2 PrestaSharp supports .NET Standard, so it should work with Xamarin, we didn't tested though.
It would be great if you test it now and let us know.
Hey @mowcixo ! Thank you for your answer !
I tested this morning and yes, it's working as a charm ! :)
I have created a Xamarin Forms project with .NET Standard 2.0 (instead of PCL). This is the new version of Xamarin.
I installed the nuget PrestaSharp V1.0.3 (latest) on all solution's projects, and it compiles well. I instanciated a CartFactory and get a Cart from an ID, and again it is working well.
Thank you 👍
Hello @espritm those are great news! I'm glad you can use the library now, thanks for the feedback!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello everyone,
I would like to use PrestaSharp to create a Xamarin.Forms Android and iOS mobile app. Unfortunately, I encounter many problems and it is impossible for me to contact my prestashop website with PrestaSharp. Could you help me please ?
Here are the steps to reproduce from scratch :
Run Visual Studio and create a new "Cross Platform App (Xamarin.Forms or Native)" project.
Choose Blank App, Xamarin.Forms, and Portable Class Library (PCL)
Open the solution's Nuget Package Manager, and try to install Bukimedia.PrestaSharp on Android and iOS projects.
Get an error message :
"Could not install package 'RestSharp 105.0.1'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', 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."
PrestaSharp depends on RestSharp. So the Nuget Package Manager, search for RestSharp, and install latest version (actually 105.2.3) on Android and iOS projects.
Compile and deploy your Android app => OK, no problem
Now install PrestaSharp on Android and iOS project (actually version 1.157.0)
Compile and deploy your Android app => it does not compile. You get the following error message :
Add a button to your Page, and when the button is clicked, call this code :
When this code is executed, cartFactory.Get(iID); throw the following exception :
I googled for that and the exception seems to be throwed because there is two references to a dll but of different version. I am pretty sure it's because of System.Configuration.dll https://stackoverflow.com/a/42511504/4965913
And here I am, after two entire days working on that POC, I can't get carts from my prestashop website. Please I need your help :) What should I do to get it working ? What did I do wrong ?
I put the project on Github so you can get it to reproduce the exception : https://github.com/espritm/PrestaPOC
Thanks a lot for any help 👍