Twitter Service Into UWP App Using UWP Community Toolkit

This article is divided into three sections - The first two sections explain about the installation of the Twitter application and installation of UWP Service Tool kit , while the final part explains the integration of them into the application.

Create Twitter application

Install the UWP Service

Integrate Twitter into main application

Create Twitter application

What is that Twitter application? Why is it required? By a simple example, we will understand the concept; for example, some websites you can login with your Twitter account

Ex -http://www.c-sharpcorner.com/ you can login with your twitter account, for this concept implementation Csharpcorner requires communication with the twitter account, for this communication the Twitter application is required. Twitter application is a collection of APIs to interact with Twitter server.

Note: Twitter application is called access token.

The same concept if required in our application, first we have to create twitter application. Now we will see how to create the twitter application

Steps to Create Twitter application

URL: https://apps.twitter.com/app/new

Fill the Name & other information.

Set the access permission.

Consumer key and Consumer secret will be automatically created.

Twitter application is ready.

Install the UWP Toolkit

UWP Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps.

For our application to implement Twitter access, we don't have the need to write the code from scratch. UWP toolkit helper class is available. We just add the helper reference into our application & use helper function to interact with Twitter application.

Adding helper reference into our project.

Steps

Create a new project (ex: Toolkit)

Right click -> Manage NuGet Packages

Search “Microsoft.Toolkit.Uwp”

Select the “Microsoft.Toolkit.Uwp.Services” & Install.

UWP Tool kit has been installed in our application.

Integrated twitter into main application

Add the namespace and initialize the service (same project which we have created in the previous section).