Installation
Xamarin plugin is currently supported on iOS, Android and Xamarin.Forms platforms. The recommended way to install Bugsee is using NuGet.
NuGet installation
Note: We've found NuGet package installation issues in some versions of Visual Studio where some of the DLLs are not referenced correctly. If you are facing similar issue, try updating Visual Studio to the latest version.
Open your solution, select the project you want to add Bugsee package to and open its context menu. Unfold "Add" and click "Add NuGet packages...".
Type "Bugsee" into search field, select Bugsee package and click "Add Package" button at the bottom right.
Initialization
When possible, Bugsee provides unified API across platforms for accessing Bugsee features. Initialization, on the other hand, has minor differences on iOS and Android platforms.
!iOS
// Your AppDelegate.cs file
using BugseePlugin;
namespace YourNameSpace
{
[Register("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
Bugsee.Launch("<your token>");
}
}
}
!Android
// Your Application.cs file - a subclassed Application
using BugseePlugin;
namespace YourNameSpace
{
[Application]
public class MyApplication : Application
{
public MyApplication(IntPtr handle, JniHandleOwnership ownerShip) : base(handle, ownerShip) {}
public override void OnCreate()
{
base.OnCreate();
Bugsee.Launch("<your token>");
}
}
}
Using with Xamarin.Forms
If your application is based on Xamarin.Forms, you may want to manipulate Bugsee from your shared project. Starting with version 2.0.0 you can do it following these steps:
- Add Bugsee NuGet package to your Android, iOS and shared projects
- Using
DependencyService
, register Bugsee singleton before launching it, like shown below
using BugseePlugin;
// ...
public void LaunchBugsee()
{
// register Bugsee as singleton with DependencyService
Xamarin.Forms.DependencyService.RegisterSingleton<IBugsee>(Bugsee.GetInstance());
Bugsee.Launch("<your token>");
}
- Finally, in your shared project get
Bugsee
instance fromDependencyService
and use it as required. You can do it like this:
var bugsee = Xamarin.Forms.DependencyService.Get<BugseePlugin.IBugsee>();
if (bugsee != null)
{
// perform any required manipulations
}