.Net MAUI - Github dependency - c#

I have a blank .Net MAUI App that im planning to use, for simplicity sake, on Android only at the moment. I am trying to use a Github hosted service, namely Zettle by PayPal. Their documentation for using their Android SDK is here:
https://developer.zettle.com/docs/android-sdk/installation-and-configuration
"The Zettle Payment SDK for Android is available as packages from the GitHub package hosting service. To include the Android SDK in your project, you need to add a dependency to the package service, using your GitHub Token."
I have been trying to research how to include this in a MAUI Application, but I havent found anything relevant. Does anyone have any experience to point me in the right direction in getting a Github Package included in a MAUI or XAMARIN App?
I have looked at 'Microsoft Dependency Injection' but I dont believe this will work under these circumstances.

Related

Graph API SDK for .NET v6, C# Winforms

I've just installed Visual Studio Community and wanted to have a play around with C# (.net 6 LTS) and the graph API. I've created a winform for this purpose.
I've looked at the documentation and can see i need to install the SDK via nuget, but when i'm searching the repository i can't seem to see it.
Am i doing something silly?
It would seem the default install didn't include the online nuget packages. so i spotted an image on another site with the package source. Add it and can now see the packages as expected.

How to Use the Google.GData.Contacts Version 3

I have implemented the application to read all the google contacts. The application was done by a .NET Core. I have used the Google.GData.Contacts(Version 2.2.0) Nuget package to read all the contacts. My application always show some warning messages like below
As per this document https://developers.google.com/contacts/v3, I believe the version 3.0 is there. But, I'm not sure how to include or use it.
It would be much appreciated if anyone help me on this.
There hasnt been any development on the GData library in years gdata. So I dont think its going to work with .net core.
This is due to the fact that most of the gdata apis have been shut down by now gdata.
As you can see from the nuget page Google.GData.Contacts the last update was 6/25/2013 which is before the release date of .net core.
What you should consider doing is checking the google people api which should contain similar response and supports the Google .net client library.
Install-Package Google.Apis.People.v1 -Version 1.25.0.830
It is still live
The google contacts api is still live so you can use it if you like you will just have to create your own system to access the endpoints. As google has no library that works with .net core for gdata.

MvvmCross actual SQLite plugin to use in .NET Standard project

I am developing an app with .NET Standard 2.0 project as core project, so bumped into the fact, that I am not sure how I should (can) handle the famous easy-to-access-and-setup approach with MvvmCross.
Search for Cirrious.MvvmCross.Plugins.Sqlite plugin in Nuget doesn't return anything (apparently it's been a while and it's not supported).
SQLite-PCL doesn't seem like sound .NET Standard-ish, plus there is a whole bunch of different packages with similar name (and with no any close reference to MvvmCross actually) appear.
There is also a reference to sqlite-pcl-net plugin in release notes for MvvmCross 5, but it also "doesn't smell" Mvx-y.
So, what's going on with MvvmCross SQLite these days? What should I use? Any ideas?
There used to be an official MvvmCross Plugin for SQLite but it was dropped sometime around early 2017 because the plugin was redundant. SQLite is probably the most popular database used in MvvmCross applications, but there is nothing in MvvmCross requiring this. You are still free to use Realm, Entity Framework Core, etc.
You should be using the praeclarum/sqlite-net version of SQLite since Android 7.0. Here is the NuGet feed for the package. This version supports .NET Standard and PCL. Other forks are not maintained as much, or stopped working reliably on Android due to the changes to the way SQLite was changed in Android 7.0.
I've also recently provided another answer to a question asking how to add SQLite to an MvvmCross application since the plugin was removed. I provided some sample code for Android in the answer. The old MvvmCross SQLite Plugin source code is also still available.

Missing Resources after installing ADAL Package for Xamarin.Forms PCL

I am developing a Xamarin.Forms PCL mobile application and need access to an internal API that requires authentication via Azure. My coworker gave me a code snippet that works in a console application, and I am attempting to adapt it for my mobile application.
I am able to successfully add the ADAL package to the PCL. However, authentication requires that I pass along a set of PlatformParameters for each platform-specific version. When I attempt to add the ADAL package to the Xamarin.Android project, I get the following errors in my Resource.Designer.cs file:
ERROR: 'Resource.Id' does not contain a definition for 'agentWebView'
ERROR: 'Resource.Layout' does not contain a definition for 'WebAuthenticationBroker'
The relevant (auto-generated) lines of code in Resource.Designer.cs are:
global::Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory.Resource.Id.agentWebView = global::MissionControlAuth.Droid.Resource.Id.agentWebView;
global::Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory.Resource.Layout.WebAuthenticationBroker = global::MissionControlAuth.Droid.Resource.Layout.WebAuthenticationBroker;
The names of these missing resources suggest that I need to point the ADAL package to a webview that can be used to display a login page to the user. Unfortunately, I haven't been able to find any mention of this on StackOverflow or on the Xamarin forums. How can I correctly set up the ADAL package for my Xamarin.Forms PCL?
Platform / Library Versions
.NET Framework 4.5
Xamarin.Forms v2.0.0.6482 targeting Xamarin.Android and UWP
Visual Studio 2015
Microsoft.IdentityModel.Clients.ActiveDirectory v3.5.207081303-alpha (relevant answer)
Alternatively, Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory v4.0.209160138-alpha (relevant answer)
Steps to Reproduce
Create a new Xamarin.Forms PCL project.
Choose one of the ADAL package versions above and add it to the PCL.
Add the same package version to the Xamarin.Android project. The library will install successfully, but there will be missing resource errors in the "Error List" tab in Visual Studio.
Experimental library is not supported. Please switch to MSAL available at https://www.nuget.org/packages/Microsoft.Identity.Client

The dependency Twilio in project does not support framework DNXCore, Version=v5.0

I'm interested in figuring out how to use the Twilio API, and I am building an ASP.NET 5 application using the Twilio API with MVC6 (trying to follow this tutorial). So far, I have created an empty ASP.NET 5 application, and I added "Twilio" to the dependencies in project.json. I get the following error:
"The dependency Twilio 4.0.3 in project TwilioTest does not support framework DNXCore, Version v5.0"
I notice that when I remove "dnxcore50" from "frameworks", the error goes away.
I'm not sure what this means or how to approach it. I'm still pretty new to .NET and trying to wrap my head around how all of the pieces fit together. Does it mean that Twilio isn't compatible with DNXCore? Since all I want to do for now is learn how to use Twilio, could I essentially remove the dnxcore50 framework from the project and continue working through building the app?
The Twillio NuGet package is dependent on the full .NET stack, which in project.json frameworks terms is DNX451. What that means is, you can add the Twillio NuGet package and remove the DNXCORE50 reference and your project will run as expected and you will be able to use the Twillio API. As far as I know the only major drawback is that your ASP.NET Core project will no longer be cross platform as you are now dependent on the full .NET Framework stack which is only present in Windows.
In a nutshell, you should be fine unless you are planning to deploy to Linux/OSx. Hopefully as ASP.NET CORE becomes mainstream more 3rd party SDKs will be built to require only DNXCORE50 as a dependency.
Another option don't use the Twillio Libraries and code against their REST API. See documentation here: https://www.twilio.com/docs/api. But I wouldn't recommend this if you are deploying to a Windows environment.
Twilio is working on their .Net Standard (Core) library. In the meantime, I've published a .Net Core port of their library to unblock our current projects until we get the official update. Feel free to take it for a spin:
Install Twilio.NetCore from Nuget.
And you can check out the source on Github.

Categories

Resources