Code Monkey home page Code Monkey logo

ios-objectivec-connect-rest-sample's Introduction

Office 365 Connect Sample for iOS Using Microsoft Graph

Connecting to Office 365 is the first step every iOS app must take to start working with Office 365 services and data. This sample shows how to connect and then call one API through Microsoft Graph (previously called Office 365 unified API).

Prerequisites

  • Xcode from Apple

  • An Office 365 account. You can sign up for an Office 365 Developer subscription that includes the resources that you need to start building Office 365 apps.

    Note: If you already have a subscription, the previous link sends you to a page with the message Sorry, you can’t add that to your current account. In that case, use an account from your current Office 365 subscription.

  • A Microsoft Azure tenant to register your application. Azure Active Directory (AD) provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: Microsoft Azure.

    Important: You will also need to ensure your Azure subscription is bound to your Office 365 tenant. To do this, see the Active Directory team's blog post, Creating and Managing Multiple Windows Azure Active Directories. The section Adding a new directory will explain how to do this. You can also see Set up your Office 365 development environment and the section Associate your Office 365 account with Azure AD to create and manage apps for more information.

  • A client id (application id) and redirect uri values of an application registered in Azure. This sample application must be granted the Send mail as user permission for Microsoft Graph. To create the registration, see Grant permissions to the Connect application in Azure.

Running this sample in Xcode

  1. Clone this repository
  2. Use Carthage to import the Microsoft Authenticaion Library (MSAL) iOS dependency. Download the latest version of Carthage here.
  3. Open O365-iOS-Microsoft-Graph-Connect.xcodeproj
  4. Open info.plist. You'll see that the ClientID (application id you received from the registration process in the prerequisites section) goes here.
  <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>msalENTER_YOUR_CLIENT_ID</string>
                <string>auth</string>
            </array>
        </dict>
    </array>

Build the MSAL framework

The preview version of MSAL is distributed as source code using Carthage. To build the source code, do these steps:

  1. Open the Bash terminal and go to the app root folder.

  2. Create a cartfile: Copy echo "github \"AzureAD/microsoft-authentication-library-for-objc\" \"master\"" > Cartfile into the terminal and run the command.

  3. Build the MSAL library: Copy carthage update into the terminal and run the command.

  4. Run the sample.

To learn more about the sample, see Call Microsoft Graph in an iOS App.

Questions and comments

We'd love to get your feedback about the Office 365 iOS Microsoft Graph Connect project. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about Office 365 development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [Office365] and [MicrosoftGraph].

Contributing

You will need to sign a Contributor License Agreement before submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to submit a request via the form and then electronically sign the CLA when you receive the email containing the link to the document.

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.

Additional resources

Copyright

Copyright (c) 2017 Microsoft. All rights reserved.

ios-objectivec-connect-rest-sample's People

Contributors

bmitchell287 avatar andrewjmay avatar unpluggedk avatar iambmelt avatar ricalo avatar tadaomachida avatar o365devx avatar davidchesnut avatar

Stargazers

Irene Gorbaciova 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.