GithubHelp home page GithubHelp logo

isabella232 / outlook-sdk-ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from officedev/outlook-sdk-ios

0.0 0.0 0.0 298 KB

Build apps for Outlook, Outlook.com, and Office 365 users with one set of APIs.

Home Page: https://dev.outlook.com/

License: Apache License 2.0

Objective-C 99.90% Ruby 0.10%

outlook-sdk-ios's Introduction

page_type products languages extensions
sample
office-365
office-outlook
objc
contentType createdDate
samples
11/12/2015 12:59:56 PM

Outlook SDK for iOS

Important: This preview SDK has been deprecated and is no longer being maintained. We recommend that you use Microsoft Graph and the associated Microsoft Graph SDKs instead.

Easily integrate services and data from Outlook into native iOS apps using this Objective-C library.


โ—NOTE: This code and associated binaries are released as a developer. You are free to use this library according to the terms of its included LICENSE and to open issues in this repo for unofficial support.

Information about official Microsoft support is available here.


This library is generated from the Outlook API metadata using Vipr and Vipr-T4TemplateWriter and uses a shared client stack.

Quick Start

To use this library in your project, follow these general steps, as described further below:

  1. Configure a Podfile.
  2. Set up authentication.
  3. Construct an API client.

Setup

  1. Create a new Xcode application project from the Xcode splash screen. In the dialog, choose iOS > Single View Application. Name your application as you wish; we'll assume the name OutlookQuickStart here.

  2. Add a file to the project. Choose iOS > Other > Empty from the dialog and name your file Podfile.

  3. Add these lines to the Podfile to import the Outlook SDK

source 'https://github.com/CocoaPods/Specs.git'
xcodeproj 'OutlookQuickStart'
pod 'MSOutlook-SDK-iOS'

NOTE: For detailed information on Cocoapods and best practices for Podfiles, read the Using Cocoapods guide.

  1. Close the Xcode project.

  2. From the command line, change to your project's directory. Then run pod install.

NOTE: Install Cocoapods first of course. Instructions here.

  1. From the same location in the terminal, execute open OutlookQuickStart.xcworkspace to open a workspace containing your original project together with imported pods in Xcode.

Authenticate and construct client

With your project prepared, the next step is to initialize the dependency manager and an API client.

โ— If you haven't yet registered your app in Azure AD, you'll need to do so before completing this step by following these instructions.

  1. Right-click the OutlookQuickStart folder and choose "New File." In the dialog, select iOS > Resource > Property List. Name the file adal_settings.plist. Add the following keys to the list and set their values to those from your app registration. These are just examples; be sure to use your own values.
Key Value
ClientId Example: e59f95f8-7957-4c2e-8922-c1f27e1f14e0
RedirectUri Example: https://my.client.app/
ResourceId Example: https://outlook.office.com/
AuthorityUrl https://login.microsoftonline.com/common/
  1. Open ViewController.m from the OutlookQuickStart folder. Add the umbrella header for Outlook and ADAL related headers.
#import <MSOutlook.h>
#import <impl/ADALDependencyResolver.h>
#import <ADAuthenticationResult.h>
  1. Add properties for the ADALDependencyResolver and MSOutlookClient in the class extension section of ViewController.m.
@interface ViewController ()

@property (strong, nonatomic) ADALDependencyResolver *resolver;
@property (strong, nonatomic) MSOutlookServicesClient *outlookClient;

@end
  1. Initialize the resolver and client within the viewDidLoad method of the ViewController.m file.
- (void)viewDidLoad {
    [super viewDidLoad];
    
   self.resolver = [[ADALDependencyResolver alloc] initWithPlist];
   
   self.outlookClient = [[MSOutlookClient alloc] initWithUrl:@"https://outlook.office.com/api/v2.0" dependencyResolver:self.resolver];
   }
  1. Before using the client, you must ensure the user has been logged on interactively at least once. You can use either interactiveLogon or interactiveLogonWithCallback: to initiate the logon sequence. In this exercise, add the following to the viewDidLoad method from the last step:
[self.resolver interactiveLogonWithCallback:^(ADAuthenticationResult *result) {
    if (result.status == AD_SUCCEEDED) {
        [self.resolver.logger logMessage:@"Connected." withLevel:LOG_LEVEL_INFO];
    } else {
        [self.resolver.logger logMessage:@"Authentication failed." withLevel:LOG_LEVEL_ERROR];
    }
}];
  1. Now you can safely use the API client.

Samples

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 Contributor License Agreement 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.

License

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0.

outlook-sdk-ios's People

Contributors

davidchesnut avatar o365devx avatar zlash 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.