MSGraphSDK 0.10.1

MSGraphSDK 0.10.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新版本2016年5月

Microsoft GraphMicrosoft Graph SDK 团队 维护。



MSGraphSDK 0.10.1

  • Microsoft Graph

开始使用 Microsoft Graph SDK for iOS

这个客户端库是一个候选版本,仍在预览状态 - 请继续提供反馈,以帮助我们将它迭代到一个生产支持的库。

1. 安装

2. 入门

2.1 注册您的应用程序

按照以下 步骤 注册您的应用程序。

2.2 认证

  • 要发送请求,必须提供一个 MSAuthenticationProvider,该提供者能够使用合适的 OAuth 2.0 认证令牌对 HTTPS 请求进行认证。

  • 这可以通过调用类方法 [MSGraphClient setAuthenticationProvider:myAuthProvider]; 来设置。

  • 有关 MSAuthenticationProvider 的示例实现,请见 msgraph-sdk-ios-nxoauth2-adapter

2.3 获取认证的 MSGraphClient 对象

  • 一旦设置好了认证提供程序,您就必须获取一个 MSGraphClient 对象来向该服务发送请求
self.client = [MSGraphClient client];
  • 通常,您只需在完成指定认证提供者要求的任何 UI 登录流程后进行此步骤。

2.4 向服务发送请求

一旦您有了认证的 MSGraphClient,就可以开始向服务发送调用了。针对服务的请求类似于我们的 REST API

例如,要检索用户的 OneDrive

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

要获取用户的驱动根文件夹

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

3. 文档

有关更详细的文档,请参阅

4. 问题

有关已知问题,请参阅 问题

5. 贡献

贡献

6. 许可证

许可证