How to integrate Native ios and android sdk in Xamarin - xamarin

I have to integrate one third party sdk in xamarin project.
They are providing the native sdk's for android and ios. I need to use them in Xamarin project to develop app for ios and android.

Xamarin offers in depth documentation for linking native libraries.
Linking native library iOS here and Binding a java Library here.
If you want to go further and use these sdk's in Xamarin.Forms you can make a wrapper in each platform dependent project and link them to your Forms project using Xamarin.Forms.DependencyService.

To use Firebase Crashlytics in your application follow the steps:
Install packages: Xamarin.firebase.iOS.Crashlytics and Xamarin.firebase.iOS.Core
Download GoogleService-Info.Plist file and add it to your project.
Set the build action as "Bundle Resource".
Build the project and run.

Related

Cannot find "cross-platform using PCL" while creating a xamarin app

I want to create a xamarin cross platform using PCL. I do not find this option while creating a project. Am I missing any installations?
Is "Xamarin.UITest Cross Platform Test Project" similar to that? But that does not open Android and IOS directories in it
The PCL option is deprecated .
From the official documentation:
Portable Class Libraries (PCLs) are considered deprecated in the
latest versions of Visual Studio. While you can still open, edit, and
compile PCLs, for new projects it is recommended to use .NET Standard
libraries to access a larger API surface area.
If you wan't to create a Xamarin.Forms solution, you must select the Mobile App (Xamarin.Forms) template. Nowadays, everything moved to .netstandard 2.0

how to develop tvOS app using nativescript

I'm trying to build a tvOS and roku app with nativescript.
I was about to start working on the tvOS app after I read this article https://www.nativescript.org/blog/running-the-nativescript-runtime-for-ios-on-apple-tv but I'm not sure where the nativescript ios runtime or the metadata generator are in my project. Also, would this mean that my provisioning file and certificates should be for an appletv app instead of ios?
The iOS runtime is generally downloaded from NPM for your project. But it includes support for only iOS. For tvOS, you will have to checkout the open source iOS runtime project from Github and update the config scripts as described in the blog post,
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator;-appletvos;-appletvsimulator")
set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "iphoneos iphonesimulator appletvos appletvsimulator")
and build your custom version of iOS runtime with CMake.

Adding CoreBluetooth assembly in xamarin cross platform project

I am developing a xamarin cross platform project in visual studio environment, I want to add CoreBluetooth library to my project. According to this link xamarin link
I am new to develop xamarin.Please let me know how to add this library.

Integrate Crashlytics in visual studio?

I am new at VisualStudio.I am using xamarin for both iOS and Android application.
Now, If i want to integrate Crashlytics in my application then what should i do or how should i do?
Suggestions please.
There are two easy and widely use option for xamarin Crashlytics:
Hockey App
Firebase
Also if you need within the premises you can write some code.
You can use Fabric to add Crashlytics to your app.
Drungrin has built a fabulous NuGet package to connect your Xamarin iOS & Android apps to Fabric & Crashlytics (GitHub Link).
Getting it hooked up to your app is a massive hastle because Fabric don't natively support Xamarin however.. (forgive the shameless plug) I have written up a complete guide on implementing it on both platforms, link here. The long and the short of this is:
iOS (you need a mac for this)
Create a new native ios app (through xcode) with the same bundle id as your xamarin app & install it using the fabric mac app.
Forget about the xcode project (you only need to register the bundle id), add api key from sample to xamarin info.plist
add fabric & crashlytics nugets (follow github docs)
build your xamarin app for release & then archive for publishing. Open the fabric mac app and you will have your build in archives. Dysms can be automated to upload but for now you can upload them manually
Android
Create a new native Android app (using android studio), Make sure build & version numbers are the same as your xamarin app. Let the fabric plugin build & connect the sample to fabric. (once again the app need the same name)
Copy the fabric api key from sample to xam app manifest (edit the xml).
Give the android app internet permissions (if yours somehow doesnt)
Copy the crashlytics.build.properties file (found $ProjectFolder -> app -> build -> intermediates -> assets -> debug) into your xamarin app's resources, set build action to AndroidAsset.
Copy the crashlytics build number into string.xml: <string name="com.crashlytics.android.build_id">APP_BUILD_NUMBER</string>
add fabric & crashlytics nugets (follow github docs).
Archive app & publish apk
Drag apk into fabric plugin (android studio).
As of 2022 and Visual Studio 2019 for MacOS, there is now a NuGet package that handles the Firebase Crashlytics API. If you add the Xamarin.Firebase.IOS.Crashlytics package, and your GoogleService-Info.plist into the project, you can then add the updated Initialization code.

Can not compile after migrating unified api in xamarin forms

We have migrated the xamarin forms project to unified api.
But we have the strange compile error like this:
Could not AOT the assembly '.../iOS/obj/iPhone/Debug/mtouch-cache/Build/Xamarin.Forms.Labs.dll
So I changed the settings in iOS project's options.
In ios Build Tab of Project options(iOS) I changed the "don't link" to "Link all assemblies".
But the app is crashed when it is started.
xamarin version is 5.7.1(build 17).
xamarin forms's version is 1.3.5.6337.
xamarin forms labs's version is 1.0.1.5.
Please help me if you have the experience with this error.
Replace Xamarin.Forms.Labs with XLabs.Forms.
There has been a major refactoring on how the XLabs project is structured so your existing project based on the 1.x.x will break. The reason for the refactoring was simple; separate functionality that does not depend on Xamarin.Forms into different assemblies. This allows the use of functionality like IoC, Serialization and even platform specific services without referencing XF.
To upgrade:
Uninstall any existing Xamarin.Forms.Labs packages from your
project.
Install XLabs.Forms package to your projects (PCL, iOS, Droid & WP). This will update Xamarin.Forms to the latest stable release (1.4.x)
Refactor code to reference the correct namespaces.

Resources