Giter Site home page Giter Site logo

xamarin.ios.onepasswordextension's Introduction

Xamarin.iOS.OnePasswordExtension

Xamarin bindings for 1Password Extension.

Usage

The source paired with the Agile Bits documentation will be your best resource, but some basic usage:

using Xamarin.iOS.OnePasswordExtension;
// class {
    // Only Add if this iOS device has 1Password available
    // ?? because this isn't currently working on iphone-simulator.
    // Must run on Device
    if ((OnePasswordExtension.SharedExtension?.IsAppExtensionAvailable ?? false)) {
        // On Button press or something {
            OnePasswordExtension.SharedExtension.FindLoginForURLString("https://your-domain.com", viewController, buttonControl, (NSDictionary loginDictionary, NSError error) => {
                if (loginDictionary == null || loginDictionary.Count == 0) {
                    if (error.Code != AppExtension.ErrorCodeCancelledByUser) {
                        System.Diagnostics.Debug.WriteLine(@"Error invoking 1Password App Extension for find login: {0}", error);
                    }
                    return;
                }

                var loginString = ((NSString)loginDictionary[AppExtension.UsernameKey]).ToString();
                var passwordString = ((NSString)loginDictionary[AppExtension.PasswordKey]).ToString();

                if (loginString.Length > 0 && passwordString.Length > 0) {
                    // Set login/password inputs
                }
            });
        // }
    }
//}

Rebuilding

All of the rebuilding mechanisms are within make. The Makefile specifies a version, which is the tag from the Agile Bits repo it checks out. Once it's checked out, it will build that project and extract an archive for binding purposes. That archive is bundled within the Nuget package.

To rebuild from scratch:

  • make all to pull the extension repo, build an archive and write a binding file
  • The binding file (ApiDefinitions.cs) needs to have Verify and Unavailable attributes commented out
  • If you're planning to release a new version, bump the version in Xamarin.iOS.OnePasswordExtension/Xamarin.iOS.OnePasswordExtension.nuspec
  • make build will build the C# project and build a nupkg
  • make publish will push to nuget - you may need API key from nuget

xamarin.ios.onepasswordextension's People

Contributors

jphenow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.