adebisi-fa / paystack-dotnet

PayStack API for .Net Developers!
http://developers.paystack.co/docs
MIT License
37 stars 37 forks source link

Nuget Package not working for Xamarin Forms (iOS & Android) application #4

Closed DemiladeA closed 7 years ago

DemiladeA commented 7 years ago

Good day, I am having issues adding the paystack plugin to a Xamarin Forms application, I get the error below

"Could not install package 'Paystack.Net 0.7.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', 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."

Please help

adebisi-fa commented 7 years ago

Hello @DemiladeA ,

PayStack.Net currently supports .Net Standard 2.0, hence requires at least .Net 4.6.1 to function.

In view of this, I'll suggest you upgrade your Xamarin project as follows, to take advantage of this library:

Please refer to the .NET implementation support table on this .Net Standard compatibility page.

Hope this helps, and sincere apology for the delayed response.

Regards, please.

DemiladeA commented 7 years ago

@adebisi-fa Hi Xamarin forms applications run on .Net 4 or .Net 4.5 is there anyway around this, I am building using a portable class library

https://developer.xamarin.com/guides/cross-platform/application_fundamentals/pcl/introduction_to_portable_class_libraries/

adebisi-fa commented 7 years ago

Hello @DemiladeA,

It's very true that Xamarin Forms application runs on .Net 4 or .Net 4.5 and allows code sharing via the PCL. However, the PCL is being replaced with .Net Standard, and developers will reap huge benefit in code sharing convenience and maintainability migrating to .Net Standard (especially now that v2.0 has shipped).

Besides, you won't loose anything at all adopting .Net Standard (from PCL).

Please kindly review the following articles on these benefits and how to migrate your Xamarin Forms application to take advantage of the much better .Net Standard (2.0).

Except from this article: ".NET Standard libraries are the replacement for Portable Class Libraries (PCL). However, a library that targets .NET Standard is still a PCL, and is referred to as a .NET Standard-based PCL. . . . Xamarin.Forms 2.4 allows Xamarin.Forms applications to target .NET Standard 2.0 by replacing the PCL or shared project with a .NET Standard 2.0 library." Please checkout the article for more information.

Besides, you won't loose anything at all adopting .Net Standard (from PCL).

Hope this helps.

ibrahimlawal commented 7 years ago

@DemiladeA @adebisi-fa one important note I need to chip in is this:

If you are planning to use the Paystack.NET library on Xamarin, you will be bundling your secret key into the app your mobile phone users will install.

Your secret key is never meant to be in client side. Having the secret key there will expose your secret key (and by extension, all your Paystack data) to anyone who can look at your app binary, empowering them to "do and undo".

While we are yet to conclude a Paystack SDK for Xamarin, you may want to simply adopt Paystack.NET in your backend while using a webview to display our payment form.

You may also want to contribute a Xamarin clone of any of our SDKs: https://github.com/PaystackHQ/paystack-ios https://github.com/PaystackHQ/paystack-android .