Giter VIP home page Giter VIP logo

msgraph-sdk-ios's Introduction

Get started with the Microsoft Graph SDK for iOS

This client library is a release candidate and is still in preview status - please continue to provide feedback as we iterate towards a production supported library.

For complete samples, on how to integrate and use the SDK, please visit connect samples for swift and objective-c.

1. Installation

Install via Cocoapods

  • Install Cocoapods - Follow the getting started guide to install Cocoapods.
  • Add the following to your Podfile : `pod 'MSGraphSDK', '~> 0.10' - Make sure the podfile specifies the target. For more details, please refer to the complete samples mentioned above.
  • Run the command pod install to install the latest MSGraphSDK pod.
  • Add #import <MSGraphSDK/MSGraphSDK.h> to all files that need to reference the SDK.

2. Getting started

2.1 Register your application

Register your application by following these steps.

2.2 Authentication

  • To make requests, a MSAuthenticationProvider must be provided which is capable of authenticating HTTPS requests with an appropriate OAuth 2.0 bearer token.

  • This can be set by calling the class method [MSGraphClient setAuthenticationProvider:myAuthProvider];

  • See msgraph-sdk-ios-nxoauth2-adapter for a sample implementation of MSAuthenticationProvider that can be used to jump-start your project.

2.3 Getting an authenticated MSGraphClient object

  • Once you have set the authentication provider, you must get an MSGraphClient object to make requests against the service:
self.client = [MSGraphClient client];
  • It is often practical to perform this step only upon successful completion of any UI login flow required by the specified authentication provider.

2.4 Making requests against the service

Once you have an MSGraphClient that is authenticated you can begin to make calls against the service. The requests against the service look like our REST API.

For example, to retrieve a user's OneDrive:

[[[[graphClient me] drive] request] getWithCompletion:^(MSGraphDrive *drive, NSError *error){
    //Returns an MSGraphDrive object or an error if there was one
}];

To get a user's root folder of their drive:

[[[[[graphClient me] drive] items:@"root"] request] getWithCompletion:^(MSGraphDriveItem *item, NSError *error){
    //Returns an MSGraphDriveItem object or an error if there was one
}];

3. Documentation

For a more detailed documentation see:

4. Issues

For known issues, see issues.

5. Contributions

Contributions

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

6. License

License

msgraph-sdk-ios's People

Contributors

hongbo-miao avatar kevklam avatar shiftylogic avatar tbag avatar unpluggedk avatar

Watchers

 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.