1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 07:43:37 +00:00

Added tools extension page to help iOS users activate the action extension.

This commit is contained in:
Kyle Spearrin
2016-07-02 15:20:06 -04:00
parent 55ed801fe7
commit 6bb7651ad1
8 changed files with 273 additions and 2 deletions

View File

@@ -54,6 +54,22 @@ namespace Bit.iOS
UINavigationBar.Appearance.ShadowImage = new UIImage();
UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
MessagingCenter.Subscribe<Xamarin.Forms.Application>(Xamarin.Forms.Application.Current, "ShowAppExtension", (sender) =>
{
var itemProvider = new NSItemProvider(new NSDictionary(), "com.8bit.bitwarden.extension-setup");
var extensionItem = new NSExtensionItem();
extensionItem.Attachments = new NSItemProvider[] { itemProvider };
var activityViewController = new UIActivityViewController(new NSExtensionItem[] { extensionItem }, null);
activityViewController.CompletionHandler = (activityType, completed) =>
{
MessagingCenter.Send(Xamarin.Forms.Application.Current, "EnabledAppExtension",
completed && activityType == "com.8bit.bitwarden.find-login-action-extension");
};
UIApplication.SharedApplication.KeyWindow.RootViewController.ModalViewController
.PresentViewController(activityViewController, true, null);
});
return base.FinishedLaunching(app, options);
}