Skip to main content

Ios

How to detect screen keyboard appearance changes

·5 mins

Detecting on-screen keyboard toggles and proper handling of such changes can be quite tricky. Android tries to deal with those events on its own but its behavior is often far from perfect. iOS, on the other hand, leaves all the work to an app developer. Both approaches have its advantages and disadvantages but sooner or later each mobile app dev will have to face this problem.

Badge icon notification in Xamarin.Forms ToolbarItems on iOS

·5 mins

Most of iPhone and iPad users can easily recognize icon badges - the pattern for application notifications typically presented in app icon or navigation bar. People that got used to this pattern might want to have the same user experience in their Xamarin Forms application. This post describes how to customize the navigation toolbar in iOS to dynamically display such elements.

Cleaning ADAL token cache on Android and iOS

·2 mins

Microsoft Azure Active Directory Authentication Libraries (ADAL) is a popular set wrapper around Azure Active Directory API distributed in the form of platform and language specific components. It’s especially useful in multi-platform applications that integrate with various AD APIs such as Outlook or Graph API. It not only wraps the oAuth endpoints but automates the entire application flow for retrieving, refreshing and persisting tokens.

How to setup Ninject as the default DI container in MvvmCross?

·3 mins

When you build a multi-platform application in .NET, especially for the mobile, you typically choose between two approaches. One is to code the shared UI layer commonly with Xamarin.Forms (you will still need to have some parts to be placed in platform projects, like custom renderers or providers). The second is to put the entire UI code in platform-specific projects. In this approach you can use the full power of each platform features (like fragments on Android). Both solutions allow for sharing common business logic between all the platforms. On the other hand full implementation of MVVM pattern in the second approach can be tricky and time consuming. The solution is to use 3rd party library; and here comes the MvvmCross. It covers many more areas than the pure MVVM pattern:

Why ADAL does not persist user credentials on iOS simulator?

·2 mins

If you are using Azure Active Directory services you probably at least considered using ADAL as a client library in you application. It’s easy to setup, use and it offers a unified API across the most popular platforms - iOS, Android, UWP, web - both .Net and native. Unfortunately sometimes things just does not work out of the box without deeper understanding how some features are implemented. This post is about one of them - credentials cache persistency on iOS.

Why does MVVMCross view model initialize twice on iOS?

·2 mins

Working on a bug fix in MVVMCross-based mobile application I noticed a strange behavior. The navigation to other view model I put in async Init<TInit>(TInit parameters) which as executed on the first view model in my app was running twice. After a short debugging session it turned out that MvxViewModel<TInit> Init() is called from the view controllers ViewDidLoad() method. Obviously there was something I was missing in terms of ViewDidLoad() semantics.