Tuesday, July 21, 2020
Tuesday, July 14, 2020
This article we are going to see, how to implement PayUMoney payment integration in Xamarin iOS. Before we start, I’ll do this payment gateway through WebView, I’ve tried to bind native library to Xamarin iOS Library, but my bad luck, it was a failure, so I have moved into WebView.
- Visual Studio or Visual Studio for Mac
- PayUMoney Production or Test Key and Salt
Create a new Xamarin iOS project in Visual Studio, for this sample I used Visual Studio for Mac. For that, Open Visual Studio for Mac and click New, in the left plane select App under iOS section and then click Create. In the new dialog window, give the project name, solution name, and location, then click Create.
Step 2 :
Open ViewController.cs file and create new UIWebView inside ViewDidLoad method and set the WebView frame equal to base view frame size, implement the IWebViewDelegate interface and override the ShouldLoad method and set this interface the WebView we already created.
Create NSMutableUrlRequest class and set request method as POST and set Header type as “application/json”
GetPostString method used for append all parameters as given below and set this returned string into the body of NSMutableUrlRequest class.
GetHash method used to convert the string into SHA512 format. And full source code is given below.
Run the application and get the output like the below video.
The sample in GitHub
If, you any issue in Key and Salt, just command below. This article credit goes to @anbumani27
Thursday, June 18, 2020
- Visual Studio for Mac
Tuesday, June 16, 2020
This blog, we are going to see how to implement Toast Message in Xamarin Forms for Android and iOS. This project, we can use dependency injection to display toast and not using any third-party plugin. The android has a default widget for toast but iOS has an only alert controller.
Let’s start the story
Create Xamarin Forms Mobile App in Visual Studio for Mac. For that, go to Visual Studio for Mac >> New >> In the left plane select Cross-Platform and center plane select Blank Xamarin Forms App and click Next >> Give Application Name and Target Platforms, click Next and again click Create.
After project creation, expand the Shared project and create an IMessage.cs interface under Interface Folder. For that, right-click the shared project and select new File >> In the dialog window, select interface and give name as IMessage and click Add. Create two methods for a long and short message, the code is given below.
Now, Expand the Android project and create MessageAndroid class. This MessageAndroid class inherits from the IMessage interface, that we already created in Shared Project and register this class as a dependency. This Code is given below.
Next, open iOS Project and create MessageiOS class and as well as inherit the same IMessage interface to this class and the full source code given below. Here we created a simple alert Controller and timer Scheduled to disappear the alert controller.
Now, design your user interface in MainPage.xaml file in Shared Project. For that, go to Solution Explorer >> Shared Project >> double click and open MainPage.xaml and design two-button with the clicked event. The code is given below.
Next, open MainPage.cs file and call dependency service to show toast and the code is given below
Run, your application, and click the buttons to show a toast message. The screenshot is given below.
The Full Source Code in Github
I hope you, this article helpful for you, and if you have any suggestions or comments post in the comment below. Thanks for reading.
Sunday, June 7, 2020
Saturday, June 6, 2020
- Qualcomm DragonBoard 410c
- USB-A to Mini -USB Cable
- External Display
- Keyboard & Mouse
Note: Your device not shown in the select device, long press power button with + Plus button.