测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最新版本 | 2016年5月 |
由 Microsoft Graph、Microsoft Graph SDK 团队 维护。
这个客户端库是一个候选版本,仍在预览状态 - 请继续提供反馈,以帮助我们将它迭代到一个生产支持的库。
按照以下 步骤 注册您的应用程序。
要发送请求,必须提供一个 MSAuthenticationProvider,该提供者能够使用合适的 OAuth 2.0 认证令牌对 HTTPS 请求进行认证。
这可以通过调用类方法 [MSGraphClient setAuthenticationProvider:myAuthProvider];
来设置。
有关 MSAuthenticationProvider 的示例实现,请见 msgraph-sdk-ios-nxoauth2-adapter。
self.client = [MSGraphClient client];
一旦您有了认证的 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
}];
有关更详细的文档,请参阅
有关已知问题,请参阅 问题。