Git Product home page Git Product logo

amazon-location-mobile-auth-sdk-ios's Introduction

Amazon Location Service Mobile Authentication SDK for iOS

These utilities help you authenticate when when making Amazon Location Service API calls from their iOS applications. This specifically helps when using Amazon Cognito or API keys as the authentication method.

Installation

  1. Go to File -> Add Package Dependencies in your XCode project.
  2. Type the package URL (https://github.com/aws-geospatial/amazon-location-mobile-auth-sdk-ios/) into the search bar and press the enter key.
  3. Select the "amazon-location-mobile-auth-sdk-ios" package and click on "Add Package".
  4. Select the "AmazonLocationiOSAuthSDK" package product and click on "Add Package".

Usage

After installing the library, import the AuthHelper class in an activity:

import AmazonLocationiOSAuthSDK
import AWSLocationXCF

You can create an AuthHelper and use it with the AWS SDK:

// Create an authentication helper instance using an Amazon Location API Key
func exampleAPIKeyLogin() {
    let authHelper = AuthHelper()
    let locationCredentialsProvider = authHelper.authenticateWithAPIKey(apiKey: "My-Amazon-Location-API-Key", region: "us-east-1")
    let locationClient = authHelper.getLocationClient()
}
// Create an authentication helper using credentials from Cognito
func exampleCognitoLogin() {
    let authHelper = AuthHelper()
    let locationCredentialsProvider = authHelper.authenticateWithCognitoUserPool(identityPoolId: "My-Cognito-Identity-Pool-Id", region: "us-east-1")
    let locationClient = authHelper.getLocationClient()
}

You can use the location client to make calls to Amazon Location Service. Here is an example that searches for places near a specified latitude and longitude:

let searchPlaceIndexForPositionRequest = AWSLocationSearchPlaceIndexForPositionRequest()!

searchPlaceIndexForPositionRequest.indexName = "My-Place-Index-Name"
searchPlaceIndexForPositionRequest.position = [30.405423, -97.718833]

let nearbyPlaces = locationClient.searchPlaceIndex(forPosition: searchPlaceIndexForPositionRequest)

Security

See CONTRIBUTING for more information.

Getting Help

The best way to interact with our team is through GitHub. You can open an issue and choose from one of our templates for bug reports, feature requests or guidance. If you have a support plan with AWS Support, you can also create a new support case.

Contributing

We welcome community contributions and pull requests. See CONTRIBUTING.md for information on how to set up a development environment and submit code.

License

The Amazon Location Service Mobile Authentication SDK for iOS is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.

amazon-location-mobile-auth-sdk-ios's People

Contributors

zeeshanmakeen avatar bridyck avatar ejboucher avatar amazon-auto 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.