• This repository has been archived on 25/Jul/2023
  • Stars
    star
    101
  • Rank 336,125 (Top 7 %)
  • Language
    Objective-C
  • License
    Other
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OneDrive SDK for iOS

Note: OneDrive SDK for iOS to be deprecated / archived, please use Microsoft Graph SDKs instead

What is happening?

As of March 10, 2022 the OneDrive SDK for iOS is beginning the process of being deprecated and ultimately the project archived.

Why is this happening?

There are several reasons why we are choosing to end support for this SDK. Most importantly in the time since this SDK was last updated we have seen the emergence of Microsoft Graph as the preferred path for interfacing with OneDrive programmatically. Microsoft Graph receives the latest and greatest updates and provides more up-to-date SDKs as well.

Additionally the OneDrive SDK for iOS currently uses the UIWebView component that has been marked deprecated by Apple. Although no current deadline for updating applications has been provided (see article) we expect this functionality to stop working at some point in an iOS update.

How do I make the transition to Microsoft Graph?

To get started with Microsoft Graph on iOS please use the following resources:

Get started with the OneDrive SDK for iOS

Build Status

Integrate the OneDrive API into your iOS app!

1. Installation

Install via Cocoapods

  • Install Cocoapods - Follow the getting started guide to install Cocoapods.
  • Add the following to your Podfile : pod 'OneDriveSDK'
  • Run the command pod install to install the latest OneDriveSDK pod.
  • Add #import <OneDriveSDK/OneDriveSDK.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 Set up Keychain Sharing Entitlements in your Xcode Project

Click on your project in the Navigator pane in Xcode. Click on your application target and then the "Capabilities" tab. Scroll down to "Keychain Sharing" and flip the switch on. Add "com.microsoft.adalcache" to that list.

2.2 Setting your application Id and scopes

  • You can set your application Id and scopes directly on the ODClient object.

  • For applications targeting OneDrive call the class method [ODClient setMicrosoftAccountAppId:<applicationId> scopes:<scopes>] with a specified <applicationId> and <scopes>. For more info about scopes, see Authentication scopes.

  • For applications targeting OneDrive for Business call the class method [ODClient setActiveDirectoryAppId:<applicationId> redirectURL:<redirectURL>] with specified <applicationId> and <redirectURL>. Note: the redirect URL must match the redirect URL that you specified in the Azure Management Portal.

2.3 Getting an authenticated ODClient object

  • Once you have set the correct application Id and scopes, you must get an ODClient object to make requests against the service. The SDK will store the account information for you, but when a user logs on for the first time, it will invoke UI to get the user's account information.

  • Get an authenticated ODClient via the clientWithCompletion method:

[ODClient clientWithCompletion:^(ODClient *client, NSError *error){
    if (!error){
        self.odClient = client;
    }
 }];

2.4 Making requests against the service

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

To retrieve a user's drive:

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

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

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

For a general overview of how the SDK is designed, see overview.

For a complete sample application, see OneDriveAPIExplorer.

3. Documentation

For a more detailed documentation see:

4. Issues

For known issues, see issues.

5. License

License

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.

More Repositories

1

onedrive-sdk-python

OneDrive SDK for Python! https://dev.onedrive.com
Python
1,075
star
2

onedrive-api-docs

Official documentation for the OneDrive API
TypeScript
449
star
3

onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
C#
284
star
4

onedrive-sdk-android

OneDrive SDK for Android!
Java
140
star
5

onedrive-explorer-js

OneDrive sample application for JavaScript.
HTML
112
star
6

onedrive-picker-android

Sample application for OneDrive file picker SDK for Android
Java
100
star
7

onedrive-sample-apibrowser-dotnet

C#
77
star
8

onedrive-explorer-win

OneDrive API Explorer sample code for Windows / C#
64
star
9

onedrive-explorer-android

OneDrive Explorer for Phone and Tablets!
Java
55
star
10

samples

Contains samples, scenarios, and guidance for integrating with OneDrive and SharePoint drives, drive items, and files.
C#
51
star
11

apidoctor

Application for validating API documentation and generating test cases
C#
40
star
12

onedrive-community-samples

Repository for community samples in OneDrive GitHub organization.
34
star
13

onedrive-admin-scripts

OneDrive Scripts for Administrators
PowerShell
31
star
14

o365-markdown-file-handler-v2

File handler for Office 365 to enable previewing and viewing markdown documents
C#
27
star
15

onedrive-texteditor-js

Simple single-page JavaScript app for editing text files
JavaScript
26
star
16

markdown-scanner

Application for scanning markdown documentation and generating test cases for APIs.
C#
23
star
17

onedrive-sdk-dotnet-msa-auth-adapter

C#
23
star
18

onedrive-webhooks-aspnet

Sample ASP.NET MVC application that receives webhooks from OneDrive and OneDrive for Business
JavaScript
19
star
19

graph-sample-photobrowser-uwp

The Microsoft OneDrive Graph Photo Browser sample is a Windows Universal app that uses the OneDrive SDK for C#/.NET. The sample app displays only items that are images from a user's OneDrive. Note that this sample does not work with OneDrive for Business.
C#
17
star
20

onedrive-sample-sync-ios

OneDrive iOS Sync Sample App
Swift
13
star
21

onedrive-data-robot-azure-function

Sample code using Azure Functions with OneDrive webhooks
C#
11
star
22

onedrive-sample-photobrowser-uwp

C#
10
star
23

document-library-audio-transcription-robot-sample

Sample from Ignite 2017 talk, that uses the Speech API to transcribe audio files in a document library
C#
4
star
24

file-browser-demo

JavaScript
3
star
25

.github

Default Community Health Files for the OneDrive organization on GitHub
1
star