"
12 | }
13 | }
14 | ]
15 | },
16 | "SaveToSentItems": "true"
17 | }
18 |
--------------------------------------------------------------------------------
/Notices.md:
--------------------------------------------------------------------------------
1 | #Third Party Notices for Office 365 iOS Connect Converged Auth
2 |
3 | This project incorporates material from the project(s) listed below (collectively, "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notices and licenses, under which Microsoft received such Third Party Code, are set out below together with the full text of such licenses. These notices and licenses are provided for informational purposes only. This Third Party Code is licensed to you under the terms set forth in the licenses set forth below. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise.
4 |
5 |
6 |
7 | - [Azure Active Directory Authentication Library for iOS](https://github.com/AzureAD/azure-activedirectory-library-for-objc), which is Copyright (c) Microsoft Open Technologies, Inc. and is available under the Apache 2.0 license: [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) ("License").
8 | \
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 |
4 | Copyright (c) 2015 Microsoft
5 |
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | THE SOFTWARE.
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io
2 |
3 | ### Xcode ###
4 | build/
5 | *.pbxuser
6 | !default.pbxuser
7 | *.mode1v3
8 | !default.mode1v3
9 | *.mode2v3
10 | !default.mode2v3
11 | *.perspectivev3
12 | !default.perspectivev3
13 | xcuserdata
14 | *.xccheckout
15 | *.moved-aside
16 | DerivedData
17 | *.xcuserstate
18 |
19 |
20 | ### Objective-C ###
21 | # Xcode
22 | #
23 | build/
24 | *.pbxuser
25 | !default.pbxuser
26 | *.mode1v3
27 | !default.mode1v3
28 | *.mode2v3
29 | !default.mode2v3
30 | *.perspectivev3
31 | !default.perspectivev3
32 | xcuserdata
33 | *.xccheckout
34 | *.moved-aside
35 | DerivedData
36 | *.hmap
37 | *.ipa
38 | *.xcuserstate
39 |
40 | # CocoaPods
41 | #
42 | Pods/
43 | *Podfile.lock
44 |
45 | ### OSX ###
46 | .DS_Store
47 | .AppleDouble
48 | .LSOverride
49 |
50 | # Icon must end with two \r
51 | Icon
52 |
53 |
54 | # Thumbnails
55 | ._*
56 |
57 | # Files that might appear in the root of a volume
58 | .DocumentRevisions-V100
59 | .fseventsd
60 | .Spotlight-V100
61 | .TemporaryItems
62 | .Trashes
63 | .VolumeIcon.icns
64 |
65 | # Directories potentially created on remote AFP share
66 | .AppleDB
67 | .AppleDesktop
68 | Network Trash Folder
69 | Temporary Items
70 | .apdisk
71 |
72 | #Carthage
73 | Carthage/Checkouts
74 | Carthage/Build
75 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/EmailBody.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Congratulations!
5 | You just sent this email from the O365 iOS Unified API Connect sample. How cool is that? You are well on your way to incorporating Office 365 services in your apps.
6 | Give us feedback
7 | We'd love to get your feedback about the Office 365 iOS Unified API Connect project. You can send your questions and suggestions to us in the issues section of the repository.
8 |
For more details on what else you can do with the Office 365 services in your iOS app, start with the
9 | Getting started with iOS page on dev.office.com.
10 | Thanks, and happy coding!
11 | Your Office 365 Development team
12 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/ConnectViewController.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import
7 |
8 | @interface ConnectViewController : UIViewController
9 |
10 | @end
11 |
12 | // *********************************************************
13 | //
14 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
15 | //
16 | // Copyright (c) Microsoft Corporation
17 | // All rights reserved.
18 | //
19 | // MIT License:
20 | // Permission is hereby granted, free of charge, to any person obtaining
21 | // a copy of this software and associated documentation files (the
22 | // "Software"), to deal in the Software without restriction, including
23 | // without limitation the rights to use, copy, modify, merge, publish,
24 | // distribute, sublicense, and/or sell copies of the Software, and to
25 | // permit persons to whom the Software is furnished to do so, subject to
26 | // the following conditions:
27 | //
28 | // The above copyright notice and this permission notice shall be
29 | // included in all copies or substantial portions of the Software.
30 | //
31 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 | //
39 | // *********************************************************
40 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import
7 |
8 | @interface AppDelegate : UIResponder
9 |
10 | @property (strong, nonatomic) UIWindow *window;
11 |
12 | @end
13 |
14 | // *********************************************************
15 | //
16 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
17 | //
18 | // Copyright (c) Microsoft Corporation
19 | // All rights reserved.
20 | //
21 | // MIT License:
22 | // Permission is hereby granted, free of charge, to any person obtaining
23 | // a copy of this software and associated documentation files (the
24 | // "Software"), to deal in the Software without restriction, including
25 | // without limitation the rights to use, copy, modify, merge, publish,
26 | // distribute, sublicense, and/or sell copies of the Software, and to
27 | // permit persons to whom the Software is furnished to do so, subject to
28 | // the following conditions:
29 | //
30 | // The above copyright notice and this permission notice shall be
31 | // included in all copies or substantial portions of the Software.
32 | //
33 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
35 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
37 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
38 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
39 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 | //
41 | // *********************************************************
42 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/SendMailViewController.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import
7 |
8 | @class AuthenticationManager;
9 |
10 | @interface SendMailViewController : UIViewController
11 |
12 | @property (nonatomic) AuthenticationManager *authManager;
13 |
14 | @end
15 |
16 | // *********************************************************
17 | //
18 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
19 | //
20 | // Copyright (c) Microsoft Corporation
21 | // All rights reserved.
22 | //
23 | // MIT License:
24 | // Permission is hereby granted, free of charge, to any person obtaining
25 | // a copy of this software and associated documentation files (the
26 | // "Software"), to deal in the Software without restriction, including
27 | // without limitation the rights to use, copy, modify, merge, publish,
28 | // distribute, sublicense, and/or sell copies of the Software, and to
29 | // permit persons to whom the Software is furnished to do so, subject to
30 | // the following conditions:
31 | //
32 | // The above copyright notice and this permission notice shall be
33 | // included in all copies or substantial portions of the Software.
34 | //
35 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
39 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
40 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
41 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 | //
43 | // *********************************************************
44 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/main.m:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
3 | */
4 |
5 | #import
6 | #import "AppDelegate.h"
7 |
8 | int main(int argc, char * argv[])
9 | {
10 | @autoreleasepool
11 | {
12 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
13 | }
14 | }
15 |
16 | // *********************************************************
17 | //
18 | // O365-iOS-Connect-Converged-Auth, https://github.com/OfficeDev/O365-iOS-Connect-Converged-Auth
19 | //
20 | // Copyright (c) Microsoft Corporation
21 | // All rights reserved.
22 | //
23 | // MIT License:
24 | // Permission is hereby granted, free of charge, to any person obtaining
25 | // a copy of this software and associated documentation files (the
26 | // "Software"), to deal in the Software without restriction, including
27 | // without limitation the rights to use, copy, modify, merge, publish,
28 | // distribute, sublicense, and/or sell copies of the Software, and to
29 | // permit persons to whom the Software is furnished to do so, subject to
30 | // the following conditions:
31 | //
32 | // The above copyright notice and this permission notice shall be
33 | // included in all copies or substantial portions of the Software.
34 | //
35 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
37 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
39 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
40 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
41 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 | //
43 | // *********************************************************
44 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | CFBundleURLTypes
47 |
48 |
49 | CFBundleTypeRole
50 | Editor
51 | CFBundleURLName
52 | $(PRODUCT_BUNDLE_IDENTIFIER)
53 | CFBundleURLSchemes
54 |
55 | msauth.com.microsoft.O365-iOS-Microsoft-Graph-Connect
56 |
57 |
58 |
59 | LSApplicationQueriesSchemes
60 |
61 | msauth
62 | msauthv2
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import "AppDelegate.h"
7 | #import
8 |
9 | @implementation AppDelegate
10 |
11 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
12 | {
13 | return YES;
14 | }
15 |
16 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options
17 | {
18 | return [MSALPublicClientApplication handleMSALResponse:url
19 | sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]];
20 | }
21 |
22 | @end
23 |
24 | // *********************************************************
25 | //
26 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
27 | //
28 | // Copyright (c) Microsoft Corporation
29 | // All rights reserved.
30 | //
31 | // MIT License:
32 | // Permission is hereby granted, free of charge, to any person obtaining
33 | // a copy of this software and associated documentation files (the
34 | // "Software"), to deal in the Software without restriction, including
35 | // without limitation the rights to use, copy, modify, merge, publish,
36 | // distribute, sublicense, and/or sell copies of the Software, and to
37 | // permit persons to whom the Software is furnished to do so, subject to
38 | // the following conditions:
39 | //
40 | // The above copyright notice and this permission notice shall be
41 | // included in all copies or substantial portions of the Software.
42 | //
43 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
44 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
46 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
47 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
48 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
49 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50 | //
51 | // *********************************************************
52 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/AuthenticationManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import
7 | #import
8 |
9 | @interface AuthenticationManager : NSObject
10 |
11 | @property (nonatomic, readonly) NSString *accessToken;
12 | @property (nonatomic, readonly) MSALAccount *account;
13 |
14 | - (instancetype)initWithAuthority:(MSALAuthority *)authority
15 | clientId:(NSString *)clientId
16 | error:(NSError * __autoreleasing *)error;
17 |
18 | - (void)acquireAuthTokenWithScopes:(NSArray *)scopes
19 | completion:(void(^)(BOOL success, NSError *error))completion;
20 |
21 | // Clears the ADAL token cache and the cookie cache.
22 | - (void)clearCredentials;
23 |
24 | @end
25 |
26 | // *********************************************************
27 | //
28 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
29 | //
30 | // Copyright (c) Microsoft Corporation
31 | // All rights reserved.
32 | //
33 | // MIT License:
34 | // Permission is hereby granted, free of charge, to any person obtaining
35 | // a copy of this software and associated documentation files (the
36 | // "Software"), to deal in the Software without restriction, including
37 | // without limitation the rights to use, copy, modify, merge, publish,
38 | // distribute, sublicense, and/or sell copies of the Software, and to
39 | // permit persons to whom the Software is furnished to do so, subject to
40 | // the following conditions:
41 | //
42 | // The above copyright notice and this permission notice shall be
43 | // included in all copies or substantial portions of the Software.
44 | //
45 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
46 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
47 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
48 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
49 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
50 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
51 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 | //
53 | // *********************************************************
54 |
--------------------------------------------------------------------------------
/README-Localized/README-zh-cn.md:
--------------------------------------------------------------------------------
1 | # 使用 Microsoft Graph 的 iOS Office 365 Connect 示例
2 |
3 | 连接到 Office 365 是每个 iOS 应用开始使用 Office 365 服务和数据必须采取的第一步。该示例演示如何通过 Microsoft Graph(旧称 Office 365 统一 API)连接并调用一个 API。
4 |
5 | > 注意: 尝试 [Office 365 API 入门](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup)页面,其简化了注册,使您可以更快地运行该示例。
6 |
7 | ## 先决条件
8 | * Apple [Xcode](https://developer.apple.com/xcode/downloads/)
9 | * 安装 [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 成为依存关系管理器。
10 | * Office 365 帐户。您可以注册 [Office 365 开发人员订阅](https://aka.ms/devprogramsignup),其中包含您开始构建 Office 365 应用所需的资源。
11 |
12 | > 注意: 如果您已经订阅,之前的链接会将您转至包含以下信息的页面:*抱歉,您无法将其添加到当前帐户*。在这种情况下,请使用当前 Office 365 订阅中的帐户。
13 | * 用于注册您的应用程序的 Microsoft Azure 租户。Azure Active Directory (AD) 为应用程序提供了用于进行身份验证和授权的标识服务。您还可在此处获得试用订阅: [Microsoft Azure](https://account.windowsazure.com/SignUp)。
14 |
15 | > 重要说明: 您还需要确保您的 Azure 订阅已绑定到 Office 365 租户。要执行这一操作,请参阅 Active Directory 团队的博客文章:[创建和管理多个 Microsoft Azure Active Directory](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx)。**添加新目录**一节将介绍如何执行此操作。您还可以参阅[设置 Office 365 开发环境](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription)和**关联您的 Office 365 帐户和 Azure AD 以创建并管理应用**一节获取详细信息。
16 |
17 | * 在 Azure 中注册的应用程序的客户端 id 和重定向 uri 值。必须向该示例应用程序授予**以用户身份发送邮件**权限以使用 **Microsoft Graph**。要创建注册,请参阅[使用 Azure AD 手动注册应用并使其能够访问 Office 365 API](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually) 中的**使用 Azure 管理门户注册本机应用程序**和示例 wiki 中的[授予适当权限](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure)向其授予适当的权限。
18 |
19 |
20 |
21 | ## 在 Xcode 中运行该示例
22 |
23 | 1. 克隆该存储库
24 | 2. 使用 CocoaPods 导入 Active Directory Authentication Library (ADAL) iOS 依存关系:
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | 该示例应用已经包含了可将 ADAL 组件 (pod) 导入到项目中的 pod 文件。只需从**终端**中导航到该项目并运行:
29 |
30 | pod install
31 |
32 | 更多详细信息,请参阅[其他资源](#AdditionalResources)中的**使用 CocoaPods**
33 |
34 | 3. 打开 **O365-iOS-Microsoft-Graph-Connect.xcworkspace**
35 | 4. 打开 **ConnectViewController.m**。您会发现,**ClientID** 和 **RedirectUri** 值可以添加到文件的顶部。在此提供必须值:
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > 注意: 如果您没有 CLIENT_ID 和 REDIRECT_URI 值,请[在 Azure 中添加本机客户端应用程序](https://msdn.microsoft.com/zh-cn/library/azure/dn132599.aspx#BKMK_Adding)并记录 CLIENT_ID 和 REDIRECT_URI。
44 |
45 | 5. 运行示例。
46 |
47 | 要了解有关该示例的详细信息,请参阅[在 iOS 应用中调用 Microsoft Graph](https://graph.microsoft.io/zh-cn/docs/platform/ios)。
48 |
49 | ## 问题和意见
50 |
51 | 我们乐意倾听您有关 Office 365 iOS Microsoft Graph Connect 项目的反馈。您可以在该存储库中的[问题](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues)部分将问题和建议发送给我们。
52 |
53 | 与 Office 365 开发相关的问题一般应发布在[堆栈溢出](http://stackoverflow.com/questions/tagged/Office365+API)中。确保您的问题或意见使用了 [Office365] 和 [MicrosoftGraph] 标记。
54 |
55 | ## 贡献
56 | 您需要在提交拉取请求之前签署[参与者许可协议](https://cla.microsoft.com/)。要完成参与者许可协议 (CLA),您需要通过表格提交请求,并在收到包含文件链接的电子邮件时在 CLA 上提交电子签名。
57 |
58 |
59 | ## 其他资源
60 |
61 | * [Office 开发人员中心](http://dev.office.com/)
62 | * [Microsoft Graph 概述页](https://graph.microsoft.io)
63 | * [使用 CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## 版权所有
66 | 版权所有 (c) 2015 Microsoft。保留所有权利。
67 |
--------------------------------------------------------------------------------
/README-Localized/README-zh-tw.md:
--------------------------------------------------------------------------------
1 | # 使用 Microsoft Graph 的 Office 365 Connect 範例 (適用於 iOS)
2 |
3 | 連接到 Office 365 是每個 iOS 應用程式要開始使用 Office 365 服務和資料時必須採取的第一個步驟。此範例示範如何透過 Microsoft Graph (之前稱為 Office 365 統一 API) 連接而後呼叫一個 API。
4 |
5 | > 注意事項: 嘗試可簡化註冊的 [Office 365 API 入門](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup)頁面,以便您更快速地執行這個範例。
6 |
7 | ## 必要條件
8 | * 來自 Apple 的 [Xcode](https://developer.apple.com/xcode/downloads/)
9 | * 安裝 [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 做為相依性管理員。
10 | * Office 365 帳戶。您可以註冊 [Office 365 開發人員訂用帳戶](https://aka.ms/devprogramsignup),其中包含開始建置 Office 365 應用程式所需的資源。
11 |
12 | > 注意事項: 如果您已有訂用帳戶,則先前的連結會讓您連到顯示「抱歉,您無法將之新增到您目前的帳戶」訊息的頁面。在此情況下,請使用您目前的 Office 365 訂用帳戶所提供的帳戶。
13 | * 用來註冊您的應用程式的 Microsoft Azure 租用戶。Azure Active Directory (AD) 會提供識別服務,以便應用程式用於驗證和授權。在這裡可以取得試用版的訂用帳戶: [Microsoft Azure](https://account.windowsazure.com/SignUp)。
14 |
15 | > 重要事項: 您還需要確定您的 Azure 訂用帳戶已繫結至您的 Office 365 租用戶。若要執行這項操作,請參閱 Active Directory 小組的部落格文章:[建立和管理多個 Windows Azure Active Directory](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx)。**新增目錄**一節將說明如何執行這項操作。如需詳細資訊,也可以參閱[設定 Office 365 開發環境](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription)和**建立 Office 365 帳戶與 Azure AD 的關聯以便建立和管理應用程式**一節。
16 |
17 | * 在 Azure 中註冊之應用程式的用戶端識別碼和重新導向 URI 值。此範例應用程式必須取得 **Microsoft Graph** 的 [以使用者身分傳送郵件] 權限。若要建立註冊,請參閱[向 Azure AD 手動註冊您的應用程式以便存取 Office 365 API](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually) 中的**在 Azure 管理入口網站中註冊您的原生應用程式**以及範例 wiki 中的[授與適當的權限](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure),將適當的權限套用至應用程式。
18 |
19 |
20 |
21 | ## 在 Xcode 中執行這個範例
22 |
23 | 1. 複製此儲存機制
24 | 2. 使用 CocoaPods 來匯入 Active Directory Authentication Library (ADAL) iOS 相依性:
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | 此範例應用程式已經包含可將 ADAL 元件 (pods) 放入專案的 podfile。只需從 **Terminal** 瀏覽至專案並執行:
29 |
30 | pod install
31 |
32 | 如需詳細資訊,請參閱[其他資訊](#AdditionalResources)中的**使用 CocoaPods**
33 |
34 | 3. 開啟 **O365-iOS-Microsoft-Graph-Connect.xcworkspace**
35 | 4. 開啟 **ConnectViewController.m**。您會發現 **ClientID** 和 **RedirectUri** 值可以新增至檔案的頂端。在此提供必要的值:
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > 注意事項: 如果您沒有 CLIENT_ID 和 REDIRECT_URI 值,請[在 Azure 中新增原生用戶端應用程式](https://msdn.microsoft.com/zh-tw/library/azure/dn132599.aspx#BKMK_Adding)並記下 CLIENT_ID 和 REDIRECT_URI。
44 |
45 | 5. 執行範例。
46 |
47 | 若要深入了解此範例,請參閱[在 iOS 應用程式中呼叫 Microsoft Graph](https://graph.microsoft.io/en-us/docs/platform/ios)。
48 |
49 | ## 問題與意見
50 |
51 | 我們很樂於收到您對於 Office 365 iOS Microsoft Graph Connect 專案的意見反應。您可以在此儲存機制的[問題](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues)區段中,將您的問題及建議傳送給我們。
52 |
53 | 請在 [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API) 提出有關 Office 365 開發的一般問題。務必以 [Office365] 和 [MicrosoftGraph] 標記您的問題或意見。
54 |
55 | ## 投稿
56 | 您必須在提交您的提取要求之前,先簽署[投稿者授權合約](https://cla.microsoft.com/)。若要完成投稿者授權合約 (CLA),您必須透過表單提交要求,然後在您收到含有文件連結的電子郵件時以電子方式簽署 CLA。
57 |
58 |
59 | ## 其他資源
60 |
61 | * [Office 開發中心](http://dev.office.com/)
62 | * [Microsoft Graph 概觀頁面](https://graph.microsoft.io)
63 | * [使用 CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## 著作權
66 | Copyright (c) 2015 Microsoft.著作權所有,並保留一切權利。
67 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect.xcodeproj/xcshareddata/xcschemes/O365-iOS-Microsoft-Graph-Connect.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/README-Localized/README-ja-jp.md:
--------------------------------------------------------------------------------
1 | # Microsoft Graph を使った iOS 用 Office 365 Connect サンプル
2 |
3 | 各 iOS アプリで Office 365 のサービスとデータの操作を開始するため、最初に Office 365 に接続する必要があります。このサンプルでは、Microsoft Graph (以前は Office 365 統合 API と呼ばれていた) を介して、1 つの API に接続して呼び出す方法を示します。
4 |
5 | > メモ: このサンプルをより迅速に実行するため、「[Office 365 API を使う](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup)」ページに記載された登録の簡略化をお試しください。
6 |
7 | ## 前提条件
8 | * Apple 社の [Xcode](https://developer.apple.com/xcode/downloads/)
9 | * 依存関係マネージャーとしての [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) のインストール。
10 | * Office 365 アカウント。Office 365 アプリのビルドを開始するために必要なリソースを含む [Office 365 Developer サブスクリプション](https://aka.ms/devprogramsignup)にサインアップできます。
11 |
12 | > メモ: サブスクリプションをすでにお持ちの場合、上記のリンクをクリックすると、「*申し訳ございません。現在のアカウントに追加できません*」というメッセージが表示されるページに移動します。その場合は、現在使っている Office 365 サブスクリプションのアカウントをご利用いただけます。
13 | * アプリケーションを登録する Microsoft Azure テナント。Azure Active Directory (AD) は、アプリケーションでの認証と承認に使う ID サービスを提供します。ここでは、試用版サブスクリプションを取得できます。 [Microsoft Azure](https://account.windowsazure.com/SignUp)。
14 |
15 | > 重要: Azure サブスクリプションが Office 365 テナントにバインドされていることを確認する必要もあります。確認する方法については、Active Directory チームのブログ投稿「[複数の Windows Azure Active Directory を作成して管理する](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx)」をご覧ください。「**新しいディレクトリを追加する**」セクションで、この方法を説明しています。また、詳しくは、「[Office 365 開発環境のセットアップ](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription)」と「**Office 365 アカウントを Azure AD と関連付けて、アプリを作成して管理する**」のセクションをご覧ください。
16 |
17 | * Azure に登録されたアプリケーションのクライアント ID とリダイレクト URI の値。このサンプル アプリケーションには、**Microsoft Graph** の**ユーザーとしてメールを送信する**アクセス許可を付与する必要があります。登録を作成するには、「[Office 365 API にアクセスできるようにアプリを Azure AD に手動で登録する](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually)」の「**Azure 管理ポータルにネイティブ アプリを登録する**」と、適切なアクセス許可を付与するためのサンプル Wiki の「[適切なアクセス許可を付与する](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure)」をご覧ください。
18 |
19 |
20 |
21 | ## Xcode でこのサンプルを実行する
22 |
23 | 1. このリポジトリの複製を作成する
24 | 2. CocoaPods を使って、Active Directory 認証ライブラリ (ADAL) iOS の依存関係をインポートします。
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | このサンプル アプリには、プロジェクトに ADAL コンポーネント (pods) を取り込む podfile がすでに含まれています。**ターミナル**からプロジェクトに移動して次を実行するだけです。
29 |
30 | pod install
31 |
32 | 詳しくは、[その他の技術情報](#AdditionalResources)の「**CocoaPods を使う**」をご覧ください。
33 |
34 | 3. **O365-iOS-Microsoft-Graph-Connect.xcworkspace** を開きます。
35 | 4. **ConnectViewController.m** を開きます。**ClientID** と **RedirectUri** の各値がファイルの一番上に追加されていることが分かります。ここで必要な値を指定します。
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > メモ: CLIENT_ID と REDIRECT_URI の値がない場合は、[ネイティブ クライアント アプリケーションを Azure に追加](https://msdn.microsoft.com/ja-jp/library/azure/dn132599.aspx#BKMK_Adding)し、CLIENT_ID と REDIRECT_URI を書き留めます。
44 |
45 | 5. サンプルを実行します。
46 |
47 | サンプルについて詳しくは、「[iOS アプリで Microsoft Graph を呼び出す](https://graph.microsoft.io/ja-jp/docs/platform/ios)」をご覧ください。
48 |
49 | ## 質問とコメント
50 |
51 | Office 365 iOS Microsoft Graph Connect プロジェクトに関するフィードバックをお寄せください。質問や提案につきましては、このリポジトリの「[問題](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues)」セクションで送信できます。
52 |
53 | Office 365 開発全般の質問につきましては、「[スタック オーバーフロー](http://stackoverflow.com/questions/tagged/Office365+API)」に投稿してください。質問やコメントには、必ず [Office365] と [MicrosoftGraph] のタグを付けてください。
54 |
55 | ## 投稿
56 | プル要求を送信する前に、[投稿者のライセンス契約](https://cla.microsoft.com/)に署名する必要があります。投稿者のライセンス契約 (CLA) を完了するには、ドキュメントへのリンクを含む電子メールを受信した際に、フォームから要求を送信し、CLA に電子的に署名する必要があります。
57 |
58 |
59 | ## その他の技術情報
60 |
61 | * [Office デベロッパー センター](http://dev.office.com/)
62 | * [Microsoft Graph の概要ページ](https://graph.microsoft.io)
63 | * [CocoaPods を使う](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## 著作権
66 | Copyright (c) 2015 Microsoft.All rights reserved.
67 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Office 365 Connect Sample for iOS Using Microsoft Graph
2 |
3 | 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).
4 |
5 |
6 | ## Prerequisites
7 | * [Xcode](https://developer.apple.com/xcode/downloads/) from Apple
8 | * An Office 365 account. You can sign up for [an Office 365 Developer subscription](https://aka.ms/devprogramsignup) that includes the resources that you need to start building Office 365 apps.
9 |
10 | > 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.
11 | * 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](https://account.windowsazure.com/SignUp).
12 |
13 | > 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](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). The section **Adding a new directory** will explain how to do this. You can also see [Set up your Office 365 development environment](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) and the section **Associate your Office 365 account with Azure AD to create and manage apps** for more information.
14 |
15 | * 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](https://github.com/microsoftgraph/ios-objectivec-connect-rest-sample/wiki/Grant-permissions-to-the-Connect-application-in-Azure).
16 |
17 |
18 |
19 | ## Running this sample in Xcode
20 |
21 | 1. Clone this repository
22 | 2. Use [Carthage](https://github.com/Carthage/Carthage) to import the Microsoft Authenticaion Library (MSAL) iOS dependency. Download the latest version of Carthage [here](https://github.com/Carthage/Carthage/releases).
23 | 3. Open **O365-iOS-Microsoft-Graph-Connect.xcodeproj**
24 | 4. Open **info.plist**. You'll see that the **ClientID** (application id you received from the registration process in the prerequisites section) goes here.
25 | ```xml
26 | CFBundleURLTypes
27 |
28 |
29 | CFBundleTypeRole
30 | Editor
31 | CFBundleURLName
32 | $(PRODUCT_BUNDLE_IDENTIFIER)
33 | CFBundleURLSchemes
34 |
35 | msalENTER_YOUR_CLIENT_ID
36 | auth
37 |
38 |
39 |
40 |
41 | ```
42 |
43 |
44 | ## Build the MSAL framework
45 |
46 | The preview version of MSAL is distributed as source code using Carthage. To build the source code, do these steps:
47 |
48 | 1. Open the Bash terminal and go to the app root folder.
49 | 2. Create a **cartfile**: Copy `echo "github \"AzureAD/microsoft-authentication-library-for-objc\" \"master\"" > Cartfile` into the terminal and run the command.
50 | 3. Build the MSAL library: Copy `carthage update` into the terminal and run the command.
51 |
52 | 5. Run the sample.
53 |
54 | To learn more about the sample, see [Call Microsoft Graph in an iOS App](https://graph.microsoft.io/en-us/docs/platform/ios).
55 |
56 | ## Questions and comments
57 |
58 | 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](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues) section of this repository.
59 |
60 | Questions about Office 365 development in general should be posted to [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Make sure that your questions or comments are tagged with [Office365] and [MicrosoftGraph].
61 |
62 | ## Contributing
63 | You will need to sign a [Contributor License Agreement](https://cla.microsoft.com/) 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.
64 |
65 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
66 |
67 | ## Additional resources
68 |
69 | * [Office Dev Center](http://dev.office.com/)
70 | * [Microsoft Graph overview page](https://graph.microsoft.io)
71 | * [Using CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
72 |
73 | ## Copyright
74 | Copyright (c) 2017 Microsoft. All rights reserved.
75 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/ConnectViewController.m:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import "ConnectViewController.h"
7 | #import "SendMailViewController.h"
8 | #import "AuthenticationManager.h"
9 | #import
10 |
11 | // Set your application's clientId.
12 | NSString *const kClientId = @"YOUR CLIENT ID";
13 | NSString *const kAuthority = @"https://login.microsoftonline.com/common";
14 |
15 | @interface ConnectViewController()
16 |
17 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;
18 | @property (weak, nonatomic) IBOutlet UIButton *connectButton;
19 | @property (nonatomic) AuthenticationManager *authManager;
20 |
21 | @end
22 |
23 | @implementation ConnectViewController
24 |
25 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
26 | {
27 | if ([segue.identifier isEqualToString:@"showSendMail"])
28 | {
29 | SendMailViewController *sendMailViewController = segue.destinationViewController;
30 | sendMailViewController.authManager = self.authManager;
31 | }
32 | }
33 |
34 | #pragma mark - IBAction
35 |
36 | - (IBAction)connectTapped:(id)sender
37 | {
38 | [self processConnect];
39 | }
40 |
41 | #pragma mark - Private
42 |
43 | - (void)processConnect
44 | {
45 | __auto_type scopes = @[@"https://graph.microsoft.com/Mail.ReadWrite",
46 | @"https://graph.microsoft.com/Mail.Send",
47 | @"https://graph.microsoft.com/Files.ReadWrite",
48 | @"https://graph.microsoft.com/User.ReadBasic.All"];
49 |
50 | [self showLoadingUI:YES];
51 | [self.authManager acquireAuthTokenWithScopes:scopes completion:^(BOOL success, NSError *error) {
52 | dispatch_async(dispatch_get_main_queue(), ^{
53 | [self showLoadingUI:NO];
54 |
55 | if (error) {
56 | [self showError:error];
57 | return;
58 | }
59 |
60 | NSLog(@"%@", self.authManager.account.username);
61 | [self performSegueWithIdentifier:@"showSendMail" sender:nil];
62 | });
63 | }];
64 | }
65 |
66 | - (AuthenticationManager *)authManager
67 | {
68 | if (!_authManager) {
69 | NSURL *authorityUrl = [[NSURL alloc] initWithString:kAuthority];
70 | assert(authorityUrl);
71 | __auto_type authority = [[MSALAADAuthority alloc] initWithURL:authorityUrl error:nil];
72 | assert(authority);
73 |
74 | NSAssert(![kClientId isEqualToString:@"YOUR CLIENT ID"], @"ConnectViewController: Provide your client id first!");
75 |
76 | NSError *error;
77 | _authManager = [[AuthenticationManager alloc] initWithAuthority:authority clientId:kClientId error:&error];
78 |
79 | if (error) [self showError:error];
80 | }
81 |
82 | return _authManager;
83 | }
84 |
85 | - (void)showLoadingUI:(BOOL)loading
86 | {
87 | if (loading) {
88 | [self.activityIndicator startAnimating];
89 | [self.connectButton setTitle:@"Connecting..." forState:UIControlStateNormal];
90 | self.connectButton.enabled = NO;
91 | } else {
92 | [self.activityIndicator stopAnimating];
93 | [self.connectButton setTitle:@"Connect to Office 365" forState:UIControlStateNormal];
94 | self.connectButton.enabled = YES;
95 | }
96 | }
97 |
98 | - (void)showError:(NSError *)error
99 | {
100 | NSLog(@"Error: %@", error);
101 |
102 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Error"
103 | message:@"Please see the log for more details"
104 | preferredStyle:UIAlertControllerStyleAlert];
105 | [alert addAction:[UIAlertAction actionWithTitle:@"Close"
106 | style:UIAlertActionStyleDefault handler:nil]];
107 |
108 | [self presentViewController:alert animated:YES completion:nil];
109 | }
110 |
111 | @end
112 |
113 | // *********************************************************
114 | //
115 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
116 | //
117 | // Copyright (c) Microsoft Corporation
118 | // All rights reserved.
119 | //
120 | // MIT License:
121 | // Permission is hereby granted, free of charge, to any person obtaining
122 | // a copy of this software and associated documentation files (the
123 | // "Software"), to deal in the Software without restriction, including
124 | // without limitation the rights to use, copy, modify, merge, publish,
125 | // distribute, sublicense, and/or sell copies of the Software, and to
126 | // permit persons to whom the Software is furnished to do so, subject to
127 | // the following conditions:
128 | //
129 | // The above copyright notice and this permission notice shall be
130 | // included in all copies or substantial portions of the Software.
131 | //
132 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
133 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
134 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
135 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
136 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
137 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
138 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
139 | //
140 | // *********************************************************
141 |
142 |
--------------------------------------------------------------------------------
/README-Localized/README-pt-br.md:
--------------------------------------------------------------------------------
1 | # Exemplo de conexão com o Office 365 para iOS usando o Microsoft Graph
2 |
3 | A primeira etapa para que os aplicativos iOS comecem a funcionar com dados e serviços do Office 365 é estabelecer uma conexão com essa plataforma. Este exemplo mostra como se conectar e chamar uma única API do Microsoft Graph (antiga API unificada do Office 365).
4 |
5 | > Observação: experimente a página [Introdução às APIs do Office 365](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup), que simplifica o registro para que você possa executar esse exemplo com mais rapidez.
6 |
7 | ## Pré-requisitos
8 | * [Xcode](https://developer.apple.com/xcode/downloads/) da Apple
9 | * A instalação de [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) como um gerenciador de dependências.
10 | * Uma conta do Office 365. Inscreva-se para uma [Assinatura de Desenvolvedor do Office 365](https://aka.ms/devprogramsignup), que inclui os recursos necessários para começar a criação de aplicativos do Office 365.
11 |
12 | > Observação: caso já tenha uma assinatura, o link anterior direciona você para uma página com a mensagem *Não é possível adicioná-la à sua conta atual*. Nesse caso, use uma conta de sua assinatura atual do Office 365.
13 | * Um locatário do Microsoft Azure para registrar o seu aplicativo. O Active Directory (AD) do Azure fornece serviços de identidade que os aplicativos usam para autenticação e autorização. Você pode adquirir uma assinatura de avaliação aqui: [Microsoft Azure](https://account.windowsazure.com/SignUp).
14 |
15 | > Importante: você também deve assegurar que a assinatura do Azure esteja vinculada ao locatário do Office 365. Para saber como fazer isso, confira a postagem de blog da equipe do Active Directory, [Criando e gerenciando vários Active Directories do Microsoft Azure](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). A seção **Adicionando um novo diretório** explica como fazer isso. Para saber mais, confira o artigo [Configurar o ambiente de desenvolvimento do Office 365](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) e a seção **Associar uma conta do Office 365 ao AD do Azure para criar e gerenciar aplicativos**.
16 |
17 | * Valores de uma ID do cliente e de um URI de redirecionamento de um aplicativo registrado no Azure. Esse exemplo de aplicativo deve ter a permissão **Enviar email como usuário** concedida para o **Microsoft Graph**. Para criar o registro, confira o tópico **Registrar o aplicativo nativo com o Portal de Gerenciamento do Azure**, no artigo [Registrar o aplicativo manualmente com o AD do Azure para que ele possa acessar as APIs do Office 365](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually) e [conceda as permissões adequadas](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure) no exemplo de wiki para aplicá-las no registro.
18 |
19 |
20 |
21 | ## Executando esse exemplo no Xcode
22 |
23 | 1. Clonar esse repositório
24 | 2. Use o CocoaPods para importar a dependência de iOS da ADAL (Biblioteca de Autenticação do Active Directory):
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | Este exemplo de aplicativo já contém um podfile que receberá os componentes ADAL (pods) no projeto. Basta navegar para o projeto a partir do **Terminal** e executar:
29 |
30 | pod install
31 |
32 | Para saber mais, confira o artigo **Usando o CocoaPods** em [Recursos adicionais](#AdditionalResources)
33 |
34 | 3. Abra **O365-iOS-Microsoft-Graph-Connect.xcworkspace**
35 | 4. Abra **ConnectViewController.m**. Observe que você pode adicionar os valores de **ClientID** e **RedirectUri** na parte superior do arquivo. Forneça os valores necessários aqui:
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > Observação: caso não tenha os valores CLIENT_ID e REDIRECT_URI, [adicione um aplicativo cliente nativo no Azure](https://msdn.microsoft.com/pt-br/library/azure/dn132599.aspx#BKMK_Adding) e anote os valores do CLIENT_ID e do REDIRECT_URI.
44 |
45 | 5. Execute o exemplo.
46 |
47 | Para saber mais sobre o exemplo, confira o artigo [Chamar o Microsoft Graph em um aplicativo iOS](https://graph.microsoft.io/pt-br/docs/platform/ios).
48 |
49 | ## Perguntas e comentários
50 |
51 | Gostaríamos de saber sua opinião sobre o projeto de conexão com o Office 365 para iOS usando o Microsoft Graph. Você pode enviar perguntas e sugestões na seção [Problemas](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues) deste repositório.
52 |
53 | Faça a postagem de perguntas sobre desenvolvimento do Office 365 em geral na página do [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Não deixe de marcar as perguntas ou comentários com [Office365] e [MicrosoftGraph].
54 |
55 | ## Colaboração
56 | Assine o [Contributor License Agreement (Contrato de Licença de Colaborador)](https://cla.microsoft.com/) antes de enviar a solicitação pull. Para concluir o CLA (Contributor License Agreement), você deve enviar uma solicitação através do formulário e assinar eletronicamente o CLA quando receber o email com o link para o documento.
57 |
58 |
59 | ## Recursos adicionais
60 |
61 | * [Centro de Desenvolvimento do Office](http://dev.office.com/)
62 | * [Página de visão geral do Microsoft Graph](https://graph.microsoft.io)
63 | * [Usando o CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## Direitos autorais
66 | Copyright © 2015 Microsoft. Todos os direitos reservados.
67 |
--------------------------------------------------------------------------------
/README-Localized/README-es-es.md:
--------------------------------------------------------------------------------
1 | # Ejemplo Connect de Office 365 para iOS con Microsoft Graph
2 |
3 | Conectarse a Office 365 es el primer paso que debe realizar cada aplicación iOS para empezar a trabajar con los datos y servicios de Office 365. Este ejemplo muestra cómo conectar y cómo llamar después a una API a través de Microsoft Graph (anteriormente denominada API unificada de Office 365).
4 |
5 | > Nota: Consulte [Introducción a las API de Office 365](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup), que simplifica el registro para que este ejemplo se ejecute más rápidamente.
6 |
7 | ## Requisitos previos
8 | * [Xcode](https://developer.apple.com/xcode/downloads/) de Apple
9 | * Instalación de [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) como administrador de dependencias.
10 | * Una cuenta de Office 365. Puede registrarse en [una suscripción a Office 365 Developer](https://aka.ms/devprogramsignup), que incluye los recursos que necesita para comenzar a crear aplicaciones de Office 365.
11 |
12 | > Nota: Si ya dispone de una suscripción, el vínculo anterior le dirige a una página con el mensaje *No se puede agregar a su cuenta actual*. En ese caso, use una cuenta de su suscripción actual a Office 365.
13 | * Un inquilino de Microsoft Azure para registrar la aplicación. Azure Active Directory (AD) proporciona servicios de identidad que las aplicaciones usan para autenticación y autorización. Puede adquirir una suscripción de prueba aquí: [Microsoft Azure](https://account.windowsazure.com/SignUp).
14 |
15 | > Importante: También necesitará asegurarse de que su suscripción a Azure esté enlazada a su inquilino de Office 365. Para ello, consulte la publicación del blog del equipo de Active Directory, [Crear y administrar varios directorios de Windows Azure Active Directory](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). La sección **Agregar un nuevo directorio** le explicará cómo hacerlo. Para obtener más información, también puede consultar [Configurar el entorno de desarrollo de Office 365](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) y la sección **Asociar su cuenta de Office 365 con Azure AD para crear y administrar aplicaciones**.
16 |
17 | * Los valores de identificador de cliente y URI de redireccionamiento de una aplicación registrada en Azure. A esta aplicación de ejemplo se le debe conceder el permiso **Enviar correo como usuario** para **Microsoft Graph**. Para crear el registro, consulte **Registrar la aplicación nativa con el Portal de administración de Azure** en [Registrar manualmente la aplicación con Azure AD para que pueda acceder a las API de Office 365](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually) y [conceder permisos adecuados](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure) en la wiki de ejemplo para aplicarle los permisos adecuados.
18 |
19 |
20 |
21 | ## Ejecutar este ejemplo en Xcode
22 |
23 | 1. Clone este repositorio.
24 | 2. Use CocoaPods para importar la dependencia iOS de la biblioteca de autenticación de Active Directory (ADAL):
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | Esta aplicación de ejemplo ya contiene un podfile que recibirá los componentes ADAL (pods) en el proyecto. Simplemente vaya al proyecto desde **Terminal** y ejecute:
29 |
30 | pod install
31 |
32 | Para obtener más información, consulte **Usar CocoaPods** en [Recursos adicionales](#AdditionalResources)
33 |
34 | 3. Abra **O365-iOS-Microsoft-Graph-Connect.xcworkspace**.
35 | 4. Abra **ConnectViewController.m**. Verá que los valores **ClientID** y **RedirectUri** pueden agregarse en la parte superior del archivo. Proporcione los valores necesarios aquí:
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > Nota: Si no dispone de los valores CLIENT_ID y REDIRECT_URI, [agregue una aplicación de cliente nativa en Azure](https://msdn.microsoft.com/es-es/library/azure/dn132599.aspx#BKMK_Adding) y anote los valores CLIENT_ID y REDIRECT_URI.
44 |
45 | 5. Ejecute el ejemplo.
46 |
47 | Para obtener más información acerca del ejemplo, consulte [Llamar a Microsoft Graph en una aplicación iOS](https://graph.microsoft.io/es-es/docs/platform/ios).
48 |
49 | ## Preguntas y comentarios
50 |
51 | Nos encantaría recibir sus comentarios sobre el proyecto Connect de Office 365 para iOS con Microsoft Graph. Puede enviarnos sus preguntas y sugerencias a través de la sección [Problemas](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues) de este repositorio.
52 |
53 | Las preguntas generales sobre desarrollo en Office 365 deben publicarse en [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Asegúrese de que sus preguntas o comentarios se etiquetan con [Office365] y [MicrosoftGraph].
54 |
55 | ## Colaboradores
56 | Deberá firmar un [Contrato de licencia de colaborador](https://cla.microsoft.com/) antes de enviar la solicitud de incorporación de cambios. Para completar el Contrato de licencia de colaborador (CLA), deberá enviar una solicitud mediante el formulario y, a continuación, firmar electrónicamente el CLA cuando reciba el correo electrónico que contiene el vínculo al documento.
57 |
58 |
59 | ## Recursos adicionales
60 |
61 | * [Centro para desarrolladores de Office](http://dev.office.com/)
62 | * [Página de información general de Microsoft Graph](https://graph.microsoft.io)
63 | * [Usar CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## Copyright
66 | Copyright (c) 2015 Microsoft. Todos los derechos reservados.
67 |
--------------------------------------------------------------------------------
/README-Localized/README-ru-ru.md:
--------------------------------------------------------------------------------
1 | # Пример приложения iOS, подключающегося к Office 365 и использующего Microsoft Graph
2 |
3 | Подключение к Office 365 — это первый шаг, который должно выполнить каждое приложение iOS, чтобы начать работу со службами и данными Office 365. В этом примере показано, как подключить, а затем вызвать один API с помощью Microsoft Graph (прежнее название — единый API Office 365).
4 |
5 | > Примечание. Перейдите на страницу [Начало работы с API Office 365](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup) для упрощенной регистрации, чтобы ускорить запуск этого примера.
6 |
7 | ## Предварительные требования
8 | * [Xcode](https://developer.apple.com/xcode/downloads/) от Apple.
9 | * Установка [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) в качестве диспетчера зависимостей.
10 | * Учетная запись Office 365. Вы можете [подписаться на план Office 365 для разработчиков](https://aka.ms/devprogramsignup), включающий ресурсы, которые необходимы для создания приложений Office 365.
11 |
12 | > Примечание. Если у вас уже есть подписка, при выборе приведенной выше ссылки откроется страница с сообщением *К сожалению, вы не можете добавить это к своей учетной записи*. В этом случае используйте учетную запись, сопоставленную с текущей подпиской на Office 365.
13 | * Клиент Microsoft Azure для регистрации приложения. В Azure Active Directory (AD) доступны службы идентификации, которые приложения используют для проверки подлинности и авторизации. Здесь можно получить пробную подписку: [Microsoft Azure](https://account.windowsazure.com/SignUp).
14 |
15 | > Внимание! Убедитесь, что ваша подписка на Azure привязана к клиенту Office 365. Для этого просмотрите запись в блоге команды Active Directory, посвященную [созданию нескольких каталогов Microsoft Azure AD и управлению ими](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). Инструкции приведены в разделе о **добавлении нового каталога**. Дополнительные сведения см. в статье [Как настроить среду разработки для Office 365](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) и, в частности, в разделе **Связывание Azure AD и учетной записи Office 365 для создания приложений и управления ими**.
16 |
17 | * Универсальный код ресурса (URI) для перенаправления и идентификатор клиента, указанные при регистрации приложения в Azure. Этому приложению необходимо предоставить разрешение **Отправка почты от имени пользователя** для **Microsoft Graph**. Указания по регистрации см. в разделе **Регистрация основного приложения на портале управления Azure** статьи [Регистрация приложения в Azure AD вручную, чтобы оно могло получить доступ к API Office 365](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually). Кроме того, см. инструкции по [предоставлению необходимых разрешений](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure) на соответствующей вкладке вики-статьи.
18 |
19 |
20 |
21 | ## Запуск этого примера в Xcode
22 |
23 | 1. Клонируйте этот репозиторий.
24 | 2. С помощью CocoaPods импортируйте зависимость iOS из библиотеки ADAL:
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | Этот пример приложения уже содержит компонент podfile, который добавит компоненты ADAL (pod) в проект. Просто перейдите к проекту из раздела **Терминал** и выполните следующую команду:
29 |
30 | pod install
31 |
32 | Для получения дополнительных сведений выберите ссылку **Использование CocoaPods** в разделе [Дополнительные ресурсы](#AdditionalResources).
33 |
34 | 3. Откройте **O365-iOS-Microsoft-Graph-Connect.xcworkspace**.
35 | 4. Откройте файл **ConnectViewController.m**. Вы увидите, что значения **ClientID** и **RedirectUri** можно добавить в верхнюю часть файла. Введите здесь все необходимые значения:
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > Примечание. Если у вас нет значений CLIENT_ID и REDIRECT_URI, [добавьте основное клиентское приложение в Azure](https://msdn.microsoft.com/ru-ru/library/azure/dn132599.aspx#BKMK_Adding) и запишите CLIENT_ID и REDIRECT_URI.
44 |
45 | 5. Запустите приложение.
46 |
47 | Дополнительные сведения о приложении см. в статье [Вызов Microsoft Graph в приложении для iOS](https://graph.microsoft.io/ru-ru/docs/platform/ios).
48 |
49 | ## Вопросы и комментарии
50 |
51 | Мы будем рады получить от вас отзывы о проекте приложения iOS, подключающегося к Office 365 и использующего Microsoft Graph. Отправляйте нам свои вопросы и предложения в раздел этого репозитория, посвященный [проблемам](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues).
52 |
53 | Общие вопросы о разработке решений для Office 365 следует публиковать на сайте [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Обязательно помечайте свои вопросы и комментарии тегами [Office365] и [MicrosoftGraph].
54 |
55 | ## Участие
56 | Прежде чем отправить запрос на включение внесенных изменений, необходимо подписать [лицензионное соглашение с участником](https://cla.microsoft.com/). Чтобы заполнить лицензионное соглашение с участником (CLA), вам потребуется отправить запрос с помощью формы, а затем после получения электронного сообщения со ссылкой на этот документ подписать CLA с помощью электронной подписи.
57 |
58 |
59 | ## Дополнительные ресурсы
60 |
61 | * [Центр разработки для Office](http://dev.office.com/)
62 | * [Страница с общими сведениями о Microsoft Graph](https://graph.microsoft.io)
63 | *[Использование CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## Авторские права
66 | (c) Корпорация Майкрософт (Microsoft Corporation), 2015. Все права защищены.
67 |
--------------------------------------------------------------------------------
/README-Localized/README-fr-fr.md:
--------------------------------------------------------------------------------
1 | # Exemple de connexion d’iOS à Office 365 avec Microsoft Graph
2 |
3 | La connexion à Office 365 est la première étape que chaque application iOS doit suivre pour commencer à travailler avec les données et services Office 365. Cet exemple explique comment connecter, puis appeler une API via Microsoft Graph (anciennement appelé API unifiée Office 365).
4 |
5 | > Remarque : consultez la page relative à la [prise en main des API Office 365](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup) pour enregistrer plus facilement votre application et exécuter plus rapidement cet exemple.
6 |
7 | ## Conditions préalables
8 | * [Xcode](https://developer.apple.com/xcode/downloads/) d’Apple
9 | * Installation de [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) comme gestionnaire de dépendances.
10 | * Un compte Office 365. Vous pouvez vous inscrire à [Office 365 Developer](https://aka.ms/devprogramsignup) pour accéder aux ressources dont vous avez besoin pour commencer à créer des applications Office 365.
11 |
12 | > Remarque : si vous avez déjà un abonnement, le lien précédent vous renvoie vers une page avec le message suivant : *Désolé, vous ne pouvez pas ajouter ceci à votre compte existant*. Dans ce cas, utilisez un compte lié à votre abonnement Office 365 existant.
13 | * Un client Microsoft Azure pour enregistrer votre application. Azure Active Directory (AD) fournit des services d’identité que les applications utilisent à des fins d’authentification et d’autorisation. Un abonnement d’évaluation peut être demandé ici : [Microsoft Azure](https://account.windowsazure.com/SignUp).
14 |
15 | > Important : vous devrez également vous assurer que votre abonnement Azure est lié à votre client Office 365. Pour cela, consultez le billet du blog de l’équipe d’Active Directory relatif à la [création et la gestion de plusieurs fenêtres dans les répertoires Azure Active Directory](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). La section sur l’**ajout d’un nouveau répertoire** vous explique comment procéder. Pour en savoir plus, vous pouvez également consulter la rubrique relative à la [configuration de votre environnement de développement Office 365](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) et la section sur l’**association de votre compte Office 365 à Azure Active Directory pour créer et gérer des applications**.
16 |
17 | * Un ID client et les valeurs URI de redirection d’une application enregistrée dans Azure. Cet exemple d’application doit obtenir l’autorisation **Envoyer un courrier électronique en tant qu’utilisateur** pour **Microsoft Graph**. Pour enregistrer votre application, consultez la section sur à l’**enregistrement d’une application native avec le portail de gestion Azure** dans la rubrique relative à l’[enregistrement manuel d’une application avec Azure AD pour accéder aux API Office 365](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually) et la page relative à l’[octroi d’autorisations appropriées](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure) dans le wiki pour lui accorder les autorisations appropriées.
18 |
19 |
20 |
21 | ## Exécution de cet exemple dans Xcode
22 |
23 | 1. Cloner ce référentiel
24 | 2. Utilisez CocoaPods pour importer la dépendance iOS Active Directory Authentication Library (ADAL) :
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | Cet exemple d’application contient déjà un podfile qui recevra les composants ADAL (pods) dans le projet. Ouvrez simplement le projet à partir de **Terminal** et exécutez :
29 |
30 | pod install
31 |
32 | Pour plus d’informations, consultez **Utilisation de CocoaPods** dans [Ressources supplémentaires](#AdditionalResources)
33 |
34 | 3. Ouvrez **O365-iOS-Microsoft-Graph-Connect.xcworkspace**
35 | 4. Ouvrez **ConnectViewController.m**. Vous verrez que les valeurs **ClientID** et **RedirectUri** peuvent être ajoutées en haut du fichier. Indiquez les valeurs requises ici :
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > Remarque : si vous ne connaissez pas les valeurs de CLIENT_ID et de REDIRECT_URI, [ajoutez une application cliente native dans Azure](https://msdn.microsoft.com/fr-fr/library/azure/dn132599.aspx#BKMK_Adding) pour les noter.
44 |
45 | 5. Exécutez l’exemple.
46 |
47 | Pour en savoir plus sur cet exemple, consultez la rubrique relative à l’[appel de Microsoft Graph dans une application iOS](https://graph.microsoft.io/fr-fr/docs/platform/ios).
48 |
49 | ## Questions et commentaires
50 |
51 | Nous serions ravis de connaître votre opinion sur le projet de connexion d’iOS à Office 365 avec Microsoft Graph. Vous pouvez nous faire part de vos questions et suggestions dans la rubrique [Problèmes](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues) de ce référentiel.
52 |
53 | Si vous avez des questions sur le développement d’Office 365, envoyez-les sur [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Assurez-vous de poser vos questions ou de rédiger vos commentaires avec les tags [MicrosoftGraph] et [Office 365].
54 |
55 | ## Contribution
56 | Vous devrez signer un [Contrat de licence de contributeur](https://cla.microsoft.com/) avant d’envoyer votre requête de tirage. Pour compléter le contrat de licence de contributeur (CLA), vous devez envoyer une requête en remplissant le formulaire, puis signer électroniquement le CLA quand vous recevrez le courrier électronique contenant le lien vers le document.
57 |
58 |
59 | ## Ressources supplémentaires
60 |
61 | * [Centre de développement Office](http://dev.office.com/)
62 | * [Page de présentation de Microsoft Graph](https://graph.microsoft.io)
63 | * [Utilisation de CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## Copyright
66 | Copyright (c) 2015 Microsoft. Tous droits réservés.
67 |
--------------------------------------------------------------------------------
/README-Localized/README-de-de.md:
--------------------------------------------------------------------------------
1 | # Office 365 Connect-Beispiel für iOS unter Verwendung von Microsoft Graph
2 |
3 | Für die Arbeit mit Office 365-Diensten und -Daten muss jede iOS-App zunächst eine Verbindung zu Office 365 herstellen. In diesem Beispiel wird gezeigt, wie die Verbindung zu und dann der Aufruf einer API über Microsoft Graph (wurde zuvor als vereinheitlichte Office 365-API bezeichnet) erfolgt.
4 |
5 | > Hinweis: Rufen Sie die Seite [Erste Schritte mit Office 365-APIs](http://dev.office.com/getting-started/office365apis?platform=option-ios#setup) auf. Auf dieser wird die Registrierung vereinfacht, damit Sie dieses Beispiel schneller ausführen können.
6 |
7 | ## Voraussetzungen
8 | * [Xcode](https://developer.apple.com/xcode/downloads/) von Apple
9 | * Installation von [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) als ein Abhängigkeits-Manager.
10 | * Ein Office 365-Konto. Sie können sich für [ein Office 365-Entwicklerabonnement](https://aka.ms/devprogramsignup) registrieren. Dieses umfasst die Ressourcen, die Sie zum Erstellen von Office 365-Apps benötigen.
11 |
12 | > Hinweis: Wenn Sie bereits über ein Abonnement verfügen, gelangen Sie über den vorherigen Link zu einer Seite mit der Meldung *Leider können Sie Ihrem aktuellen Konto diesen Inhalt nicht hinzufügen*. Verwenden Sie in diesem Fall ein Konto aus Ihrem aktuellen Office 365-Abonnement.
13 | * Ein Microsoft Azure-Mandant zum Registrieren Ihrer Anwendung. Von Azure Active Directory (AD) werden Identitätsdienste bereitgestellt, die durch Anwendungen für die Authentifizierung und Autorisierung verwendet werden. Hier kann ein Testabonnement erworben werden: [Microsoft Azure](https://account.windowsazure.com/SignUp).
14 |
15 | > Wichtig: Sie müssen zudem sicherstellen, dass Ihr Azure-Abonnement an Ihren Office 365-Mandanten gebunden ist. Rufen Sie dafür den Blogpost [Creating and Managing Multiple Windows Azure Active Directories](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx) des Active Directory-Teams auf. Im Abschnitt **Adding a new directory** finden Sie Informationen über die entsprechende Vorgehensweise. Weitere Informationen finden Sie zudem unter [Einrichten Ihrer Office 365-Entwicklungsumgebung](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) im Abschnitt **Verknüpfen Ihres Office 365-Kontos mit Azure AD zum Erstellen und Verwalten von Apps**.
16 |
17 | * Eine Client-ID und Umleitungs-URI-Werte einer in Azure registrierten Anwendung. Dieser Beispielanwendung muss die Berechtigung **E-Mails unter einem anderen Benutzernamen senden** für **Microsoft Graph** gewährt werden. Informationen über das Erstellen der Registrierung finden Sie unter **Registrieren der systemeigenen App mit dem Azure-Verwaltungsportal** in [Manuelles Registrieren der App mit Azure AD, damit Sie auf Office 365-APIs zugreifen kann](https://msdn.microsoft.com/en-us/office/office365/howto/add-common-consent-manually), und [gewähren Sie die entsprechenden Berechtigungen](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/wiki/Grant-permissions-to-the-Connect-application-in-Azure) im Beispiel-Wiki, um die entsprechenden Berechtigungen darauf anzuwenden.
18 |
19 |
20 |
21 | ## Ausführen dieses Beispiels in Xcode
22 |
23 | 1. Klonen Sie dieses Repository
24 | 2. Verwenden Sie CocoaPods zum Importieren der Abhängigkeit zwischen Active Directory Authentication Library (ADAL) und iOS:
25 |
26 | pod 'ADALiOS', '= 1.2.4'
27 |
28 | Diese Beispiel-App enthält bereits eine POD-Datei, die die ADAL-Komponenten (pods) in das Projekt überträgt. Navigieren Sie einfach über das **Terminal** zum Projekt, und führen Sie Folgendes aus:
29 |
30 | pod install
31 |
32 | Weitere Informationen finden Sie im Thema über das **Verwenden von CocoaPods** in [Zusätzliche Ressourcen](#AdditionalResources).
33 |
34 | 3. Öffnen Sie **O365-iOS-Microsoft-Graph-Connect.xcworkspace**.
35 | 4. Öffnen Sie **ConnectViewController.m**. Sie können sehen, dass die Werte **ClientID** und **RedirectUri** oben in der Datei hinzugefügt werden können. Geben Sie hier die erforderlichen Werte an:
36 |
37 | // You will set your application's clientId and redirect URI.
38 | NSString * const kRedirectUri = @"ENTER_YOUR_REDIRECT_URI";
39 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID";
40 | NSString * const kAuthority = @"https://login.microsoftonline.com/common";
41 | NSString * const kResourceId = @"https://graph.microsoft.com";
42 |
43 | > Hinweis: Wenn Sie weder über „CLIENT_ID“- noch über „REDIRECT_URI“-Werte verfügen, [müssen Sie eine native Clientanwendung in Azure hinzufügen](https://msdn.microsoft.com/de-de/library/azure/dn132599.aspx#BKMK_Adding) und die Werte „CLIENT_ID“ und „REDIRECT_URI“ beachten.
44 |
45 | 5. Führen Sie das Beispiel aus.
46 |
47 | Weitere Informationen über das Beispiel finden Sie unter [Aufrufen von Microsoft Graph in einer iOS-App](https://graph.microsoft.io/de-de/docs/platform/ios).
48 |
49 | ## Fragen und Kommentare
50 |
51 | Wir schätzen Ihr Feedback hinsichtlich des Office 365 iOS Microsoft Graph Connect-Projekts. Sie können uns Ihre Fragen und Vorschläge über den Abschnitt [Probleme](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Connect/issues) dieses Repositorys senden.
52 |
53 | Allgemeine Fragen über die Office 365-Entwicklung sollten in [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API) gepostet werden. Stellen Sie sicher, dass Ihre Fragen oder Kommentare mit [Office365] und [MicrosoftGraph] markiert sind.
54 |
55 | ## Teilnahme
56 | Vor dem Senden Ihrer Pull Request müssen Sie eine [Lizenzvereinbarung für Teilnehmer](https://cla.microsoft.com/) unterschreiben. Zum Vervollständigen der Lizenzvereinbarung für Teilnehmer (Contributor License Agreement, CLA) müssen Sie eine Anforderung über das Formular senden. Nachdem Sie die E-Mail mit dem Link zum Dokument empfangen haben, müssen Sie die CLA anschließend elektronisch signieren.
57 |
58 |
59 | ## Zusätzliche Ressourcen
60 |
61 | * [Office Dev Center](http://dev.office.com/)
62 | * [Microsoft Graph-Übersichtsseite](https://graph.microsoft.io)
63 | * [Verwenden von CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)
64 |
65 | ## Copyright
66 | Copyright (c) 2015 Microsoft. Alle Rechte vorbehalten.
67 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/AuthenticationManager.m:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import
7 | #import "AuthenticationManager.h"
8 |
9 | @interface AuthenticationManager()
10 |
11 | @property (nonatomic) NSString *accessToken;
12 | @property (nonatomic) MSALPublicClientApplication *msalClient;
13 | @property (nonatomic) MSALAccount *account;
14 |
15 | @end
16 |
17 | @implementation AuthenticationManager
18 |
19 | - (instancetype)initWithAuthority:(MSALAuthority *)authority
20 | clientId:(NSString *)clientId
21 | error:(NSError **)error
22 | {
23 | self = [super init];
24 | if (self) {
25 | MSALPublicClientApplicationConfig *config = [[MSALPublicClientApplicationConfig alloc] initWithClientId:clientId];
26 | config.authority = authority;
27 |
28 | NSError *localError;
29 | _msalClient = [[MSALPublicClientApplication alloc] initWithConfiguration:config error:&localError];
30 |
31 | if (localError) {
32 | if (error) *error = localError;
33 | return nil;
34 | }
35 | }
36 |
37 | return self;
38 | }
39 |
40 | - (void)acquireAuthTokenWithScopes:(NSArray *)scopes
41 | completion:(void(^)(BOOL success, NSError *error))completion
42 | {
43 | assert(completion);
44 |
45 | MSALCompletionBlock completionBlock;
46 | __block __weak MSALCompletionBlock weakCompletionBlock;
47 | weakCompletionBlock = completionBlock = ^(MSALResult *result, NSError *error)
48 | {
49 | if (!error) {
50 | self.accessToken = result.accessToken;
51 | self.account = result.account;
52 | completion(YES, nil);
53 |
54 | return;
55 | }
56 |
57 | if ([error.domain isEqualToString:MSALErrorDomain]) {
58 | switch (error.code) {
59 | case MSALErrorInteractionRequired:
60 | {
61 | // Interactive auth will be required
62 | __auto_type interactiveParameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:scopes];
63 | [self.msalClient acquireTokenWithParameters:interactiveParameters
64 | completionBlock:weakCompletionBlock];
65 |
66 | return;
67 | }
68 |
69 | case MSALErrorServerDeclinedScopes:
70 | {
71 | NSArray *declinedScopes = error.userInfo[MSALDeclinedScopesKey];
72 | NSLog(@"The following scopes were declined: %@", declinedScopes);
73 |
74 | NSArray *grantedScopes = error.userInfo[MSALGrantedScopesKey];
75 | NSLog(@"Trying to acquire a token with granted scopes: %@", grantedScopes);
76 |
77 | NSError *localError;
78 | NSArray *accounts = [self.msalClient allAccounts:&localError];
79 |
80 | if (localError) {
81 | completion(NO, localError);
82 | return;
83 | }
84 |
85 | __auto_type silentParameters = [[MSALSilentTokenParameters alloc] initWithScopes:grantedScopes account:accounts.firstObject];
86 | [self.msalClient acquireTokenSilentWithParameters:silentParameters
87 | completionBlock:weakCompletionBlock];
88 | return;
89 | }
90 |
91 | case MSALErrorInternal:
92 | {
93 | // Log the error, then inspect the MSALInternalErrorCodeKey
94 | // in the userInfo dictionary.
95 | // More detailed information about the specific error
96 | // under MSALInternalErrorCodeKey can be found in MSALInternalError enum.
97 | NSLog(@"Failed with internal MSAL error %@", error);
98 |
99 | break;
100 | }
101 |
102 | default:
103 | NSLog(@"Failed with unknown MSAL error %@", error);
104 | break;
105 | }
106 | }
107 |
108 | completion(NO, error);
109 | };
110 |
111 |
112 | NSError *localError;
113 | NSArray *accounts = [self.msalClient allAccounts:&localError];
114 |
115 | if (localError) {
116 | completion(NO, localError);
117 | return;
118 | }
119 |
120 | if (accounts.count > 0) {
121 | __auto_type silentParameters = [[MSALSilentTokenParameters alloc] initWithScopes:scopes account:accounts.firstObject];
122 | [self.msalClient acquireTokenSilentWithParameters:silentParameters completionBlock:completionBlock];
123 | } else {
124 | __auto_type interactiveParameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:scopes];
125 | [self.msalClient acquireTokenWithParameters:interactiveParameters completionBlock:completionBlock];
126 | }
127 | }
128 |
129 | - (void)clearCredentials
130 | {
131 | NSError *error;
132 | [self.msalClient removeAccount:self.account error:&error];
133 |
134 | if (error) NSLog(@"Error: %@", error);
135 | }
136 |
137 | @end
138 |
139 | // *********************************************************
140 | //
141 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
142 | //
143 | // Copyright (c) Microsoft Corporation
144 | // All rights reserved.
145 | //
146 | // MIT License:
147 | // Permission is hereby granted, free of charge, to any person obtaining
148 | // a copy of this software and associated documentation files (the
149 | // "Software"), to deal in the Software without restriction, including
150 | // without limitation the rights to use, copy, modify, merge, publish,
151 | // distribute, sublicense, and/or sell copies of the Software, and to
152 | // permit persons to whom the Software is furnished to do so, subject to
153 | // the following conditions:
154 | //
155 | // The above copyright notice and this permission notice shall be
156 | // included in all copies or substantial portions of the Software.
157 | //
158 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
159 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
160 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
161 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
162 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
163 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
164 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
165 | //
166 | // *********************************************************
167 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/SendMailViewController.m:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See full license at the bottom of this file.
4 | */
5 |
6 | #import "SendMailViewController.h"
7 | #import "AuthenticationManager.h"
8 |
9 | @interface SendMailViewController ()
10 |
11 | @property (weak, nonatomic) IBOutlet UILabel *headerLabel;
12 | @property (weak, nonatomic) IBOutlet UITextView *statusTextView;
13 | @property (weak, nonatomic) IBOutlet UITextField *emailTextField;
14 | @property (weak, nonatomic) IBOutlet UIButton *sendMailButton;
15 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;
16 |
17 | @end
18 |
19 | @implementation SendMailViewController
20 |
21 | - (void)viewDidLoad
22 | {
23 | [super viewDidLoad];
24 |
25 | [self.navigationItem setHidesBackButton:YES];
26 |
27 | // Set user information.
28 | self.emailTextField.text = self.authManager.account.username;
29 | self.headerLabel.text = [NSString stringWithFormat:@"Hi %@!", self.authManager.account.username];
30 | self.statusTextView.text = @"";
31 | }
32 |
33 | #pragma mark - IBAction
34 |
35 | - (IBAction)sendMailTapped:(id)sender
36 | {
37 | [self showSendingUI:YES];
38 | [self sendMailREST];
39 | }
40 |
41 | - (IBAction)disconnectTapped:(id)sender
42 | {
43 | [self.authManager clearCredentials];
44 | [self.navigationController popViewControllerAnimated:YES];
45 | }
46 |
47 | #pragma mark - Send mail
48 |
49 | - (void)sendMailREST
50 | {
51 | [self.emailTextField resignFirstResponder];
52 |
53 | NSData *postData = [self mailContent];
54 |
55 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://graph.microsoft.com/v1.0/me/sendMail"]];
56 | [request setHTTPMethod:@"POST"];
57 | [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
58 | [request setValue:@"application/json, text/plain, */*" forHTTPHeaderField:@"Accept"];
59 |
60 | NSString *authorization = [NSString stringWithFormat:@"Bearer %@", self.authManager.accessToken];
61 | [request setValue:authorization forHTTPHeaderField:@"Authorization"];
62 | [request setHTTPBody:postData];
63 |
64 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
65 | if (connection) {
66 | NSLog(@"Connection Successful");
67 | } else {
68 | NSLog(@"Connection could not be made");
69 | }
70 |
71 | [connection start];
72 | }
73 |
74 | #pragma mark - NSURLConnectionDelegate
75 |
76 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
77 | {
78 | [self showSendingUI:NO];
79 |
80 | NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
81 |
82 | if ([httpResponse statusCode] == 202) {
83 | self.statusTextView.text = @"Check your inbox, you have a new message. :)";
84 | } else {
85 | NSLog(@"Response - %@", response);
86 | self.statusTextView.text = @"The email could not be sent. Check the log for errors.";
87 | }
88 | }
89 |
90 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
91 | {
92 | NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
93 |
94 | NSLog(@"Received Data - %@", responseString);
95 | }
96 |
97 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
98 | {
99 | NSLog(@"Connection Failure - %@", error.localizedDescription);
100 | }
101 |
102 | #pragma mark - Private
103 |
104 | - (NSData *)mailContent
105 | {
106 | NSString *htmlContentPath = [[NSBundle mainBundle] pathForResource:@"EmailBody" ofType:@"html"];
107 | NSString *htmlContentString = [[NSString stringWithContentsOfFile:htmlContentPath encoding:NSUTF8StringEncoding error:nil] stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
108 |
109 | NSString *jsonContentPath = [[NSBundle mainBundle] pathForResource:@"EmailPostContent" ofType:@"json"];
110 | NSMutableString *jsonContentString = [NSMutableString stringWithContentsOfFile:jsonContentPath encoding:NSUTF8StringEncoding error:nil];
111 |
112 | [jsonContentString replaceOccurrencesOfString:@""
113 | withString:self.emailTextField.text
114 | options:0 range:(NSRange){0, [jsonContentString length]}];
115 |
116 | [jsonContentString replaceOccurrencesOfString:@""
117 | withString:@"HTML"
118 | options:0 range:(NSRange){0, [jsonContentString length]}];
119 |
120 | [jsonContentString replaceOccurrencesOfString:@""
121 | withString:htmlContentString
122 | options:0 range:(NSRange){0, [jsonContentString length]}];
123 |
124 | return [jsonContentString dataUsingEncoding:NSUTF8StringEncoding];
125 | }
126 |
127 | - (void)showSendingUI:(BOOL)sending
128 | {
129 | if (sending) {
130 | [self.activityIndicator startAnimating];
131 | [self.sendMailButton setTitle:@"Sending..." forState:UIControlStateNormal];
132 | self.sendMailButton.enabled = NO;
133 | self.statusTextView.text = @"";
134 | } else {
135 | [self.activityIndicator stopAnimating];
136 | [self.sendMailButton setTitle:@"Send" forState:UIControlStateNormal];
137 | self.sendMailButton.enabled = YES;
138 | }
139 | }
140 |
141 | @end
142 |
143 | // *********************************************************
144 | //
145 | // O365-iOS-Unified-API-Connect, https://github.com/OfficeDev/O365-iOS-Unified-API-Connect
146 | //
147 | // Copyright (c) Microsoft Corporation
148 | // All rights reserved.
149 | //
150 | // MIT License:
151 | // Permission is hereby granted, free of charge, to any person obtaining
152 | // a copy of this software and associated documentation files (the
153 | // "Software"), to deal in the Software without restriction, including
154 | // without limitation the rights to use, copy, modify, merge, publish,
155 | // distribute, sublicense, and/or sell copies of the Software, and to
156 | // permit persons to whom the Software is furnished to do so, subject to
157 | // the following conditions:
158 | //
159 | // The above copyright notice and this permission notice shall be
160 | // included in all copies or substantial portions of the Software.
161 | //
162 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
163 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
164 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
165 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
166 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
167 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
168 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
169 | //
170 | // *********************************************************
171 |
172 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | Status text
74 | This is where the status is displayed
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/O365-iOS-Microsoft-Graph-Connect.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 9636EF3A1BA75545003BD5FD /* EmailBody.html in Resources */ = {isa = PBXBuildFile; fileRef = 9636EF391BA75545003BD5FD /* EmailBody.html */; };
11 | 96D4A5E01B66EA040085E94B /* AuthenticationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 96D4A5DF1B66EA040085E94B /* AuthenticationManager.m */; };
12 | 96F8D6151B603A6B00CD9F40 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F8D6141B603A6B00CD9F40 /* main.m */; };
13 | 96F8D6181B603A6B00CD9F40 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F8D6171B603A6B00CD9F40 /* AppDelegate.m */; };
14 | 96F8D61E1B603A6B00CD9F40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F8D61C1B603A6B00CD9F40 /* Main.storyboard */; };
15 | 96F8D6201B603A6B00CD9F40 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F8D61F1B603A6B00CD9F40 /* Images.xcassets */; };
16 | 96F8D6231B603A6B00CD9F40 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96F8D6211B603A6B00CD9F40 /* LaunchScreen.xib */; };
17 | 96F8D6401B603E1700CD9F40 /* SendMailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F8D63F1B603E1700CD9F40 /* SendMailViewController.m */; };
18 | 96F8D6431B60502200CD9F40 /* ConnectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F8D6421B60502200CD9F40 /* ConnectViewController.m */; };
19 | 96F8D6451B60516700CD9F40 /* EmailPostContent.json in Resources */ = {isa = PBXBuildFile; fileRef = 96F8D6441B60516700CD9F40 /* EmailPostContent.json */; };
20 | CF2E75471F562117001543E0 /* MSAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF2E75461F562117001543E0 /* MSAL.framework */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXFileReference section */
24 | 238BA00A227BB18D00A5BACD /* O365-iOS-Microsoft-Graph-Connect.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "O365-iOS-Microsoft-Graph-Connect.entitlements"; sourceTree = ""; };
25 | 9636EF391BA75545003BD5FD /* EmailBody.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = EmailBody.html; sourceTree = ""; };
26 | 96D4A5DE1B66EA040085E94B /* AuthenticationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationManager.h; sourceTree = ""; };
27 | 96D4A5DF1B66EA040085E94B /* AuthenticationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationManager.m; sourceTree = ""; };
28 | 96F8D60F1B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "O365-iOS-Microsoft-Graph-Connect.app"; sourceTree = BUILT_PRODUCTS_DIR; };
29 | 96F8D6131B603A6B00CD9F40 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
30 | 96F8D6141B603A6B00CD9F40 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
31 | 96F8D6161B603A6B00CD9F40 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
32 | 96F8D6171B603A6B00CD9F40 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
33 | 96F8D61D1B603A6B00CD9F40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
34 | 96F8D61F1B603A6B00CD9F40 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
35 | 96F8D6221B603A6B00CD9F40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
36 | 96F8D63E1B603E1700CD9F40 /* SendMailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendMailViewController.h; sourceTree = ""; };
37 | 96F8D63F1B603E1700CD9F40 /* SendMailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SendMailViewController.m; sourceTree = ""; };
38 | 96F8D6411B60502200CD9F40 /* ConnectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectViewController.h; sourceTree = ""; };
39 | 96F8D6421B60502200CD9F40 /* ConnectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectViewController.m; sourceTree = ""; };
40 | 96F8D6441B60516700CD9F40 /* EmailPostContent.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = EmailPostContent.json; sourceTree = ""; };
41 | CF2E75461F562117001543E0 /* MSAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MSAL.framework; path = Carthage/Build/iOS/MSAL.framework; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 96F8D60C1B603A6B00CD9F40 /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | CF2E75471F562117001543E0 /* MSAL.framework in Frameworks */,
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | /* End PBXFrameworksBuildPhase section */
54 |
55 | /* Begin PBXGroup section */
56 | 80AC59A498E68C81282C3F74 /* Frameworks */ = {
57 | isa = PBXGroup;
58 | children = (
59 | CF2E75461F562117001543E0 /* MSAL.framework */,
60 | );
61 | name = Frameworks;
62 | sourceTree = "";
63 | };
64 | 96F8D6061B603A6B00CD9F40 = {
65 | isa = PBXGroup;
66 | children = (
67 | 96F8D6111B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect */,
68 | 96F8D6101B603A6B00CD9F40 /* Products */,
69 | 80AC59A498E68C81282C3F74 /* Frameworks */,
70 | );
71 | sourceTree = "";
72 | };
73 | 96F8D6101B603A6B00CD9F40 /* Products */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 96F8D60F1B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect.app */,
77 | );
78 | name = Products;
79 | sourceTree = "";
80 | };
81 | 96F8D6111B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect */ = {
82 | isa = PBXGroup;
83 | children = (
84 | 238BA00A227BB18D00A5BACD /* O365-iOS-Microsoft-Graph-Connect.entitlements */,
85 | 96F8D6441B60516700CD9F40 /* EmailPostContent.json */,
86 | 9636EF391BA75545003BD5FD /* EmailBody.html */,
87 | 96F8D6161B603A6B00CD9F40 /* AppDelegate.h */,
88 | 96F8D6171B603A6B00CD9F40 /* AppDelegate.m */,
89 | 96F8D61C1B603A6B00CD9F40 /* Main.storyboard */,
90 | 96F8D61F1B603A6B00CD9F40 /* Images.xcassets */,
91 | 96F8D6211B603A6B00CD9F40 /* LaunchScreen.xib */,
92 | 96F8D6121B603A6B00CD9F40 /* Supporting Files */,
93 | 96F8D63E1B603E1700CD9F40 /* SendMailViewController.h */,
94 | 96F8D63F1B603E1700CD9F40 /* SendMailViewController.m */,
95 | 96F8D6411B60502200CD9F40 /* ConnectViewController.h */,
96 | 96F8D6421B60502200CD9F40 /* ConnectViewController.m */,
97 | 96D4A5DE1B66EA040085E94B /* AuthenticationManager.h */,
98 | 96D4A5DF1B66EA040085E94B /* AuthenticationManager.m */,
99 | );
100 | path = "O365-iOS-Microsoft-Graph-Connect";
101 | sourceTree = "";
102 | };
103 | 96F8D6121B603A6B00CD9F40 /* Supporting Files */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 96F8D6131B603A6B00CD9F40 /* Info.plist */,
107 | 96F8D6141B603A6B00CD9F40 /* main.m */,
108 | );
109 | name = "Supporting Files";
110 | sourceTree = "";
111 | };
112 | /* End PBXGroup section */
113 |
114 | /* Begin PBXNativeTarget section */
115 | 96F8D60E1B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect */ = {
116 | isa = PBXNativeTarget;
117 | buildConfigurationList = 96F8D6321B603A6B00CD9F40 /* Build configuration list for PBXNativeTarget "O365-iOS-Microsoft-Graph-Connect" */;
118 | buildPhases = (
119 | 96F8D60B1B603A6B00CD9F40 /* Sources */,
120 | 96F8D60C1B603A6B00CD9F40 /* Frameworks */,
121 | 96F8D60D1B603A6B00CD9F40 /* Resources */,
122 | CF2E75481F562141001543E0 /* ShellScript */,
123 | );
124 | buildRules = (
125 | );
126 | dependencies = (
127 | );
128 | name = "O365-iOS-Microsoft-Graph-Connect";
129 | productName = "O365-iOS-Unified-API-Connect";
130 | productReference = 96F8D60F1B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect.app */;
131 | productType = "com.apple.product-type.application";
132 | };
133 | /* End PBXNativeTarget section */
134 |
135 | /* Begin PBXProject section */
136 | 96F8D6071B603A6B00CD9F40 /* Project object */ = {
137 | isa = PBXProject;
138 | attributes = {
139 | LastUpgradeCheck = 0700;
140 | ORGANIZATIONNAME = Microsoft;
141 | TargetAttributes = {
142 | 96F8D60E1B603A6B00CD9F40 = {
143 | CreatedOnToolsVersion = 6.3.2;
144 | SystemCapabilities = {
145 | com.apple.Keychain = {
146 | enabled = 1;
147 | };
148 | };
149 | };
150 | };
151 | };
152 | buildConfigurationList = 96F8D60A1B603A6B00CD9F40 /* Build configuration list for PBXProject "O365-iOS-Microsoft-Graph-Connect" */;
153 | compatibilityVersion = "Xcode 3.2";
154 | developmentRegion = English;
155 | hasScannedForEncodings = 0;
156 | knownRegions = (
157 | en,
158 | Base,
159 | );
160 | mainGroup = 96F8D6061B603A6B00CD9F40;
161 | productRefGroup = 96F8D6101B603A6B00CD9F40 /* Products */;
162 | projectDirPath = "";
163 | projectRoot = "";
164 | targets = (
165 | 96F8D60E1B603A6B00CD9F40 /* O365-iOS-Microsoft-Graph-Connect */,
166 | );
167 | };
168 | /* End PBXProject section */
169 |
170 | /* Begin PBXResourcesBuildPhase section */
171 | 96F8D60D1B603A6B00CD9F40 /* Resources */ = {
172 | isa = PBXResourcesBuildPhase;
173 | buildActionMask = 2147483647;
174 | files = (
175 | 96F8D61E1B603A6B00CD9F40 /* Main.storyboard in Resources */,
176 | 9636EF3A1BA75545003BD5FD /* EmailBody.html in Resources */,
177 | 96F8D6231B603A6B00CD9F40 /* LaunchScreen.xib in Resources */,
178 | 96F8D6201B603A6B00CD9F40 /* Images.xcassets in Resources */,
179 | 96F8D6451B60516700CD9F40 /* EmailPostContent.json in Resources */,
180 | );
181 | runOnlyForDeploymentPostprocessing = 0;
182 | };
183 | /* End PBXResourcesBuildPhase section */
184 |
185 | /* Begin PBXShellScriptBuildPhase section */
186 | CF2E75481F562141001543E0 /* ShellScript */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | "$(SRCROOT)/Carthage/Build/iOS/MSAL.framework",
193 | );
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/usr/local/bin/carthage copy-frameworks\n";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 96F8D60B1B603A6B00CD9F40 /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 96D4A5E01B66EA040085E94B /* AuthenticationManager.m in Sources */,
208 | 96F8D6181B603A6B00CD9F40 /* AppDelegate.m in Sources */,
209 | 96F8D6431B60502200CD9F40 /* ConnectViewController.m in Sources */,
210 | 96F8D6151B603A6B00CD9F40 /* main.m in Sources */,
211 | 96F8D6401B603E1700CD9F40 /* SendMailViewController.m in Sources */,
212 | );
213 | runOnlyForDeploymentPostprocessing = 0;
214 | };
215 | /* End PBXSourcesBuildPhase section */
216 |
217 | /* Begin PBXVariantGroup section */
218 | 96F8D61C1B603A6B00CD9F40 /* Main.storyboard */ = {
219 | isa = PBXVariantGroup;
220 | children = (
221 | 96F8D61D1B603A6B00CD9F40 /* Base */,
222 | );
223 | name = Main.storyboard;
224 | sourceTree = "";
225 | };
226 | 96F8D6211B603A6B00CD9F40 /* LaunchScreen.xib */ = {
227 | isa = PBXVariantGroup;
228 | children = (
229 | 96F8D6221B603A6B00CD9F40 /* Base */,
230 | );
231 | name = LaunchScreen.xib;
232 | sourceTree = "";
233 | };
234 | /* End PBXVariantGroup section */
235 |
236 | /* Begin XCBuildConfiguration section */
237 | 96F8D6301B603A6B00CD9F40 /* Debug */ = {
238 | isa = XCBuildConfiguration;
239 | buildSettings = {
240 | ALWAYS_SEARCH_USER_PATHS = NO;
241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
242 | CLANG_CXX_LIBRARY = "libc++";
243 | CLANG_ENABLE_MODULES = YES;
244 | CLANG_ENABLE_OBJC_ARC = YES;
245 | CLANG_WARN_BOOL_CONVERSION = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
248 | CLANG_WARN_EMPTY_BODY = YES;
249 | CLANG_WARN_ENUM_CONVERSION = YES;
250 | CLANG_WARN_INT_CONVERSION = YES;
251 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
252 | CLANG_WARN_UNREACHABLE_CODE = YES;
253 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
254 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
255 | COPY_PHASE_STRIP = NO;
256 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
257 | ENABLE_STRICT_OBJC_MSGSEND = YES;
258 | ENABLE_TESTABILITY = YES;
259 | GCC_C_LANGUAGE_STANDARD = gnu99;
260 | GCC_DYNAMIC_NO_PIC = NO;
261 | GCC_NO_COMMON_BLOCKS = YES;
262 | GCC_OPTIMIZATION_LEVEL = 0;
263 | GCC_PREPROCESSOR_DEFINITIONS = (
264 | "DEBUG=1",
265 | "$(inherited)",
266 | );
267 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
268 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
269 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
270 | GCC_WARN_UNDECLARED_SELECTOR = YES;
271 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
272 | GCC_WARN_UNUSED_FUNCTION = YES;
273 | GCC_WARN_UNUSED_VARIABLE = YES;
274 | HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
275 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
276 | MTL_ENABLE_DEBUG_INFO = YES;
277 | ONLY_ACTIVE_ARCH = YES;
278 | SDKROOT = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | };
281 | name = Debug;
282 | };
283 | 96F8D6311B603A6B00CD9F40 /* Release */ = {
284 | isa = XCBuildConfiguration;
285 | buildSettings = {
286 | ALWAYS_SEARCH_USER_PATHS = NO;
287 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
288 | CLANG_CXX_LIBRARY = "libc++";
289 | CLANG_ENABLE_MODULES = YES;
290 | CLANG_ENABLE_OBJC_ARC = YES;
291 | CLANG_WARN_BOOL_CONVERSION = YES;
292 | CLANG_WARN_CONSTANT_CONVERSION = YES;
293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
294 | CLANG_WARN_EMPTY_BODY = YES;
295 | CLANG_WARN_ENUM_CONVERSION = YES;
296 | CLANG_WARN_INT_CONVERSION = YES;
297 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
298 | CLANG_WARN_UNREACHABLE_CODE = YES;
299 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
300 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
301 | COPY_PHASE_STRIP = NO;
302 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
303 | ENABLE_NS_ASSERTIONS = NO;
304 | ENABLE_STRICT_OBJC_MSGSEND = YES;
305 | GCC_C_LANGUAGE_STANDARD = gnu99;
306 | GCC_NO_COMMON_BLOCKS = YES;
307 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
308 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
309 | GCC_WARN_UNDECLARED_SELECTOR = YES;
310 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
311 | GCC_WARN_UNUSED_FUNCTION = YES;
312 | GCC_WARN_UNUSED_VARIABLE = YES;
313 | HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
314 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
315 | MTL_ENABLE_DEBUG_INFO = NO;
316 | SDKROOT = iphoneos;
317 | TARGETED_DEVICE_FAMILY = "1,2";
318 | VALIDATE_PRODUCT = YES;
319 | };
320 | name = Release;
321 | };
322 | 96F8D6331B603A6B00CD9F40 /* Debug */ = {
323 | isa = XCBuildConfiguration;
324 | buildSettings = {
325 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
326 | CODE_SIGN_ENTITLEMENTS = "O365-iOS-Microsoft-Graph-Connect/O365-iOS-Microsoft-Graph-Connect.entitlements";
327 | DEVELOPMENT_TEAM = "";
328 | FRAMEWORK_SEARCH_PATHS = (
329 | "$(inherited)",
330 | "$(PROJECT_DIR)/Carthage/Build/iOS",
331 | );
332 | INFOPLIST_FILE = "O365-iOS-Microsoft-Graph-Connect/Info.plist";
333 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
334 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.$(PRODUCT_NAME:rfc1034identifier)";
335 | PRODUCT_NAME = "O365-iOS-Microsoft-Graph-Connect";
336 | };
337 | name = Debug;
338 | };
339 | 96F8D6341B603A6B00CD9F40 /* Release */ = {
340 | isa = XCBuildConfiguration;
341 | buildSettings = {
342 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
343 | CODE_SIGN_ENTITLEMENTS = "O365-iOS-Microsoft-Graph-Connect/O365-iOS-Microsoft-Graph-Connect.entitlements";
344 | DEVELOPMENT_TEAM = "";
345 | FRAMEWORK_SEARCH_PATHS = (
346 | "$(inherited)",
347 | "$(PROJECT_DIR)/Carthage/Build/iOS",
348 | );
349 | INFOPLIST_FILE = "O365-iOS-Microsoft-Graph-Connect/Info.plist";
350 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
351 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.$(PRODUCT_NAME:rfc1034identifier)";
352 | PRODUCT_NAME = "O365-iOS-Microsoft-Graph-Connect";
353 | };
354 | name = Release;
355 | };
356 | /* End XCBuildConfiguration section */
357 |
358 | /* Begin XCConfigurationList section */
359 | 96F8D60A1B603A6B00CD9F40 /* Build configuration list for PBXProject "O365-iOS-Microsoft-Graph-Connect" */ = {
360 | isa = XCConfigurationList;
361 | buildConfigurations = (
362 | 96F8D6301B603A6B00CD9F40 /* Debug */,
363 | 96F8D6311B603A6B00CD9F40 /* Release */,
364 | );
365 | defaultConfigurationIsVisible = 0;
366 | defaultConfigurationName = Release;
367 | };
368 | 96F8D6321B603A6B00CD9F40 /* Build configuration list for PBXNativeTarget "O365-iOS-Microsoft-Graph-Connect" */ = {
369 | isa = XCConfigurationList;
370 | buildConfigurations = (
371 | 96F8D6331B603A6B00CD9F40 /* Debug */,
372 | 96F8D6341B603A6B00CD9F40 /* Release */,
373 | );
374 | defaultConfigurationIsVisible = 0;
375 | defaultConfigurationName = Release;
376 | };
377 | /* End XCConfigurationList section */
378 | };
379 | rootObject = 96F8D6071B603A6B00CD9F40 /* Project object */;
380 | }
381 |
--------------------------------------------------------------------------------