├── ios-objectivec-connect-sample ├── Assets.xcassets │ ├── Contents.json │ ├── test.imageset │ │ ├── test.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── ConnectViewController.h ├── AppDelegate.h ├── ios-objectivec-connect-sample.entitlements ├── main.m ├── AuthenticationConstants.h ├── SendMailViewController.h ├── AuthenticationConstants.m ├── AuthenticationProvider.h ├── Localizable.strings ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── AppDelegate.m ├── AuthenticationProvider.m ├── EmailBody.html ├── ConnectViewController.m └── SendMailViewController.m ├── Podfile ├── starter-project ├── Podfile ├── iOS-ObjectiveC-Connect-Sample.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── ios-objectivec-connect-sample │ ├── ConnectViewController.h │ ├── AppDelegate.h │ ├── AuthenticationConstants.h │ ├── main.m │ ├── SendMailViewController.h │ ├── AuthenticationProvider.h │ ├── AuthenticationConstants.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AuthenticationProvider.m │ ├── Localizable.strings │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── EmailBody.html │ ├── AppDelegate.m │ ├── ConnectViewController.m │ └── SendMailViewController.m └── ios-objectivec-connect-sample.xcworkspace │ └── contents.xcworkspacedata ├── ios-objectivec-connect-sample.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── ios-objectivec-connect-sample.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── O365-iOS-Microsoft-Graph-SDK.xcscmblueprint ├── .gitignore ├── License.txt ├── README-Localized ├── README-zh-cn.md ├── README-zh-tw.md ├── README-ja-jp.md ├── README-ru-ru.md ├── README-pt-br.md ├── README-es-es.md ├── README-de-de.md └── README-fr-fr.md └── Readme.md /ios-objectivec-connect-sample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/Assets.xcassets/test.imageset/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoftgraph/ios-objectivec-connect-sample/master/ios-objectivec-connect-sample/Assets.xcassets/test.imageset/test.png -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '6.0' 3 | 4 | target 'ios-objectivec-connect-sample' do 5 | pod 'MSGraphSDK' 6 | pod 'MSGraphSDK-NXOAuth2Adapter' 7 | end 8 | -------------------------------------------------------------------------------- /starter-project/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '6.0' 3 | 4 | target 'iOS-ObjectiveC-Connect-Sample' do 5 | pod 'MSGraphSDK' 6 | pod 'MSGraphSDK-NXOAuth2Adapter' 7 | end 8 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /starter-project/iOS-ObjectiveC-Connect-Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/ConnectViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | 8 | 9 | @interface ConnectViewController : UIViewController 10 | 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/ConnectViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | 8 | 9 | @interface ConnectViewController : UIViewController 10 | 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | 8 | @interface AppDelegate : UIResponder 9 | 10 | @property (strong, nonatomic) UIWindow *window; 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | 8 | @interface AppDelegate : UIResponder 9 | 10 | @property (strong, nonatomic) UIWindow *window; 11 | 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/ios-objectivec-connect-sample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keychain-access-groups 6 | 7 | $(AppIdentifierPrefix)com.ios-objectivec-connect-sample 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/AuthenticationConstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | 8 | @interface AuthenticationConstants : NSObject 9 | 10 | // Application Information 11 | extern NSString *const kClientId; 12 | extern NSString *const kScopes; 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/Assets.xcassets/test.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "test.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/AuthenticationConstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | 8 | @interface AuthenticationConstants : NSObject 9 | 10 | // Application Information 11 | extern NSString *const kClientId; 12 | extern NSString *const kScopes; 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | #import "AppDelegate.h" 8 | 9 | int main(int argc, char * argv[]) { 10 | @autoreleasepool { 11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/SendMailViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | @class MSGraphClient; 8 | @class AuthenticationProvider; 9 | 10 | @interface SendMailViewController : UIViewController 11 | 12 | @property (strong, nonatomic) AuthenticationProvider *authenticationProvider; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/SendMailViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | @class MSGraphClient; 8 | @class AuthenticationProvider; 9 | 10 | @interface SendMailViewController : UIViewController 11 | 12 | @property (strong, nonatomic) AuthenticationProvider *authenticationProvider; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/AuthenticationProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | #import 8 | 9 | @class NXOAuth2AuthenticationProvider; 10 | 11 | @interface AuthenticationProvider : NSObject 12 | 13 | @property (strong, nonatomic) NXOAuth2AuthenticationProvider *authProvider; 14 | 15 | 16 | 17 | 18 | -(void) disconnect; 19 | 20 | @end 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/AuthenticationConstants.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "AuthenticationConstants.h" 7 | 8 | @implementation AuthenticationConstants 9 | 10 | // You will set your application's clientId 11 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 12 | NSString * const kScopes = @"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"; 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/AuthenticationConstants.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "AuthenticationConstants.h" 7 | 8 | @implementation AuthenticationConstants 9 | 10 | // You will set your application's clientId 11 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 12 | NSString * const kScopes = @"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"; 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/AuthenticationProvider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import 7 | #import 8 | 9 | @class NXOAuth2AuthenticationProvider; 10 | 11 | @interface AuthenticationProvider : NSObject 12 | 13 | @property (strong, nonatomic) NXOAuth2AuthenticationProvider *authProvider; 14 | 15 | -(void) connectToGraphWithClientId:(NSString *)clientId 16 | scopes:(NSArray *)scopes 17 | completion:(void (^)(NSError *error))completion; 18 | 19 | 20 | -(void) disconnect; 21 | 22 | @end 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/Assets.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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/AuthenticationProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "AuthenticationProvider.h" 7 | #import "AuthenticationConstants.h" 8 | #import 9 | 10 | @implementation AuthenticationProvider 11 | 12 | - (NXOAuth2AuthenticationProvider *)authProvider { 13 | return [NXOAuth2AuthenticationProvider sharedAuthProvider]; 14 | } 15 | 16 | 17 | /** 18 | Signs out the current AuthProvider, completely removing all tokens and cookies. 19 | @param completionHandler The completion handler to be called when sign out has completed. 20 | error should be non nil if there was no error, and should contain any error(s) that occurred. 21 | */ 22 | -(void) disconnect{ 23 | [self.authProvider logout]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | 4 | Copyright (c) 2016 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. -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | 7 | // ConnectViewController 8 | "CONNECT" = "Connect"; 9 | "CONNECTING" = "Connecting..."; 10 | 11 | // SendViewController 12 | "DISCONNECT" = "Disconnect"; 13 | "DESCRIPTION" = "You're now connected to Office 365.\nTap the Send button below to send a message from your account using the iOS Microsoft Graph SDK."; 14 | 15 | "SEND" = "Send"; 16 | "SEND_FAILURE" = "Send mail has failed. Please look at the log for more details."; 17 | "SEND_SUCCESS" = "Mail sent successfully."; 18 | 19 | "LOADING_USER_INFO" = "Loading user information"; 20 | "GRAPH_ERROR" = "Graph Error."; 21 | "USER_INFO_LOAD_FAILURE" = "User information loading failed."; 22 | "HI_USER" = "Hi %@"; 23 | "USER_INFO_LOAD_SUCCESS" = "User information loaded."; 24 | 25 | "MAIL_SUBJECT" = "Mail received from the Office 365 iOS Microsoft Graph SDK Sample"; 26 | 27 | // Common 28 | "GRAPH_TITLE" = "Microsoft Graph Connect"; 29 | "CHECK_LOG_ERROR" = "Check print log for error details"; 30 | "ERROR" = "Error"; 31 | "CLOSE" = "Close"; 32 | 33 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/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 | 40 | 41 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | 7 | // ConnectViewController 8 | "CONNECT" = "Connect"; 9 | "CONNECTING" = "Connecting..."; 10 | 11 | // SendViewController 12 | "DISCONNECT" = "Disconnect"; 13 | "DESCRIPTION" = "You're now connected to Office 365.\nTap the Send button below to send a message from your account using the iOS Microsoft Graph SDK."; 14 | 15 | "SEND" = "Send"; 16 | "SEND_FAILURE" = "Send mail has failed. Please look at the log for more details."; 17 | "SEND_SUCCESS" = "Mail sent successfully."; 18 | 19 | "LOADING_USER_INFO" = "Loading user information"; 20 | "GRAPH_ERROR" = "Graph Error."; 21 | "USER_INFO_LOAD_FAILURE" = "User information loading failed."; 22 | "HI_USER" = "Hi %@"; 23 | "USER_INFO_LOAD_SUCCESS" = "User information loaded."; 24 | 25 | "MAIL_SUBJECT" = "Mail received from the Office 365 iOS Microsoft Graph SDK Sample"; 26 | 27 | // Common 28 | "GRAPH_TITLE" = "Microsoft Graph Connect"; 29 | "CHECK_LOG_ERROR" = "Check print log for error details"; 30 | "ERROR" = "Error"; 31 | "CLOSE" = "Close"; 32 | 33 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/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 | 40 | 41 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample.xcworkspace/xcshareddata/O365-iOS-Microsoft-Graph-SDK.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "8C5781ECE1580644A71AD3DF94D4EECFE6387A36", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "E578364CA79A995DDB1916E193A9960A5CEB2B9B" : 9223372036854775807, 8 | "8C5781ECE1580644A71AD3DF94D4EECFE6387A36" : 9223372036854775807 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "AFD4B935-AF74-4B08-A5E0-88A10EB049AF", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "E578364CA79A995DDB1916E193A9960A5CEB2B9B" : "microsoft-authentication-library-for-objc\/", 13 | "8C5781ECE1580644A71AD3DF94D4EECFE6387A36" : "ios-objectivec-connect-sample\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "ios-objectivec-connect-sample", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "ios-objectivec-connect-sample.xcworkspace", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/microsoftgraph\/ios-objectivec-connect-sample.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C5781ECE1580644A71AD3DF94D4EECFE6387A36" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/AzureAD\/microsoft-authentication-library-for-objc.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E578364CA79A995DDB1916E193A9960A5CEB2B9B" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/EmailBody.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

Congratulations.

9 |

This is a message from the Microsoft Graph Connect sample. You are well on your way to incorporating Microsoft Graph services in your apps.

10 |

What’s next?

11 |
    12 |
  • Check out graph.microsoft.io to start building Microsoft Graph apps today with all the latest tools, templates, and guidance to get started quickly.
  • 13 |
  • Use the Graph Explorer to start your testing.
  • 14 |
  • Browse other samples on GitHub to see more of the APIs in action.
  • 15 |
16 |

Give us feedback

17 |
    18 |
  • If you have any trouble running this sample, please log an issue.
  • 19 |
  • For general questions about the Microsoft Graph APIs, post to Stack Overflow. Make sure that your questions or comments are tagged with [MicrosoftGraph].
  • 20 |
21 |

Thanks and happy coding!
Your Microsoft Graph Development team

22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
See on GitHubSuggest on UserVoice
31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "AppDelegate.h" 7 | 8 | @interface AppDelegate () 9 | 10 | @end 11 | 12 | @implementation AppDelegate 13 | 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 16 | // Override point for customization after application launch. 17 | return YES; 18 | } 19 | 20 | - (void)applicationWillResignActive:(UIApplication *)application { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application { 26 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 28 | } 29 | 30 | - (void)applicationWillEnterForeground:(UIApplication *)application { 31 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 32 | } 33 | 34 | - (void)applicationDidBecomeActive:(UIApplication *)application { 35 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 36 | } 37 | 38 | - (void)applicationWillTerminate:(UIApplication *)application { 39 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/AuthenticationProvider.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "AuthenticationProvider.h" 7 | #import "AuthenticationConstants.h" 8 | #import 9 | 10 | @implementation AuthenticationProvider 11 | 12 | - (NXOAuth2AuthenticationProvider *)authProvider { 13 | return [NXOAuth2AuthenticationProvider sharedAuthProvider]; 14 | } 15 | 16 | 17 | -(void)connectToGraphWithClientId:(NSString *)clientId scopes:(NSArray *)scopes completion:(void (^)(NSError *))completion{ 18 | [NXOAuth2AuthenticationProvider setClientId:kClientId 19 | scopes:scopes]; 20 | 21 | 22 | /** 23 | Obtains access token by performing login with UI, where viewController specifies the parent view controller. 24 | @param viewController The view controller to present the UI on. 25 | @param completionHandler The completion handler to be called when the authentication has completed. 26 | error should be non nil if there was no error, and should contain any error(s) that occurred. 27 | */ 28 | if ([[NXOAuth2AuthenticationProvider sharedAuthProvider] loginSilent]) { 29 | completion(nil); 30 | } 31 | else{ 32 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 33 | if (!error) { 34 | NSLog(@"Authentication sucessful."); 35 | completion(nil); 36 | } 37 | else{ 38 | NSLog(@"Authentication failed - %@", error.localizedDescription); 39 | completion(error); 40 | } 41 | }]; 42 | } 43 | 44 | } 45 | 46 | /** 47 | Signs out the current AuthProvider, completely removing all tokens and cookies. 48 | @param completionHandler The completion handler to be called when sign out has completed. 49 | error should be non nil if there was no error, and should contain any error(s) that occurred. 50 | */ 51 | -(void) disconnect{ 52 | [self.authProvider logout]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "AppDelegate.h" 7 | 8 | @interface AppDelegate () 9 | 10 | @end 11 | 12 | @implementation AppDelegate 13 | 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 16 | // Override point for customization after application launch. 17 | return YES; 18 | } 19 | 20 | - (void)applicationWillResignActive:(UIApplication *)application { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application { 26 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 28 | } 29 | 30 | - (void)applicationWillEnterForeground:(UIApplication *)application { 31 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 32 | } 33 | 34 | - (void)applicationDidBecomeActive:(UIApplication *)application { 35 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 36 | } 37 | 38 | - (void)applicationWillTerminate:(UIApplication *)application { 39 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/ConnectViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "ConnectViewController.h" 7 | #import 8 | #import "AuthenticationConstants.h" 9 | #import "SendMailViewController.h" 10 | #import "AuthenticationProvider.h" 11 | 12 | @interface ConnectViewController () 13 | 14 | @property (strong, nonatomic) IBOutlet UINavigationItem *appTitle; 15 | @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; 16 | @property (strong, nonatomic) IBOutlet UIButton *connectButton; 17 | @property (strong, nonatomic) AuthenticationProvider *authProvider; 18 | 19 | 20 | @end 21 | 22 | @implementation ConnectViewController 23 | 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | // Do view setup here. 28 | _authProvider = [[AuthenticationProvider alloc]init]; 29 | 30 | self.appTitle.title = NSLocalizedString(@"GRAPH_TITLE", comment: ""); 31 | [self.connectButton setTitle:(NSLocalizedString(@"CONNECT", comment: "")) forState:normal]; 32 | 33 | } 34 | 35 | - (void)viewWillAppear:(BOOL)animated { 36 | [super viewWillAppear:animated]; 37 | } 38 | 39 | - (void)viewWillDisappear:(BOOL)animated { 40 | [super viewWillDisappear:animated]; 41 | 42 | } 43 | 44 | #pragma mark - button interaction (Connect) 45 | 46 | 47 | #pragma mark - Navigation 48 | -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 49 | if ([segue.identifier isEqualToString:@"showSendMail"]){ 50 | SendMailViewController *sendMailVC = segue.destinationViewController; 51 | sendMailVC.authenticationProvider = self.authProvider; 52 | } 53 | } 54 | 55 | #pragma mark - Helper 56 | -(void) showLoadingUI:(BOOL)loading { 57 | 58 | if (loading){ 59 | [self.activityIndicator startAnimating]; 60 | [self.connectButton setTitle:(NSLocalizedString(@"CONNECTING", comment: "")) forState:normal]; 61 | self.connectButton.enabled = NO; 62 | } 63 | 64 | else{ 65 | 66 | [self.activityIndicator stopAnimating]; 67 | [self.connectButton setTitle:(NSLocalizedString(@"CONNECT", comment: "")) forState:normal]; 68 | self.connectButton.enabled = YES; 69 | } 70 | 71 | 72 | } 73 | 74 | 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/EmailBody.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Congratulations!

8 |

This is a message from the Microsoft Graph Connect Sample. You are well on your way to incorporating Microsoft Graph endpoints in your apps.

See the photo you just uploaded! 9 |

What's next?

    10 |
  • Check out developer.microsoft.com/graph to start building Microsoft Graph apps today with all the latest tools, templates, and guidance to get started quickly.
  • 11 |
  • Use the Graph Explorer to explore the rest of the APIs and start your testing.
  • 12 |
  • Browse other samples on GitHub to see more of the APIs in action.
  • 13 |
14 |

Give us feedback

15 |

If you have any trouble running this sample, please 16 | log an issue on our repository.

For general questions about the Microsoft Graph API, post to Stack Overflow. Make sure that your questions or comments are tagged with [microsoftgraph].

17 |

Thanks, and happy coding!
18 | Your Microsoft Graph samples development team

19 |
20 | 21 | 22 | 23 | 25 | 27 | 29 | 30 | 31 |
See on GitHub 24 | Suggest on UserVoice 26 | Share on Twitter 28 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/ConnectViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "ConnectViewController.h" 7 | #import 8 | #import "AuthenticationConstants.h" 9 | #import "SendMailViewController.h" 10 | #import "AuthenticationProvider.h" 11 | 12 | @interface ConnectViewController () 13 | 14 | @property (strong, nonatomic) IBOutlet UINavigationItem *appTitle; 15 | @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; 16 | @property (strong, nonatomic) IBOutlet UIButton *connectButton; 17 | @property (strong, nonatomic) AuthenticationProvider *authProvider; 18 | 19 | 20 | @end 21 | 22 | @implementation ConnectViewController 23 | 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | // Do view setup here. 28 | _authProvider = [[AuthenticationProvider alloc]init]; 29 | 30 | self.appTitle.title = NSLocalizedString(@"Office 365 Connect Sample", comment: ""); 31 | [self.connectButton setTitle:(NSLocalizedString(@"CONNECT", comment: "")) forState:normal]; 32 | 33 | } 34 | 35 | - (void)viewWillAppear:(BOOL)animated { 36 | [super viewWillAppear:animated]; 37 | } 38 | 39 | - (void)viewWillDisappear:(BOOL)animated { 40 | [super viewWillDisappear:animated]; 41 | 42 | } 43 | 44 | #pragma mark - button interaction (Connect) 45 | - (IBAction)connectTapped:(id)sender { 46 | [self showLoadingUI:YES]; 47 | 48 | NSArray *scopes = [kScopes componentsSeparatedByString:@","]; 49 | [self.authProvider connectToGraphWithClientId:kClientId scopes:scopes completion:^(NSError *error) { 50 | if (!error) { 51 | [self performSegueWithIdentifier:@"showSendMail" sender:nil]; 52 | [self showLoadingUI:NO]; 53 | NSLog(@"Authentication successful."); 54 | } 55 | else{ 56 | NSLog(NSLocalizedString(@"CHECK_LOG_ERROR", error.localizedDescription)); 57 | [self showLoadingUI:NO]; 58 | 59 | }; 60 | }]; 61 | } 62 | 63 | 64 | #pragma mark - Navigation 65 | -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 66 | if ([segue.identifier isEqualToString:@"showSendMail"]){ 67 | SendMailViewController *sendMailVC = segue.destinationViewController; 68 | sendMailVC.authenticationProvider = self.authProvider; 69 | } 70 | } 71 | 72 | #pragma mark - Helper 73 | -(void) showLoadingUI:(BOOL)loading { 74 | 75 | if (loading){ 76 | [self.activityIndicator startAnimating]; 77 | [self.connectButton setTitle:(NSLocalizedString(@"CONNECTING", comment: "")) forState:normal]; 78 | self.connectButton.enabled = NO; 79 | } 80 | 81 | else{ 82 | 83 | [self.activityIndicator stopAnimating]; 84 | [self.connectButton setTitle:(NSLocalizedString(@"CONNECT", comment: "")) forState:normal]; 85 | self.connectButton.enabled = YES; 86 | } 87 | 88 | 89 | } 90 | 91 | 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/SendMailViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "SendMailViewController.h" 7 | #import 8 | #import "ConnectViewController.h" 9 | #import "AuthenticationProvider.h" 10 | 11 | 12 | @interface SendMailViewController() 13 | 14 | @property (strong, nonatomic) IBOutlet UILabel *headerLabel; 15 | @property (strong, nonatomic) IBOutlet UITextView *statusTextView; 16 | @property (strong, nonatomic) IBOutlet UITextField *emailTextField; 17 | @property (strong, nonatomic) IBOutlet UIButton *sendMailButton; 18 | @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; 19 | @property (strong, nonatomic) NSString *emailAddress; 20 | @property (strong, nonatomic) MSGraphClient *graphClient; 21 | @property (strong, nonatomic) IBOutlet UINavigationItem *appTitle; 22 | @property (strong, nonatomic) IBOutlet UIBarButtonItem *disconnectButton; 23 | @property (strong, nonatomic) IBOutlet UITextView *descriptionLabel; 24 | 25 | @end 26 | 27 | 28 | 29 | @implementation SendMailViewController 30 | 31 | 32 | - (void)viewDidLoad { 33 | [super viewDidLoad]; 34 | 35 | self.title = NSLocalizedString(@"GRAPH_TITLE", comment: ""); 36 | self.disconnectButton.title = NSLocalizedString(@"DISCONNECT", comment: ""); 37 | self.descriptionLabel.text = NSLocalizedString(@"DESCRIPTION", comment: ""); 38 | [self.sendMailButton setTitle:(NSLocalizedString(@"SEND", comment: "")) forState:normal]; 39 | 40 | [MSGraphClient setAuthenticationProvider:self.authenticationProvider.authProvider]; 41 | self.graphClient = [MSGraphClient client]; 42 | 43 | } 44 | 45 | -(void)viewWillAppear:(BOOL)animated{ 46 | [super viewWillAppear:animated]; 47 | [self.navigationItem setHidesBackButton:YES]; 48 | 49 | } 50 | 51 | - (IBAction)sendMailTapped:(id)sender { 52 | [self sendMail]; 53 | } 54 | 55 | - (IBAction)disconnectTapped:(id)sender { 56 | [self.authenticationProvider disconnect]; 57 | [self.navigationController popViewControllerAnimated:YES]; 58 | } 59 | 60 | 61 | 62 | #pragma mark - Helper Methods 63 | //Retrieve the logged in user's display name and email address 64 | -(void) getUserInfo: (NSString *)url completion:(void(^) ( NSError*))completionBlock{ 65 | 66 | [[[self.graphClient me]request]getWithCompletion:^(MSGraphUser *response, NSError *error) { 67 | if(!error){ 68 | dispatch_async(dispatch_get_main_queue(), ^{ 69 | self.emailAddress = response.userPrincipalName; 70 | self.emailTextField.text = self.emailAddress; 71 | self.headerLabel.text = [NSString stringWithFormat:(NSLocalizedString(@"HI_USER", comment "")), response.displayName]; 72 | self.statusTextView.text = NSLocalizedString(@"USER_INFO_LOAD_SUCCESS", comment: ""); 73 | }); 74 | 75 | completionBlock(nil); 76 | } 77 | else{ 78 | dispatch_async(dispatch_get_main_queue(), ^{ 79 | self.statusTextView.text = NSLocalizedString(@"USER_INFO_LOAD_FAILURE", comment: ""); 80 | NSLog(NSLocalizedString(@"ERROR", ""), error.localizedDescription); 81 | }); 82 | completionBlock(error); 83 | } 84 | }]; 85 | 86 | } 87 | 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /README-Localized/README-zh-cn.md: -------------------------------------------------------------------------------- 1 | # 适用于 iOS 的 Office 365 连接示例(使用 Microsoft Graph SDK) 2 | 3 | Microsoft Graph 是访问来自 Microsoft 云的数据、关系和数据解析的统一终结点。此示例介绍如何连接并对其进行身份验证,然后通过 [适用于 iOS 的 Microsoft Graph SDK](https://github.com/microsoftgraph/msgraph-sdk-ios) 调用邮件和用户 API。 4 | 5 | > 注意:尝试 [Microsoft Graph 应用注册门户](https://apps.dev.microsoft.com) 页,该页简化了注册,因此你可以更快地运行该示例。 6 | 7 | ## 先决条件 8 | * 从 Apple 下载 [Xcode](https://developer.apple.com/xcode/downloads/) 9 | 10 | * 安装 [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 作为依存关系管理器。 11 | * Microsoft 工作或个人电子邮件帐户,例如 Office 365 或 outlook.com、hotmail.com 等。你可以注册 [Office 365 开发人员订阅](https://aka.ms/devprogramsignup),其中包含开始构建 Office 365 应用所需的资源。 12 | 13 | > 注意:如果已有订阅,则之前的链接会将你转至包含以下信息的页面:*抱歉,你无法将其添加到当前帐户*。在这种情况下,请使用当前 Office 365 订阅中的帐户。 14 | * [Microsoft Graph 应用注册门户](https://apps.dev.microsoft.com) 中已注册应用的客户端 ID 15 | * 若要生成请求,必须提供 **MSAuthenticationProvider**(它能够使用适当的 OAuth 2.0 持有者令牌对 HTTPS 请求进行身份验证)。我们将使用 [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) 作为 MSAuthenticationProvider 的示例实现,它可用于快速启动你的项目。有关详细信息,请参阅下面的“**相关代码**”部分。 16 | 17 | 18 | ## 在 Xcode 中运行此示例 19 | 20 | 1. 克隆该存储库 21 | 2. 如果尚未安装,从**终端**应用运行以下命令来安装和设置 CocoaPods 依存关系管理器。 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. 使用 CocoaPods 导入 Microsoft Graph SDK 和身份验证依赖项: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | 该示例应用已包含可将 pod 导入到项目中的 pod 文件。仅定位到 pod 文件所在的项目根并从**终端**运行: 34 | 35 | pod install 36 | 37 | 有关详细信息,请参阅[其他资源](#AdditionalResources)中的**使用 CocoaPods** 38 | 39 | 3. 打开 **ios-objectivec-sample.xcworkspace** 40 | 4. 打开 **AuthenticationConstants.m**。你会发现,注册过程中的 **ClientID** 可以添加到文件顶部: 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | 你会发现,已为此项目配置了以下权限范围: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >注意:此项目向邮件帐户发送邮件,将图片上传到 OneDrive,并检索一些个人资料信息(显示名称、电子邮件地址和个人资料图片)。其中使用的服务调用需要这些权限,这样应用才能正常运行。 55 | 56 | 5. 运行示例。系统将要求你连接至工作或个人邮件帐户或对其进行身份验证,然后你可以向该帐户或其他所选电子邮件帐户发送邮件。 57 | 58 | 59 | ## 相关代码 60 | 61 | 可以在 **AuthenticationProvider.m** 文件中查看所有身份验证代码。我们使用从 [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) 扩展的 MSAuthenticationProvider 示例实现来提供对已注册的本机应用的登录支持、访问令牌的自动刷新和注销功能。 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | 设置验证提供程序后,便可以创建并初始化客户端对象 (MSGraphClient),以用于对 Microsoft Graph 服务终结点(邮件和用户)进行调用。在 **SendMailViewcontroller.m** 中,可使用以下代码来获取用户个人资料图片,将它上传到 OneDrive,用图片附件组合邮件请求,并发送邮件: 74 | 75 | ### 获取用户个人资料图片 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### 将图片上传到 OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### 将图片附件添加到新电子邮件中 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### 发送邮件 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | 有关详细信息(包括用于调用其他服务(如 OneDrive)的代码),请参阅[适用于 iOS 的 Microsoft Graph SDK](https://github.com/microsoftgraph/msgraph-sdk-ios) 130 | 131 | ## 问题和意见 132 | 133 | 我们乐意倾听你有关 Office 365 iOS Microsoft Graph Connect 项目的反馈。你可以在该存储库中的 [问题](https://github.com/microsoftgraph/iOS-objectivec-connect-sample/issues) 部分将问题和建议发送给我们。 134 | 135 | 与 Office 365 开发相关的问题一般应发布到[堆栈溢出](http://stackoverflow.com/questions/tagged/Office365+API)。确保您的问题或意见使用了 [Office365] 和 [MicrosoftGraph] 标记。 136 | 137 | ## 参与 138 | 你需要在提交拉取请求之前签署 [参与者许可协议](https://cla.microsoft.com/)。要完成参与者许可协议 (CLA),你需要通过表格提交请求,并在收到包含文件链接的电子邮件时在 CLA 上提交电子签名。 139 | 140 | 此项目采用 [Microsoft 开源行为准则](https://opensource.microsoft.com/codeofconduct/)。有关详细信息,请参阅 [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)(行为准则常见问题解答),有任何其他问题或意见,也可联系 [opencode@microsoft.com](mailto:opencode@microsoft.com)。 141 | 142 | ## 其他资源 143 | 144 | * [Office 开发人员中心](http://dev.office.com/) 145 | * [Microsoft Graph 概述页](https://graph.microsoft.io) 146 | * [使用 CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## 版权 149 | 版权所有 (c) 2016 Microsoft。保留所有权利。 150 | -------------------------------------------------------------------------------- /README-Localized/README-zh-tw.md: -------------------------------------------------------------------------------- 1 | # 使用 Microsoft Graph SDK 的 Office 365 Connect 範例 (適用於 iOS) 2 | 3 | Microsoft Graph 是存取資料的統一端點、來自 Microsoft 雲端的關係和見解。此範例示範如何連接和驗證,然後透過 [Microsoft Graph SDK for iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 呼叫郵件和使用者 API。 4 | 5 | > 附註:嘗試可簡化註冊的 [Microsoft Graph 應用程式註冊入口網站](https://apps.dev.microsoft.com)頁面,以便您能更快速地執行這個範例。 6 | 7 | ## 必要條件 8 | * 從 Apple 下載 [Xcode](https://developer.apple.com/xcode/downloads/)。 9 | 10 | * 安裝 [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 做為相依性管理員。 11 | * Microsoft 工作或個人電子郵件帳戶,例如 Office 365,或 outlook.com、hotmail.com 等等。您可以註冊 [Office 365 開發人員訂用帳戶](https://aka.ms/devprogramsignup),其中包含開始建置 Office 365 應用程式所需的資源。 12 | 13 | > 附註:如果您已有訂用帳戶,則先前的連結會讓您連到顯示*抱歉,您無法將之新增到您目前的帳戶*訊息的頁面。在此情況下,請使用您目前的 Office 365 訂用帳戶所提供的帳戶。 14 | * 已註冊應用程式的用戶端識別碼,來自 [Microsoft Graph 應用程式註冊入口網站](https://apps.dev.microsoft.com) 15 | * 若要提出要求,必須提供 **MSAuthenticationProvider**,它能夠以適當的 OAuth 2.0 持有人權杖驗證 HTTPS 要求。我們會針對 MSAuthenticationProvider 的範例實作使用 [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter),可以用來幫助您的專案。請參閱以下區段**感興趣的程式碼**以取得詳細資訊。 16 | 17 | 18 | ## 在 Xcode 中執行這個範例 19 | 20 | 1. 複製此儲存機制 21 | 2. 如果尚未安裝,請從 **Terminal** 應用程式執行下列命令,以安裝及設定 CocoaPods 相依性管理員。 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. 使用 CocoaPods 來匯入 Microsoft Graph SDK 和驗證相依性: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | 此範例應用程式已經包含可將 pods 放入專案的 podfile。只需瀏覽至 podfile 所在的專案根目錄,並從 **Terminal** 執行: 34 | 35 | pod install 36 | 37 | 如需詳細資訊,請參閱[其他資訊](#AdditionalResources)中的**使用 CocoaPods** 38 | 39 | 3. 開啟 **ios-objectivec-sample.xcworkspace** 40 | 4. 開啟 **AuthenticationConstants.m**。您會發現註冊程序的 **ClientID** 可以新增至檔案頂端: 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | 您會發現已為此專案設定下列權限範圍: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >附註:服務呼叫在此專案中使用,將郵件傳送至您的郵件帳戶、上傳圖片至 OneDrive,並且擷取一些設定檔資訊 (顯示名稱、電子郵件地址、設定檔圖片) 需要這些權限才能讓應用程式適當地執行。 55 | 56 | 5. 執行範例。系統會要求您連接/驗證工作或個人郵件帳戶,然後您才可以將郵件傳送至該帳戶,或者傳送至其他選取的電子郵件帳戶。 57 | 58 | 59 | ## 感興趣的程式碼 60 | 61 | 所有的驗證程式碼可以在 **AuthenticationProvider.m** 檔案中檢視。我們使用從 [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) 延伸的 MSAuthenticationProvider 的範例實作,以提供已註冊原生應用程式的登入支援、自動重新整理存取權杖,以及登出功能: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | 一旦設定驗證提供者,我們可以建立和初始化用戶端物件 (MSGraphClient),用來針對 Microsoft Graph 服務端點 (郵件和使用者) 進行呼叫。在 **SendMailViewcontroller.m** 中,我們可以使用下列程式碼取得使用者圖片、加以上傳至 OneDrive、組合郵件要求與圖片附件,並且傳送它︰ 74 | 75 | ### 取得使用者的設定檔圖片 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### 將圖片上傳到 OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### 新增圖片附件到新的電子郵件 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### 傳送郵件 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | 如需詳細資訊,包括用來呼叫至其他服務 (像是 OneDrive) 的程式碼,請參閱 [Microsoft Graph SDK for iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 130 | 131 | ## 問題和建議 132 | 133 | 我們很樂於收到您對於 Office 365 iOS Microsoft Graph Connect 專案的意見反應。您可以在此儲存機制的[問題](https://github.com/microsoftgraph/iOS-objectivec-connect-sample/issues)區段中,將您的問題及建議傳送給我們。 134 | 135 | 請在 [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API) 提出有關 Office 365 開發的一般問題。務必以 [Office365] 和 [MicrosoftGraph] 標記您的問題或意見。 136 | 137 | ## 參與 138 | 您必須在提交您的提取要求之前,先簽署[投稿者授權合約](https://cla.microsoft.com/)。若要完成投稿者授權合約 (CLA),您必須透過表單提交要求,然後在您收到含有文件連結的電子郵件時以電子方式簽署 CLA。 139 | 140 | 此專案已採用 [Microsoft 開放原始碼執行](https://opensource.microsoft.com/codeofconduct/)。如需詳細資訊,請參閱[程式碼執行常見問題集](https://opensource.microsoft.com/codeofconduct/faq/),如果有其他問題或意見,請連絡 [opencode@microsoft.com](mailto:opencode@microsoft.com)。 141 | 142 | ## 其他資源 143 | 144 | * [Office 開發人員中心](http://dev.office.com/) 145 | * [Microsoft Graph 概觀頁面](https://graph.microsoft.io) 146 | * [使用 CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## 著作權 149 | Copyright (c) 2016 Microsoft.著作權所有,並保留一切權利。 150 | -------------------------------------------------------------------------------- /README-Localized/README-ja-jp.md: -------------------------------------------------------------------------------- 1 | # Microsoft Graph SDK を使用した iOS 用 Office 365 Connect サンプル 2 | 3 | Microsoft Graph は、Microsoft Cloud からのデータ、リレーションシップおよびインサイトにアクセスするための統合エンドポイントです。このサンプルでは、これに接続して認証し、[Microsoft Graph SDK for iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 経由でメールとユーザーの API を呼び出す方法を示します。 4 | 5 | > 注:このサンプルをより迅速に実行するため、登録手順が簡略化された「[Microsoft Graph アプリ登録ポータル](https://apps.dev.microsoft.com)」ページをお試しください。 6 | 7 | ## 前提条件 8 | * Apple 社の [Xcode](https://developer.apple.com/xcode/downloads/) をダウンロードする。 9 | 10 | * 依存関係マネージャーとしての [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) のインストール。 11 | * Office 365、outlook.com、hotmail.com などの、Microsoft の職場または個人用のメール アカウント。Office 365 アプリのビルドを開始するために必要なリソースを含む、[Office 365 Developer サブスクリプション](https://aka.ms/devprogramsignup)にサインアップできます。 12 | 13 | > 注:サブスクリプションをすでにお持ちの場合、上記のリンクをクリックすると、「*申し訳ございません。現在のアカウントに追加できません*」というメッセージが表示されるページに移動します。その場合は、現在使用している Office 365 サブスクリプションのアカウントをご利用いただけます。 14 | * [Microsoft Graph アプリ登録ポータル](https://apps.dev.microsoft.com) で登録済みのアプリのクライアント ID 15 | * 要求を実行するには、適切な OAuth 2.0 ベアラー トークンを使用して HTTPS 要求を認証できる **MSAuthenticationProvider** を指定する必要があります。プロジェクトのジャンプ スタート用に使用できる MSAuthenticationProvider をサンプル実装するために、[msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) を使用します。詳細については、以下の「**目的のコード**」セクションをご覧ください。 16 | 17 | 18 | ## Xcode でこのサンプルを実行する 19 | 20 | 1. このリポジトリの複製を作成する 21 | 2. これが既にインストールされていない場合、**ターミナル** アプリから以下のコマンドを実行して、CocoaPods の依存関係のマネージャーをインストールして設定します。 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. CocoaPods を使用して、Microsoft Graph SDK と認証の依存関係をインポートします: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | このサンプル アプリには、プロジェクトに pod を取り込む podfile が既に含まれています。ここで、profile のあるプロジェクト ルートに移動し、**ターミナル**から以下を実行します: 34 | 35 | pod install 36 | 37 | 詳細については、[その他のリソース](#AdditionalResources)の「**CocoaPods を使う**」を参照してください 38 | 39 | 3. **ios-objectivec-sample.xcworkspace** を開きます 40 | 4. **AuthenticationConstants.m** を開きます。登録プロセスの **ClientID** がファイルの一番上に追加されていることがわかります。 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | このプロジェクトに対して次のアクセス許可の適用範囲が構成されていることがわかります。 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >注: このプロジェクトで使用されるサービス呼び出し、メール アカウントへのメールの送信、OneDrive への画像のアップロード、および一部のプロファイル情報 (表示名、メール アドレス、プロファイル画像) の取得では、アプリが適切に実行するためにこれらのアクセス許可が必要です。 55 | 56 | 5. サンプルを実行します。職場または個人用のメール アカウントに接続または認証するように求められ、そのアカウントか、別の選択したメール アカウントにメールを送信することができます。 57 | 58 | 59 | ## 目的のコード 60 | 61 | すべての認証コードは、**AuthenticationProvider.m** ファイルで確認することができます。[NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) から拡張された MSAuthenticationProvider のサンプル実装を使用して、登録済みのネイティブ アプリのログインのサポート、アクセス トークンの自動更新、およびログアウト機能を提供します: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | 認証プロバイダーを設定すると、Microsoft Graph サービス エンドポイント (メールとユーザー) に対して呼び出しを実行するために使用されるクライアント オブジェクト (MSGraphClient) を作成および初期化できます。**SendMailViewcontroller.m** では、次のコードを使用してユーザーのプロファイル画像を取得し、OneDrive にアップロードします。また、画像ファイルを添付したメール要求をアセンブルして送信できます。 74 | 75 | ### ユーザーのプロファイル画像を取得する 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### 画像を OneDrive にアップロードする 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### 新しいメール メッセージに画像の添付ファイルを追加する 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### メール メッセージを送信する 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | OneDrive のような他のサービスへの呼び出しを行うコードなどの詳細については、「[Microsoft Graph SDK for iOS](https://github.com/microsoftgraph/msgraph-sdk-ios)」を参照してください 130 | 131 | ## 質問とコメント 132 | 133 | Office 365 iOS Microsoft Graph Connect プロジェクトに関するフィードバックをお寄せください。質問や提案につきましては、このリポジトリの「[問題](https://github.com/microsoftgraph/iOS-objectivec-connect-sample/issues)」セクションで送信できます。 134 | 135 | Office 365 開発全般の質問につきましては、「[スタック オーバーフロー](http://stackoverflow.com/questions/tagged/Office365+API)」に投稿してください。質問またはコメントには、必ず [Office365] および [MicrosoftGraph] のタグを付けてください。 136 | 137 | ## 投稿 138 | プル要求を送信する前に、[投稿者のライセンス契約](https://cla.microsoft.com/)に署名する必要があります。投稿者のライセンス契約 (CLA) を完了するには、ドキュメントへのリンクを含むメールを受信した際に、フォームから要求を送信し、CLA に電子的に署名する必要があります。 139 | 140 | このプロジェクトでは、[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) が採用されています。詳細については、「[規範に関する FAQ](https://opensource.microsoft.com/codeofconduct/faq/)」を参照してください。または、その他の質問やコメントがあれば、[opencode@microsoft.com](mailto:opencode@microsoft.com) までにお問い合わせください。 141 | 142 | ## 追加リソース 143 | 144 | * [Office デベロッパー センター](http://dev.office.com/) 145 | * [Microsoft Graph の概要ページ](https://graph.microsoft.io) 146 | * [CocoaPods を使う](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## 著作権 149 | Copyright (c) 2016 Microsoft. All rights reserved. 150 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Office 365 Connect Sample for iOS (Objective C) Using the Microsoft Graph SDK 2 | 3 | Microsoft Graph is a unified endpoint for accessing data, relationships and insights that come from the Microsoft Cloud. This sample shows how to connect and authenticate to it, and then call mail and user APIs through the [Microsoft Graph SDK for iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 4 | 5 | > Note: Try out the [Microsoft Graph App Registration Portal](https://apps.dev.microsoft.com) page which simplifies registration so you can get this sample running faster. 6 | 7 | ## Prerequisites 8 | * Download [Xcode](https://developer.apple.com/xcode/downloads/) from Apple. 9 | 10 | * Installation of [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) as a dependency manager. 11 | * A Microsoft work or personal email account such as Office 365, or outlook.com, hotmail.com, etc. 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. 12 | 13 | > 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. 14 | * A client id from the registered app at [Microsoft Graph App Registration Portal](https://apps.dev.microsoft.com) 15 | * To make requests, an **MSAuthenticationProvider** must be provided which is capable of authenticating HTTPS requests with an appropriate OAuth 2.0 bearer token. We will be using [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) for a sample implementation of MSAuthenticationProvider that can be used to jump-start your project. See the below section **Code of Interest** for more information. 16 | 17 | 18 | ## Running this sample in Xcode 19 | 20 | 1. Clone this repository 21 | 2. If it is not already installed, run the following commands from the **Terminal** app to install and set up the CocoaPods dependency manager. 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. Use CocoaPods to import the Microsoft Graph SDK and authentication dependencies: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | This sample app already contains a podfile that will get the pods into the project. Simply navigate to the project root where the podfile is and from **Terminal** run: 34 | 35 | pod install 36 | 37 | For more information, see **Using CocoaPods** in [Additional Resources](#AdditionalResources) 38 | 39 | 3. Open **ios-objectivec-sample.xcworkspace** 40 | 4. Open **AuthenticationConstants.m**. You'll see that the **ClientID** from the registration process can be added to the top of the file.: 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | You'll notice that the following permission scopes have been configured for this project: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >Note: The service calls used in this project, sending a mail to your mail account, uploading a picture to OneDrive, and retrieving some profile information (Display Name, Email Address, profile picture) require these permissions for the app to run properly. 55 | 56 | 5. Run the sample. You'll be asked to connect/authenticate to a work or personal mail account, and then you can send a mail to that account, or to another selected email account. 57 | 58 | 59 | ## Code of Interest 60 | 61 | All authentication code can be viewed in the **AuthenticationProvider.m** file. We use a sample implementation of MSAuthenticationProvider extended from [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) to provide login support for registered native apps, automatic refreshing of access tokens, and logout functionality: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | Once the authentication provider is set, we can create and initialize a client object (MSGraphClient) that will be used to make calls against the Microsoft Graph service endpoint (mail and users). In **SendMailViewcontroller.m** we can get the user profile picture, upload it to OneDrive, assemble a mail request with picture attachment and send it using the following code: 74 | 75 | ### Get the user's profile picture 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### Upload the picture to OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### Add picture attachment to a new email message 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### Send the mail message 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | For more information, including code to call into other services like OneDrive, see the [Microsoft Graph SDK for iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 130 | 131 | ## Questions and comments 132 | 133 | 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/microsoftgraph/iOS-objectivec-connect-sample/issues) section of this repository. 134 | 135 | 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]. 136 | 137 | ## Contributing 138 | 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. 139 | 140 | 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. 141 | 142 | ## Additional resources 143 | 144 | * [Office Dev Center](http://dev.office.com/) 145 | * [Microsoft Graph overview page](https://graph.microsoft.io) 146 | * [Using CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## Copyright 149 | Copyright (c) 2016 Microsoft. All rights reserved. 150 | -------------------------------------------------------------------------------- /README-Localized/README-ru-ru.md: -------------------------------------------------------------------------------- 1 | # Приложение Office 365 Connect для iOS, использующее Microsoft Graph SDK 2 | 3 | Microsoft Graph — единая конечная точка для доступа к данным, отношениям и статистике из Microsoft Cloud. В этом примере показано, как подключиться к ней и пройти проверку подлинности, а затем вызывать почтовые и пользовательские API через [Microsoft Graph SDK для iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 4 | 5 | > Примечание. Воспользуйтесь упрощенной регистрацией на [портале регистрации приложений Microsoft Graph](https://apps.dev.microsoft.com), чтобы ускорить запуск этого примера. 6 | 7 | ## Предварительные требования 8 | * Скачивание [Xcode](https://developer.apple.com/xcode/downloads/) от Apple. 9 | 10 | * Установка [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) в качестве диспетчера зависимостей. 11 | * Рабочая или личная учетная запись Майкрософт, например Office 365, outlook.com или hotmail.com. Вы можете [подписаться на план Office 365 для разработчиков](https://aka.ms/devprogramsignup), который включает ресурсы, необходимые для создания приложений Office 365. 12 | 13 | > Примечание. Если у вас уже есть подписка, при выборе приведенной выше ссылки откроется страница с сообщением *К сожалению, вы не можете добавить это к своей учетной записи*. В этом случае используйте учетную запись, связанную с текущей подпиской на Office 365. 14 | * Идентификатор клиента из приложения, зарегистрированного на [портале регистрации приложений Microsoft Graph](https://apps.dev.microsoft.com) 15 | * Чтобы отправлять запросы, необходимо указать протокол **MSAuthenticationProvider**, который способен проверять подлинность HTTPS-запросов с помощью соответствующего маркера носителя OAuth 2.0. Для реализации протокола MSAuthenticationProvider и быстрого запуска проекта мы будем использовать [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter). Дополнительные сведения см. в разделе **Полезный код**. 16 | 17 | 18 | ## Запуск этого примера в Xcode 19 | 20 | 1. Клонируйте этот репозиторий 21 | 2. Если диспетчер зависимостей CocoaPods еще не установлен, запустите указанные ниже команды из приложения **Терминал**, чтобы установить и настроить его. 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. Используйте CocoaPods, чтобы импортировать пакет SDK Microsoft Graph и зависимости проверки подлинности: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | Этот пример приложения уже содержит podfile, который добавит компоненты pod в проект. Просто перейдите к корню проекта, где находится podfile, и в разделе **Терминал** запустите указанный код. 34 | 35 | pod install 36 | 37 | Для получения дополнительной информации перейдите по ссылке **Использование CocoaPods** в разделе [Дополнительные ресурсы](#AdditionalResources). 38 | 39 | 3. Откройте **ios-objectivec-sample.xcworkspace** 40 | 4. Откройте **AuthenticationConstants.m**. Вы увидите, что в верхнюю часть файла можно добавить **идентификатор клиента**, скопированный в ходе регистрации: 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | Вы заметите, что для этого проекта настроены следующие разрешения: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >Примечание. Эти разрешения необходимы для правильной работы приложения, в частности отправки сообщения в учетную запись почты, загрузки изображения в OneDrive и получения информации из профиля (отображаемое имя, адрес электронной почты, аватар). 55 | 56 | 5. Запустите приложение. Вам будет предложено подключить рабочую или личную учетную запись почты и войти в нее, после чего вы сможете отправить сообщение в эту или другую учетную запись. 57 | 58 | 59 | ## Полезный код 60 | 61 | Весь код для проверки подлинности можно найти в файле **AuthenticationProvider.m**. Мы используем протокол MSAuthenticationProvider из файла [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) для поддержки входа в зарегистрированных собственных приложениях, автоматического обновления маркеров доступа и выхода: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | Если поставщик проверки подлинности настроен, мы можем создать и инициализировать объект клиента (MSGraphClient), который будет использоваться для вызова службы Microsoft Graph (почта и пользователи). В **SendMailViewcontroller.m** мы можем получить аватар пользователя, загрузить его в OneDrive, собрать почтовый запрос с вложенным изображением и отправить его, используя следующий код: 74 | 75 | ### Получение аватара пользователя 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### Отправка изображения в OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### Добавление вложенного изображения к новому сообщению 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### Отправка сообщения 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | Дополнительные сведения, в том числе код для вызова других служб, например OneDrive, см. в статье [Microsoft Graph SDK для iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 130 | 131 | ## Вопросы и комментарии 132 | 133 | Мы будем рады узнать ваше мнение о проекте Office 365 Connect для iOS, использующем Microsoft Graph. Вы можете отправлять нам вопросы и предложения на вкладке [Issues](https://github.com/microsoftgraph/iOS-objectivec-connect-sample/issues) этого репозитория. 134 | 135 | Общие вопросы о разработке решений для Office 365 следует публиковать на сайте [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Обязательно помечайте свои вопросы и комментарии тегами [Office365] и [MicrosoftGraph]. 136 | 137 | ## Участие 138 | Прежде чем отправить запрос на включение внесенных изменений, необходимо подписать [лицензионное соглашение с участником](https://cla.microsoft.com/). Чтобы заполнить лицензионное соглашение с участником (CLA), вам потребуется отправить запрос с помощью формы, а затем после получения электронного сообщения со ссылкой на этот документ подписать CLA с помощью электронной подписи. 139 | 140 | Этот проект соответствует [правилам поведения Майкрософт, касающимся обращения с открытым кодом](https://opensource.microsoft.com/codeofconduct/). Читайте дополнительные сведения в [разделе вопросов и ответов по правилам поведения](https://opensource.microsoft.com/codeofconduct/faq/) или отправляйте новые вопросы и замечания по адресу [opencode@microsoft.com](mailto:opencode@microsoft.com). 141 | 142 | ## Дополнительные ресурсы 143 | 144 | * [Центр разработки для Office](http://dev.office.com/) 145 | * [Страница с общими сведениями о Microsoft Graph](https://graph.microsoft.io) 146 | * [Использование CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## Авторское право 149 | (c) Корпорация Майкрософт (Microsoft Corporation), 2016. Все права защищены. 150 | -------------------------------------------------------------------------------- /README-Localized/README-pt-br.md: -------------------------------------------------------------------------------- 1 | # Exemplo de conexão com o Office 365 para iOS usando o SDK do Microsoft Graph 2 | 3 | O Microsoft Graph é um ponto de extremidade unificado para acessar dados, relações e ideias que vêm do Microsoft Cloud. Este exemplo mostra como realizar a conexão e a autenticação no Microsoft Graph e, em seguida, chamar APIs de mala direta e usuário por meio do [SDK do Microsoft Graph para iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 4 | 5 | > Observação: Experimente a página [Portal de Registro de Aplicativos do Microsoft Graph](https://apps.dev.microsoft.com) que simplifica o registro para que você possa executar este exemplo com mais rapidez. 6 | 7 | ## Pré-requisitos 8 | * Baixe o [Xcode](https://developer.apple.com/xcode/downloads/) da Apple 9 | 10 | * Instalação do [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) como um gerente de dependências. 11 | * Uma conta de email comercial ou pessoal da Microsoft como o Office 365, ou outlook.com, hotmail.com, etc. Inscreva-se em uma [Assinatura do Office 365 para Desenvolvedor](https://aka.ms/devprogramsignup) que inclua os recursos necessários para começar a criar aplicativos do Office 365. 12 | 13 | > 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. 14 | * Uma ID de cliente do aplicativo registrado no [Portal de Registro de Aplicativos do Microsoft Graph](https://apps.dev.microsoft.com) 15 | * Para realizar solicitações de autenticação, um **MSAuthenticationProvider** deve ser fornecido para autenticar solicitações HTTPS com um token de portador OAuth 2.0 apropriado. Usaremos [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) para uma implementação de exemplo de MSAuthenticationProvider que pode ser usado para iniciar rapidamente o projeto. Para saber mais, confira a seção abaixo **Código de Interesse** 16 | 17 | 18 | ## Executando este exemplo em Xcode 19 | 20 | 1. Clonar este repositório 21 | 2. Se não estiver instalado, execute os seguintes comandos do aplicativo **Terminal** para instalar e configurar o gerenciador de dependências do CocoaPods. 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. Use o CocoaPods para importar as dependências de autenticação e o SDK do Microsoft Graph: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | Este aplicativo de exemplo já contém um podfile que colocará os pods no projeto. Basta acessar a raiz do projeto em que o podfile está armazenado e no **Terminal** executar: 34 | 35 | pod install 36 | 37 | Para saber mais, confira o artigo **Usar o CocoaPods** em [Recursos Adicionais](#AdditionalResources) 38 | 39 | 3. Abra **ios-objectivec-sample.xcworkspace** 40 | 4. Abra **AuthenticationConstants.m**. Observe que você pode adicionar o valor de **ClientID** do processo de registro, na parte superior do arquivo. 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | Os escopos de permissão a seguir foram configurados para esse projeto: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >Observação: as chamadas de serviço usadas neste projeto, que enviam emails para sua conta de email, carregam imagens para o OneDrive e recuperam algumas informações de perfil (nome de exibição, endereço de email, imagem do perfil) exigem essas permissões para que o aplicativo seja executado corretamente. 55 | 56 | 5. Execute o exemplo. Você será solicitado a conectar/autenticar uma conta de email comercial ou pessoal e, em seguida, poderá enviar um email a essa conta ou a outra conta de email selecionada. 57 | 58 | 59 | ## Código de Interesse 60 | 61 | Todo código de autenticação pode ser visualizado no arquivo **AuthenticationProvider.m**. Usamos um exemplo de implementação do MSAuthenticationProvider estendida do [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) para fornecer suporte de logon a aplicativos nativos registrados, atualização automática de tokens de acesso e recursos de logoff: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | Depois que o provedor de autenticação estiver definido, podemos criar e inicializar um objeto de cliente (MSGraphClient) que será usado para fazer chamadas no ponto de extremidade do serviço do Microsoft Graph (email e usuários). Em **SendMailViewcontroller.m**, podemos obter a imagem do perfil do usuário, carregá-la para o OneDrive, montar uma solicitação de email com anexo de imagem e enviá-la usando o seguinte código: 74 | 75 | ### Obter a imagem do perfil do usuário 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### Carregar imagem para o OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### Adicionar anexo de imagem a uma nova mensagem de email 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### Enviar a mensagem de email 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | Para obter mais informações, incluindo código para chamar outros serviços, como o OneDrive, confira o [SDK do Microsoft Graph para iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 130 | 131 | ## Perguntas e comentários 132 | 133 | 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 nos enviar suas perguntas e sugestões por meio da seção [Issues](https://github.com/microsoftgraph/iOS-objectivec-connect-sample/issues) deste repositório. 134 | 135 | As perguntas sobre o desenvolvimento do Office 365 em geral devem ser postadas no [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Não deixe de marcar as perguntas ou comentários com [Office365] e [MicrosoftGraph]. 136 | 137 | ## Colaboração 138 | Será preciso assinar um [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. 139 | 140 | Este projeto adotou o [Código de Conduta do Código Aberto da Microsoft](https://opensource.microsoft.com/codeofconduct/). Para saber mais, confira as [Perguntas frequentes do Código de Conduta](https://opensource.microsoft.com/codeofconduct/faq/) ou contate [opencode@microsoft.com](mailto:opencode@microsoft.com) se tiver outras dúvidas ou comentários. 141 | 142 | ## Recursos adicionais 143 | 144 | * [Centro de Desenvolvimento do Office](http://dev.office.com/) 145 | * [Página de visão geral do Microsoft Graph](https://graph.microsoft.io) 146 | * [Usando o CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## Direitos autorais 149 | Copyright © 2016 Microsoft. Todos os direitos reservados. 150 | -------------------------------------------------------------------------------- /README-Localized/README-es-es.md: -------------------------------------------------------------------------------- 1 | # Ejemplo Connect de Office 365 para iOS con SDK de Microsoft Graph 2 | 3 | Microsoft Graph es un punto de conexión unificado para acceder a los datos, las relaciones y datos que proceden de Microsoft Cloud. Este ejemplo muestra cómo conectarse, autenticarse y, después, llamar a la API de usuario y correo a través del [SDK de Microsoft Graph para iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 4 | 5 | > Nota: Consulte la página del [Portal de registro de la aplicación de Microsoft Graph](https://apps.dev.microsoft.com) que simplifica el registro para poder conseguir que este ejemplo se ejecute más rápidamente. 6 | 7 | ## Requisitos previos 8 | * Descargue [Xcode](https://developer.apple.com/xcode/downloads/) de Apple. 9 | 10 | * Instale [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) como administrador de dependencias. 11 | * Una cuenta de correo electrónico personal o profesional de Microsoft como Office 365, outlook.com, hotmail.com, etc. Puede registrarse para [una suscripción de Office 365 Developer](https://aka.ms/devprogramsignup), que incluye los recursos que necesita para comenzar a crear aplicaciones de Office 365. 12 | 13 | > 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. 14 | * Un Id. de cliente de la aplicación registrada en el [Portal de registro de la aplicación de Microsoft Graph](https://apps.dev.microsoft.com) 15 | * Para realizar solicitudes, se debe proporcionar un **MSAuthenticationProvider** que sea capaz de autenticar solicitudes HTTPS con un token de portador OAuth 2.0 adecuado. Usaremos [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) para una implementación de MSAuthenticationProvider que puede usarse para poner en marcha el proyecto. Consulte la sección **Código de interés** para obtener más información. 16 | 17 | 18 | ## Ejecutar este ejemplo en Xcode 19 | 20 | 1. Clonar este repositorio 21 | 2. Si no está instalado ya, ejecute los comandos siguientes de la aplicación **Terminal** para instalar y configurar el administrador de dependencias CocoaPods. 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. Use CocoaPods para importar el SDK de Microsoft Graph y las dependencias de autenticación: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | Esta aplicación de ejemplo ya contiene un podfile que recibirá los pods en el proyecto. Solo tiene que ir a la raíz del proyecto donde esté el podfile y ejecutar desde **Terminal**: 34 | 35 | pod install 36 | 37 | Para obtener más información, consulte **Usar CocoaPods** en [Recursos adicionales](#AdditionalResources) 38 | 39 | 3. Abrir **ios-objectivec-sample.xcworkspace** 40 | 4. Abra **AuthenticationConstants.m**. Verá que el **ClientID** del proceso de registro se puede agregar en la parte superior del archivo: 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | Verá que los siguientes ámbitos de permiso se han configurado para este proyecto: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >Nota: Las llamadas de servicio usadas en este proyecto, el envío de un correo a su cuenta de correo, la carga de una imagen en OneDrive y la recuperación de parte de la información de perfil (nombre para mostrar, dirección de correo electrónico, imagen de perfil) requieren estos permisos para que la aplicación se ejecute correctamente. 55 | 56 | 5. Ejecute el ejemplo. Deberá conectarse a una cuenta de correo personal o profesional, o autenticarlas, y, después, puede enviar un correo a esa cuenta, o a otra cuenta de correo electrónico seleccionada. 57 | 58 | 59 | ## Código de interés 60 | 61 | Todos los códigos de autenticación que se pueden ver en el archivo **AuthenticationProvider.m**. Usamos una implementación de ejemplo de MSAuthenticationProvider de [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) para proporcionar compatibilidad de inicio de sesión a aplicaciones nativas registradas, actualización automática de los tokens de acceso y la característica de cierre de sesión: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | Una vez se defina el proveedor de autenticación, podemos crear e inicializar un objeto de cliente (MSGraphClient) que se usará para realizar llamadas en el punto de conexión de servicio de Microsoft Graph (correo y usuarios). En **SendMailViewcontroller.m** podemos obtener la foto de perfil del usuario, cargarla en OneDrive, ensamblar una solicitud de correo con una imagen adjunta y enviarla mediante el código siguiente: 74 | 75 | ### Obtener la imagen del perfil del usuario. 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### Cargar la la imagen en OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### Agregar la imagen adjunta a un nuevo mensaje de correo electrónico 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### Enviar el mensaje de correo electrónico 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | Para obtener más información, incluido el código para llamar a otros servicios, como OneDrive, consulte el [GDK de Microsoft Graph para iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) 130 | 131 | ## Preguntas y comentarios 132 | 133 | 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/microsoftgraph/iOS-objectivec-connect-sample/issues) de este repositorio. 134 | 135 | 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]. 136 | 137 | ## Colaboradores 138 | 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, después, firmar electrónicamente el CLA cuando reciba el correo electrónico que contiene el vínculo al documento. 139 | 140 | Este proyecto ha adoptado el [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) (Código de conducta de código abierto de Microsoft). Para obtener más información, consulte las [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) (Preguntas más frecuentes del código de conducta) o póngase en contacto con [opencode@microsoft.com](mailto:opencode@microsoft.com) con otras preguntas o comentarios. 141 | 142 | ## Recursos adicionales 143 | 144 | * [Centro de desarrollo de Office](http://dev.office.com/) 145 | * [Página de información general de Microsoft Graph](https://graph.microsoft.io) 146 | * [Usar CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## Copyright 149 | Copyright (c) 2016 Microsoft. Todos los derechos reservados. 150 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/SendMailViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. 3 | * See LICENSE in the project root for license information. 4 | */ 5 | 6 | #import "SendMailViewController.h" 7 | #import 8 | #import "ConnectViewController.h" 9 | #import "AuthenticationProvider.h" 10 | 11 | 12 | @interface SendMailViewController() 13 | 14 | @property (strong, nonatomic) IBOutlet UILabel *headerLabel; 15 | @property (strong, nonatomic) IBOutlet UITextView *statusTextView; 16 | @property (strong, nonatomic) IBOutlet UITextField *emailTextField; 17 | @property (strong, nonatomic) IBOutlet UIButton *sendMailButton; 18 | @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; 19 | @property (strong, nonatomic) NSString *emailAddress; 20 | @property (strong, nonatomic) MSGraphClient *graphClient; 21 | @property (strong, nonatomic) NSString *pictureWebUrl; 22 | @property (strong, nonatomic) UIImage *userPicture; 23 | @property (strong, nonatomic) IBOutlet UINavigationItem *appTitle; 24 | @property (strong, nonatomic) IBOutlet UIBarButtonItem *disconnectButton; 25 | @property (strong, nonatomic) IBOutlet UITextView *descriptionLabel; 26 | 27 | @end 28 | 29 | 30 | 31 | @implementation SendMailViewController 32 | 33 | 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | 37 | self.title = NSLocalizedString(@"GRAPH_TITLE", comment: ""); 38 | self.disconnectButton.title = NSLocalizedString(@"DISCONNECT", comment: ""); 39 | self.sendMailButton.enabled = false; 40 | self.descriptionLabel.text = NSLocalizedString(@"DESCRIPTION", comment: ""); 41 | [self.sendMailButton setTitle:(NSLocalizedString(@"SEND", comment: "")) forState:normal]; 42 | 43 | [MSGraphClient setAuthenticationProvider:self.authenticationProvider.authProvider]; 44 | self.graphClient = [MSGraphClient client]; 45 | [self getUserInfo:(self.emailAddress) completion:^( NSError *error) { 46 | if (!error) { 47 | [self getUserPicture:(self.emailAddress) completion:^(UIImage *image, NSError *error) { 48 | 49 | if (!error) { 50 | self.userPicture = image; 51 | 52 | } else { 53 | //get the test image out of the project resources 54 | self.userPicture = [UIImage imageNamed:(@"test.png")]; 55 | } 56 | [self uploadPictureToOneDrive:(self.userPicture) completion:^(NSString *webUrl, NSError *error) { 57 | if (!error) { 58 | self.pictureWebUrl = webUrl; 59 | 60 | dispatch_async(dispatch_get_main_queue(), ^{ 61 | self.sendMailButton.enabled = true; 62 | }); 63 | } else { 64 | dispatch_async(dispatch_get_main_queue(), ^{ 65 | NSLog(NSLocalizedString(@"ERROR", ""), error.localizedDescription); 66 | self.statusTextView.text = NSLocalizedString(@"PICTURE_UPLOAD_FAILURE", comment: ""); 67 | }); 68 | 69 | } 70 | 71 | }]; 72 | 73 | }]; 74 | } 75 | }]; 76 | 77 | } 78 | 79 | -(void)viewWillAppear:(BOOL)animated{ 80 | [super viewWillAppear:animated]; 81 | [self.navigationItem setHidesBackButton:YES]; 82 | 83 | } 84 | 85 | - (IBAction)sendMailTapped:(id)sender { 86 | [self sendMail]; 87 | } 88 | 89 | - (IBAction)disconnectTapped:(id)sender { 90 | [self.authenticationProvider disconnect]; 91 | [self.navigationController popViewControllerAnimated:YES]; 92 | } 93 | 94 | 95 | //Send mail to the specified user in the email text field 96 | -(void) sendMail { 97 | 98 | MSGraphMessage *message = [self getSampleMessage]; 99 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.graphClient me]sendMailWithMessage:message saveToSentItems:true]; 100 | NSLog(@"%@", requestBuilder); 101 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 102 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 103 | if(!error){ 104 | NSLog(@"response %@", response); 105 | 106 | dispatch_async(dispatch_get_main_queue(), ^{ 107 | self.statusTextView.text = NSLocalizedString(@"SEND_SUCCESS", comment: ""); 108 | self.descriptionLabel.text = @"Check your inbox. You have a new message :)"; 109 | }); 110 | } 111 | else { 112 | dispatch_async(dispatch_get_main_queue(), ^{ 113 | NSLog(NSLocalizedString(@"ERROR", ""), error.localizedDescription); 114 | self.statusTextView.text = NSLocalizedString(@"SEND_FAILURE", comment: ""); 115 | }); 116 | } 117 | }]; 118 | 119 | } 120 | 121 | 122 | #pragma mark - Helper Methods 123 | //Retrieve the logged in user's display name and email address 124 | -(void) getUserInfo: (NSString *)url completion:(void(^) ( NSError*))completionBlock{ 125 | 126 | [[[self.graphClient me]request]getWithCompletion:^(MSGraphUser *response, NSError *error) { 127 | if(!error){ 128 | dispatch_async(dispatch_get_main_queue(), ^{ 129 | self.emailAddress = response.userPrincipalName; 130 | self.emailTextField.text = self.emailAddress; 131 | self.headerLabel.text = [NSString stringWithFormat:(NSLocalizedString(@"HI_USER", comment "")), response.displayName]; 132 | self.statusTextView.text = NSLocalizedString(@"USER_INFO_LOAD_SUCCESS", comment: ""); 133 | }); 134 | 135 | completionBlock(nil); 136 | } 137 | else{ 138 | dispatch_async(dispatch_get_main_queue(), ^{ 139 | self.statusTextView.text = NSLocalizedString(@"USER_INFO_LOAD_FAILURE", comment: ""); 140 | NSLog(NSLocalizedString(@"ERROR", ""), error.localizedDescription); 141 | }); 142 | completionBlock(error); 143 | } 144 | }]; 145 | 146 | } 147 | 148 | -(void) uploadPictureToOneDrive: (UIImage *) image completion:(void(^) (NSString*, NSError*))completionBlock{ 149 | 150 | NSData *data = UIImagePNGRepresentation(image); 151 | [[[[[[[self.graphClient me] 152 | drive] 153 | root] 154 | children] 155 | driveItem:(@"me.png")] 156 | contentRequest] 157 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 158 | 159 | if (!error) { 160 | NSString *webUrl = response.webUrl; 161 | completionBlock(webUrl, error); 162 | } else { 163 | dispatch_async(dispatch_get_main_queue(), ^{ 164 | self.statusTextView.text = NSLocalizedString(@"USER_GET_PICTURE_FAILURE", comment: ""); 165 | NSLog(NSLocalizedString(@"ERROR", ""), error.localizedDescription); 166 | }); 167 | } 168 | }]; 169 | 170 | } 171 | 172 | -(void) getUserPicture: (NSString *)url completion:(void(^) (UIImage*, NSError*))completionBlock { 173 | 174 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 175 | //code 176 | if (!error) { 177 | NSData *data = [NSData dataWithContentsOfURL:location]; 178 | UIImage *img = [[UIImage alloc] initWithData:data]; 179 | completionBlock(img, error); 180 | } else{ 181 | completionBlock(nil, error); 182 | 183 | } 184 | }]; 185 | } 186 | 187 | //Create a sample test message to send to specified user account 188 | -(MSGraphMessage*) getSampleMessage{ 189 | MSGraphMessage *message = [[MSGraphMessage alloc]init]; 190 | MSGraphRecipient *toRecipient = [[MSGraphRecipient alloc]init]; 191 | MSGraphEmailAddress *email = [[MSGraphEmailAddress alloc]init]; 192 | 193 | //need to get email text field for send to! 194 | 195 | email.address = self.emailAddress; 196 | toRecipient.emailAddress = email; 197 | 198 | NSMutableArray *toRecipients = [[NSMutableArray alloc]init]; 199 | [toRecipients addObject:toRecipient]; 200 | 201 | message.subject = NSLocalizedString(@"MAIL_SUBJECT", comment: ""); 202 | 203 | MSGraphItemBody *emailBody = [[MSGraphItemBody alloc]init]; 204 | NSString *htmlContentPath = [[NSBundle mainBundle] pathForResource:@"EmailBody" ofType:@"html"]; 205 | NSString *htmlContentString = [NSString stringWithContentsOfFile:htmlContentPath encoding:NSUTF8StringEncoding error:nil]; 206 | 207 | emailBody.content = htmlContentString; 208 | NSString *replaceString = @"a href="; 209 | replaceString = [replaceString stringByAppendingString:(self.pictureWebUrl)]; 210 | emailBody.content = [emailBody.content stringByReplacingOccurrencesOfString:(@"a href=%s") withString:(replaceString)]; 211 | emailBody.contentType = [MSGraphBodyType html]; 212 | message.body = emailBody; 213 | 214 | message.toRecipients = toRecipients; 215 | 216 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 217 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 218 | fileAttachment.contentType = @"image/png"; 219 | 220 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 221 | 222 | fileAttachment.contentBytes = decodedString; 223 | fileAttachment.name = @"me.png"; 224 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 225 | return message; 226 | 227 | } 228 | 229 | 230 | @end 231 | -------------------------------------------------------------------------------- /README-Localized/README-de-de.md: -------------------------------------------------------------------------------- 1 | # Office 365 Connect-Beispiel für iOS unter Verwendung des Microsoft Graph-SDKs 2 | 3 | Microsoft Graph ist ein einheitlicher Endpunkt für den Zugriff auf Daten, Beziehungen und Erkenntnisse, die von der Microsoft-Cloud stammen. In diesem Beispiel wird gezeigt, wie Sie eine Verbindung damit herstellen und die Authentifizierung ausführen, und dann E-Mails und Benutzer-APIs über das [Microsoft Graph-SDK für iOS](https://github.com/microsoftgraph/msgraph-sdk-ios) aufrufen. 4 | 5 | > Hinweis: Testen Sie die Seite des [App-Registrierungsportals von Microsoft Graph](https://apps.dev.microsoft.com), durch das die Registrierung erleichtert wird, sodass Sie schneller mit diesem Beispiel loslegen können. 6 | 7 | ## Voraussetzungen 8 | * Herunterladen von [Xcode](https://developer.apple.com/xcode/downloads/) von Apple. 9 | 10 | * Installation von [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) als ein Abhängigkeits-Manager. 11 | * Ein geschäftliches oder persönliches Microsoft-E-Mail-Konto, z. B. Office 365 oder outlook.com, hotmail.com usw. 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. 12 | 13 | > 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. 14 | * Eine Client-ID aus der registrierten App unter dem [App-Registrierungsportal von Microsoft Graph](https://apps.dev.microsoft.com) 15 | * Um Anforderungen auszuführen, muss ein **MSAuthenticationProvider** bereitgestellt werden, der HTTPS-Anforderungen mit einem entsprechenden OAuth 2.0-Bearertoken authentifizieren kann. Wir verwenden [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) für eine Beispielimplementierung von MSAuthenticationProvider, die Sie für einen Schnelleinstieg in Ihr Projekt verwenden können. Weitere Informationen finden Sie im folgenden Abschnitt **Interessanter Code**. 16 | 17 | 18 | ## Ausführen dieses Beispiels in Xcode 19 | 20 | 1. Klonen dieses Repositorys 21 | 2. Wenn nicht bereits installiert, führen Sie die folgenden Befehle aus der **Terminal**-App aus, um den CocoaPods-Abhängigkeits-Manager zu installieren und einzurichten. 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. Verwenden Sie CocoaPods, um das Microsoft Graph-SDK und Authentifizierungsabhängigkeiten zu importieren: 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | Diese Beispiel-App enthält bereits eine POD-Datei, die die Pods in das Projekt überträgt. Navigieren Sie einfach zum Stammordner des Projekts, in dem sich die Podfile befindet, und führen Sie von **Terminal** Folgendes aus: 34 | 35 | pod install 36 | 37 | Weitere Informationen finden Sie im Thema über das **Verwenden von CocoaPods** in [Zusätzliche Ressourcen](#AdditionalResources). 38 | 39 | 3. Öffnen Sie **Ios-Objectivec-sample.xcworkspace**. 40 | 4. Öffnen Sie **AuthenticationConstants.m**. Sie werden sehen, dass die **ClientID** aus dem Registrierungsprozess am Anfang der Datei hinzugefügt werden kann: 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | Sie stellen fest, dass die folgenden Berechtigungsumfänge für dieses Projekt konfiguriert wurden: 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >Die in diesem Projekt verwendeten Dienstaufrufe, also das Senden einer E-Mail an Ihr E-Mail-Konto, das Hochladen eines Bilds in OneDrive und das Abrufen einiger Profilinformationen (Anzeigename, E-Mail-Adresse. Profilbild), benötigen diese Berechtigungen, damit die App ordnungsgemäß ausgeführt wird. 55 | 56 | 5. Führen Sie das Beispiel aus. Sie werden aufgefordert, eine Verbindung zu einem geschäftlichen oder persönlichen E-Mail-Konto herzustellen oder zu authentifizieren. Dann können Sie eine E-Mail an dieses Konto oder an ein anderes ausgewähltes E-Mail-Konto senden. 57 | 58 | 59 | ## Interessanter Code 60 | 61 | Der gesamte Authentifizierungscode kann in der Datei **AuthenticationProvider.m** angezeigt werden. Wir verwenden eine Beispielimplementierung von MSAuthenticationProvider, die über [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) hinaus erweitert wurde, um Anmeldeinformationen für registrierte systemeigene Apps, eine automatische Aktualisierung von Zugriffstoken sowie eine Abmeldefunktion bereitzustellen: 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | Nachdem der Authentifizierungsanbieter festgelegt wurde, können wir ein Clientobjekt (MSGraphClient) erstellen und initialisieren, das für Aufrufe des Microsoft Graph-Dienstendpunkts (E-Mail und Benutzer) verwendet wird. In **SendMailViewcontroller.swift** können wir das Benutzerprofilbild abrufen, dieses in OneDrive hochladen, eine E-Mail-Anforderung mit Bildanhang erstellen und diese mit dem folgenden Code senden: 74 | 75 | ### Die URL des Profilbilds des Benutzers abrufen 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### Hochladen des Bilds in OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### Hinzufügen einer Bildanhang zu einer neuen E-Mail-Nachricht 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### Senden der E-Mail-Nachricht 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | Weitere Informationen, einschließlich des Codes zum Aufrufen anderer Dienste wie OneDrive, finden Sie im [Microsoft Graph-SDK für iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 130 | 131 | ## Fragen und Kommentare 132 | 133 | 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/microsoftgraph/iOS-objectivec-connect-sample/issues) dieses Repositorys senden. 134 | 135 | Allgemeine Fragen zur Office 365-Entwicklung sollten in [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API) gestellt werden. Stellen Sie sicher, dass Ihre Fragen oder Kommentare mit [Office365] und [MicrosoftGraph] markiert sind. 136 | 137 | ## Mitwirkung 138 | 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. 139 | 140 | In diesem Projekt wurden die [Microsoft Open Source-Verhaltensregeln](https://opensource.microsoft.com/codeofconduct/) übernommen. Weitere Informationen finden Sie unter [Häufig gestellte Fragen zu Verhaltensregeln](https://opensource.microsoft.com/codeofconduct/faq/), oder richten Sie Ihre Fragen oder Kommentare an [opencode@microsoft.com](mailto:opencode@microsoft.com). 141 | 142 | ## Zusätzliche Ressourcen 143 | 144 | * [Office Dev Center](http://dev.office.com/) 145 | * [Microsoft Graph-Übersichtsseite](https://graph.microsoft.io) 146 | * [Verwenden von CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## Copyright 149 | Copyright (c) 2016 Microsoft. Alle Rechte vorbehalten. 150 | -------------------------------------------------------------------------------- /README-Localized/README-fr-fr.md: -------------------------------------------------------------------------------- 1 | # Exemple de connexion d’Office 365 pour iOS avec le kit de développement logiciel Microsoft Graph 2 | 3 | Microsoft Graph est un point de terminaison unifié pour accéder aux données, aux relations et aux connaissances fournies à partir du cloud Microsoft. Cet exemple montre comment se connecter et s’authentifier, puis appeler les API de messagerie et utilisateur via le [kit de développement logiciel Microsoft Graph pour iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 4 | 5 | > Remarque : Consultez la page relative au [portail d’inscription de l’application Microsoft Graph](https://apps.dev.microsoft.com) pour enregistrer plus facilement votre application et exécuter plus rapidement cet exemple. 6 | 7 | ## Conditions préalables 8 | * Téléchargement de [Xcode](https://developer.apple.com/xcode/downloads/) d’Apple. 9 | 10 | * Installation de [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) comme gestionnaire de dépendances. 11 | * Un compte de messagerie professionnel ou personnel Microsoft comme Office 365 ou outlook.com, hotmail.com, etc. Vous pouvez vous inscrire à [Office 365 Developer](https://aka.ms/devprogramsignup) pour accéder aux ressources dont vous avez besoin afin de commencer à créer des applications Office 365. 12 | 13 | > 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. 14 | * Un ID client de l’application enregistrée auprès du [portail d’inscription de l’application Microsoft Graph](https://apps.dev.microsoft.com) 15 | * Pour effectuer des requêtes, vous devez fournir un élément **MSAuthenticationProvider** capable d’authentifier les requêtes HTTPS avec un jeton de support OAuth 2.0 approprié. Nous allons utiliser [msgraph-sdk-ios-nxoauth2-adapter](https://github.com/microsoftgraph/msgraph-sdk-ios-nxoauth2-adapter) pour un exemple d’implémentation de MSAuthenticationProvider qui peut être utilisé pour commencer rapidement votre projet. Voir la section **Code d’intérêt** ci-dessous pour plus d’informations. 16 | 17 | 18 | ## Exécution de cet exemple dans Xcode 19 | 20 | 1. Cloner ce référentiel 21 | 2. S’il n’est pas déjà installé, exécutez les commandes suivantes à partir de l’application **Terminal** à installer et configurez le gestionnaire de dépendances CocoaPods. 22 | 23 | sudo gem install cocoapods 24 | 25 | pod setup 26 | 27 | 2. Utilisez CocoaPods pour importer les dépendances d’authentification et le kit de développement logiciel Microsoft Graph : 28 | 29 | pod 'MSGraphSDK' 30 | pod 'MSGraphSDK-NXOAuth2Adapter' 31 | 32 | 33 | Cet exemple d’application contient déjà un podfile qui recevra les pods dans le projet. Accédez à la racine du projet où se trouve le podfile et, à partir de **Terminal**, exécutez la commande suivante : 34 | 35 | pod install 36 | 37 | Pour plus d’informations, consultez la ressource **Utilisation de CocoaPods** dans [Ressources supplémentaires](#AdditionalResources). 38 | 39 | 3. Ouverture de **ios-objectivec-sample.xcworkspace** 40 | 4. Ouvrez **AuthenticationConstants.m**. Vous verrez que l’**ID client** du processus d’inscription peut être ajouté à la partie supérieure du fichier : 41 | 42 | ```objectivec 43 | // You will set your application's clientId 44 | NSString * const kClientId = @"ENTER_YOUR_CLIENT_ID"; 45 | ``` 46 | 47 | 48 | Notez que les étendues d’autorisation suivantes ont été configurées pour ce projet : 49 | 50 | ```@"https://graph.microsoft.com/User.Read, https://graph.microsoft.com/Mail.ReadWrite, https://graph.microsoft.com/Mail.Send, https://graph.microsoft.com/Files.ReadWrite"``` 51 | 52 | 53 | 54 | >Remarque : les appels de service utilisés dans ce projet, l’envoi d’un courrier électronique à votre compte de messagerie, le chargement d’une image vers OneDrive et la récupération des informations de profil (nom d’affichage, adresse e-mail, photo de profil) ont besoin de ces autorisations pour que l’application s’exécute correctement. 55 | 56 | 5. Exécutez l’exemple. Vous êtes invité à vous connecter/authentifier à un compte de messagerie personnel ou professionnel, puis vous pouvez envoyer un message à ce compte ou à un autre compte de messagerie sélectionné. 57 | 58 | 59 | ## Code d’intérêt 60 | 61 | Tout le code d’authentification peut être affiché dans le fichier **AuthenticationProvider.m**. Nous utilisons un exemple d’implémentation de MSAuthenticationProvider étendu de [NXOAuth2Client](https://github.com/nxtbgthng/OAuth2Client) pour prendre en charge la connexion des applications natives inscrites, l’actualisation automatique des jetons d’accès et la fonctionnalité de déconnexion : 62 | 63 | ```objectivec 64 | 65 | [[NXOAuth2AuthenticationProvider sharedAuthProvider] loginWithViewController:nil completion:^(NSError *error) { 66 | if (!error) { 67 | [MSGraphClient setAuthenticationProvider:[NXOAuth2AuthenticationProvider sharedAuthProvider]]; 68 | self.client = [MSGraphClient client]; 69 | } 70 | }]; 71 | ``` 72 | 73 | Une fois le fournisseur d’authentification défini, nous pouvons créer et initialiser un objet client (MSGraphClient) qui sert à effectuer des appels auprès du point de terminaison du service Microsoft Graph (courrier et utilisateurs). Dans **SendMailViewcontroller.m**, nous pouvons obtenir la photo de profil de l’utilisateur, la charger vers OneDrive, assembler une demande de messagerie avec une image en pièce jointe et l’envoyer en utilisant le code suivant : 74 | 75 | ### Obtention de l’image de profil de l’utilisateur 76 | 77 | ```objectivec 78 | [[[self.graphClient me] photoValue] downloadWithCompletion:^(NSURL *location, NSURLResponse *response, NSError *error) { 79 | //code 80 | if (!error) { 81 | NSData *data = [NSData dataWithContentsOfURL:location]; 82 | UIImage *img = [[UIImage alloc] initWithData:data]; 83 | completionBlock(img, error); 84 | } 85 | }]; 86 | ``` 87 | ### Chargement de l’image vers OneDrive 88 | 89 | ```objectivec 90 | NSData *data = UIImagePNGRepresentation(image); 91 | [[[[[[[self.graphClient me] 92 | drive] 93 | root] 94 | children] 95 | driveItem:(@"me.png")] 96 | contentRequest] 97 | uploadFromData:(data) completion:^(MSGraphDriveItem *response, NSError *error) { 98 | 99 | if (!error) { 100 | NSString *webUrl = response.webUrl; 101 | completionBlock(webUrl, error); 102 | } 103 | }]; 104 | 105 | ``` 106 | ### Ajout d’une image en pièce jointe à un nouveau message électronique 107 | 108 | ```objectivec 109 | MSGraphFileAttachment *fileAttachment= [[MSGraphFileAttachment alloc]init]; 110 | fileAttachment.oDataType = @"#microsoft.graph.fileAttachment"; 111 | fileAttachment.contentType = @"image/png"; 112 | 113 | NSString *decodedString = [UIImagePNGRepresentation(self.userPicture) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 114 | 115 | fileAttachment.contentBytes = decodedString; 116 | fileAttachment.name = @"me.png"; 117 | message.attachments = [message.attachments arrayByAddingObject:(fileAttachment)]; 118 | ``` 119 | 120 | ### Envoi du message électronique 121 | 122 | ```objectivec 123 | MSGraphUserSendMailRequestBuilder *requestBuilder = [[self.client me]sendMailWithMessage:message saveToSentItems:true]; 124 | MSGraphUserSendMailRequest *mailRequest = [requestBuilder request]; 125 | [mailRequest executeWithCompletion:^(NSDictionary *response, NSError *error) { 126 | }]; 127 | ``` 128 | 129 | Pour plus d’informations, y compris le code d’appel à d’autres services, tels que OneDrive, reportez-vous à la section [Kit de développement logiciel Microsoft Graph pour iOS](https://github.com/microsoftgraph/msgraph-sdk-ios). 130 | 131 | ## Questions et commentaires 132 | 133 | 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/microsoftgraph/iOS-objectivec-connect-sample/issues) de ce référentiel. 134 | 135 | Si vous avez des questions sur le développement d’Office 365, envoyez-les sur [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Veillez à poser vos questions ou à rédiger vos commentaires avec les tags [MicrosoftGraph] et [Office 365]. 136 | 137 | ## Contribution 138 | 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. 139 | 140 | Ce projet a adopté le [code de conduite Microsoft Open Source](https://opensource.microsoft.com/codeofconduct/). Pour plus d’informations, reportez-vous à la [FAQ relative au code de conduite](https://opensource.microsoft.com/codeofconduct/faq/) ou contactez [opencode@microsoft.com](mailto:opencode@microsoft.com) pour toute question ou tout commentaire. 141 | 142 | ## Ressources supplémentaires 143 | 144 | * [Centre de développement Office](http://dev.office.com/) 145 | * [Page de présentation de Microsoft Graph](https://graph.microsoft.io) 146 | * [Utilisation de CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 147 | 148 | ## Copyright 149 | Copyright (c) 2016 Microsoft. Tous droits réservés. 150 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample/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 | 43 | 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 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 98 | 102 | 103 | 104 | Status text 105 | This is where the status is displayed 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | You're now connected to Office 365. Tap the Send button below to send a message from your account using the iOS Microsoft Graph SDK. 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 | -------------------------------------------------------------------------------- /starter-project/ios-objectivec-connect-sample/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 | 43 | 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 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 98 | 102 | 103 | 104 | Status text 105 | This is where the status is displayed 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | You're now connected to Office 365. Tap the Send button below to send a message from your account using the iOS Microsoft Graph SDK. 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 | -------------------------------------------------------------------------------- /starter-project/iOS-ObjectiveC-Connect-Sample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3E5968A48D40AE0661E043BE /* libPods-O365-iOS-Microsoft-Graph-SDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CB6721F956C1B8D5FBBFEEDB /* libPods-O365-iOS-Microsoft-Graph-SDK.a */; }; 11 | C94886BA9E82EC1235FFB13F /* libPods-iOS-ObjectiveC-Connect-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E3287EEE3AF9969F6DD39ABA /* libPods-iOS-ObjectiveC-Connect-Sample.a */; }; 12 | D32E34271D25B9690036AA14 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D32E34261D25B9690036AA14 /* Localizable.strings */; }; 13 | D3DAE87B1CE3A5EC00696F75 /* AuthenticationProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DAE87A1CE3A5EC00696F75 /* AuthenticationProvider.m */; }; 14 | D3DC73DF1CCEC49F00C1DF18 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73DE1CCEC49F00C1DF18 /* main.m */; }; 15 | D3DC73E21CCEC49F00C1DF18 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73E11CCEC49F00C1DF18 /* AppDelegate.m */; }; 16 | D3DC73E81CCEC49F00C1DF18 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73E61CCEC49F00C1DF18 /* Main.storyboard */; }; 17 | D3DC73EA1CCEC49F00C1DF18 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73E91CCEC49F00C1DF18 /* Assets.xcassets */; }; 18 | D3DC73ED1CCEC49F00C1DF18 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73EB1CCEC49F00C1DF18 /* LaunchScreen.storyboard */; }; 19 | D3DC73F81CCEC4FE00C1DF18 /* AuthenticationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73F71CCEC4FE00C1DF18 /* AuthenticationConstants.m */; }; 20 | D3DC73FB1CCEC63A00C1DF18 /* ConnectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73FA1CCEC63A00C1DF18 /* ConnectViewController.m */; }; 21 | D3DC73FE1CD1267600C1DF18 /* SendMailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73FD1CD1267600C1DF18 /* SendMailViewController.m */; }; 22 | D3DC74001CD16C7800C1DF18 /* EmailBody.html in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73FF1CD16C7800C1DF18 /* EmailBody.html */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 027C6680FAE500DDD3E097DF /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 27 | 0E7A9AAB13A00E54F334258A /* Pods-iOS-ObjectiveC-Connect-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS-ObjectiveC-Connect-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOS-ObjectiveC-Connect-Sample/Pods-iOS-ObjectiveC-Connect-Sample.release.xcconfig"; sourceTree = ""; }; 28 | 2DD4BF8A5C636065F182E7F1 /* Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig"; path = "Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-SDK/Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig"; sourceTree = ""; }; 29 | 65F7B536F008EC61217C0BFC /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 71462FFA4A8F7D911008D6B2 /* Pods-iOS-ObjectiveC-Connect-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS-ObjectiveC-Connect-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iOS-ObjectiveC-Connect-Sample/Pods-iOS-ObjectiveC-Connect-Sample.debug.xcconfig"; sourceTree = ""; }; 31 | 8C2BA958479F5FE1E76B534F /* Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-SDK/Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig"; sourceTree = ""; }; 32 | CB6721F956C1B8D5FBBFEEDB /* libPods-O365-iOS-Microsoft-Graph-SDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-O365-iOS-Microsoft-Graph-SDK.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | D32E34261D25B9690036AA14 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; 34 | D3DAE8791CE3A5EC00696F75 /* AuthenticationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationProvider.h; sourceTree = ""; }; 35 | D3DAE87A1CE3A5EC00696F75 /* AuthenticationProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationProvider.m; sourceTree = ""; }; 36 | D3DC73DA1CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS-ObjectiveC-Connect-Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | D3DC73DE1CCEC49F00C1DF18 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | D3DC73E01CCEC49F00C1DF18 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | D3DC73E11CCEC49F00C1DF18 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | D3DC73E71CCEC49F00C1DF18 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | D3DC73E91CCEC49F00C1DF18 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | D3DC73EC1CCEC49F00C1DF18 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 43 | D3DC73EE1CCEC49F00C1DF18 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | D3DC73F61CCEC4FE00C1DF18 /* AuthenticationConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationConstants.h; sourceTree = ""; }; 45 | D3DC73F71CCEC4FE00C1DF18 /* AuthenticationConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationConstants.m; sourceTree = ""; }; 46 | D3DC73F91CCEC63A00C1DF18 /* ConnectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectViewController.h; sourceTree = ""; }; 47 | D3DC73FA1CCEC63A00C1DF18 /* ConnectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectViewController.m; sourceTree = ""; }; 48 | D3DC73FC1CD1267600C1DF18 /* SendMailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendMailViewController.h; sourceTree = ""; }; 49 | D3DC73FD1CD1267600C1DF18 /* SendMailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SendMailViewController.m; sourceTree = ""; }; 50 | D3DC73FF1CD16C7800C1DF18 /* EmailBody.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = EmailBody.html; sourceTree = ""; }; 51 | E3287EEE3AF9969F6DD39ABA /* libPods-iOS-ObjectiveC-Connect-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iOS-ObjectiveC-Connect-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | F4DEBC45D9FE8CB23350506F /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | D3DC73D71CCEC49F00C1DF18 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 3E5968A48D40AE0661E043BE /* libPods-O365-iOS-Microsoft-Graph-SDK.a in Frameworks */, 61 | C94886BA9E82EC1235FFB13F /* libPods-iOS-ObjectiveC-Connect-Sample.a in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 48789700023AB65E520FF8EE /* Pods */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | F4DEBC45D9FE8CB23350506F /* Pods.debug.xcconfig */, 72 | 027C6680FAE500DDD3E097DF /* Pods.release.xcconfig */, 73 | 8C2BA958479F5FE1E76B534F /* Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig */, 74 | 2DD4BF8A5C636065F182E7F1 /* Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig */, 75 | 71462FFA4A8F7D911008D6B2 /* Pods-iOS-ObjectiveC-Connect-Sample.debug.xcconfig */, 76 | 0E7A9AAB13A00E54F334258A /* Pods-iOS-ObjectiveC-Connect-Sample.release.xcconfig */, 77 | ); 78 | name = Pods; 79 | sourceTree = ""; 80 | }; 81 | B4F53F2BC1FB1DA7593EABE0 /* Frameworks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 65F7B536F008EC61217C0BFC /* libPods.a */, 85 | CB6721F956C1B8D5FBBFEEDB /* libPods-O365-iOS-Microsoft-Graph-SDK.a */, 86 | E3287EEE3AF9969F6DD39ABA /* libPods-iOS-ObjectiveC-Connect-Sample.a */, 87 | ); 88 | name = Frameworks; 89 | sourceTree = ""; 90 | }; 91 | D3DC73D11CCEC49F00C1DF18 = { 92 | isa = PBXGroup; 93 | children = ( 94 | D3DC73DC1CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample */, 95 | D3DC73DB1CCEC49F00C1DF18 /* Products */, 96 | 48789700023AB65E520FF8EE /* Pods */, 97 | B4F53F2BC1FB1DA7593EABE0 /* Frameworks */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | D3DC73DB1CCEC49F00C1DF18 /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | D3DC73DA1CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample.app */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | D3DC73DC1CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | D3FBFF031CEB747F00727130 /* Application */, 113 | D3FBFF041CEB748E00727130 /* Controllers */, 114 | D3FBFF051CEB749600727130 /* Views */, 115 | D3FBFF061CEB749D00727130 /* Resources */, 116 | D3FBFF071CEB74AA00727130 /* Authentication */, 117 | D3DC73DD1CCEC49F00C1DF18 /* Supporting Files */, 118 | ); 119 | name = "iOS-ObjectiveC-Connect-Sample"; 120 | path = "ios-objectivec-connect-sample"; 121 | sourceTree = ""; 122 | }; 123 | D3DC73DD1CCEC49F00C1DF18 /* Supporting Files */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | D3DC73DE1CCEC49F00C1DF18 /* main.m */, 127 | ); 128 | name = "Supporting Files"; 129 | sourceTree = ""; 130 | }; 131 | D3FBFF031CEB747F00727130 /* Application */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | D3DC73F61CCEC4FE00C1DF18 /* AuthenticationConstants.h */, 135 | D3DC73F71CCEC4FE00C1DF18 /* AuthenticationConstants.m */, 136 | ); 137 | name = Application; 138 | sourceTree = ""; 139 | }; 140 | D3FBFF041CEB748E00727130 /* Controllers */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | D3DC73F91CCEC63A00C1DF18 /* ConnectViewController.h */, 144 | D3DC73FA1CCEC63A00C1DF18 /* ConnectViewController.m */, 145 | D3DC73FC1CD1267600C1DF18 /* SendMailViewController.h */, 146 | D3DC73FD1CD1267600C1DF18 /* SendMailViewController.m */, 147 | D3DC73E01CCEC49F00C1DF18 /* AppDelegate.h */, 148 | D3DC73E11CCEC49F00C1DF18 /* AppDelegate.m */, 149 | ); 150 | name = Controllers; 151 | sourceTree = ""; 152 | }; 153 | D3FBFF051CEB749600727130 /* Views */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | D3DC73E61CCEC49F00C1DF18 /* Main.storyboard */, 157 | D3DC73EB1CCEC49F00C1DF18 /* LaunchScreen.storyboard */, 158 | ); 159 | name = Views; 160 | sourceTree = ""; 161 | }; 162 | D3FBFF061CEB749D00727130 /* Resources */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | D3DC73EE1CCEC49F00C1DF18 /* Info.plist */, 166 | D3DC73E91CCEC49F00C1DF18 /* Assets.xcassets */, 167 | D3DC73FF1CD16C7800C1DF18 /* EmailBody.html */, 168 | D32E34261D25B9690036AA14 /* Localizable.strings */, 169 | ); 170 | name = Resources; 171 | sourceTree = ""; 172 | }; 173 | D3FBFF071CEB74AA00727130 /* Authentication */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | D3DAE8791CE3A5EC00696F75 /* AuthenticationProvider.h */, 177 | D3DAE87A1CE3A5EC00696F75 /* AuthenticationProvider.m */, 178 | ); 179 | name = Authentication; 180 | sourceTree = ""; 181 | }; 182 | /* End PBXGroup section */ 183 | 184 | /* Begin PBXNativeTarget section */ 185 | D3DC73D91CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample */ = { 186 | isa = PBXNativeTarget; 187 | buildConfigurationList = D3DC73F11CCEC49F00C1DF18 /* Build configuration list for PBXNativeTarget "iOS-ObjectiveC-Connect-Sample" */; 188 | buildPhases = ( 189 | D68F6980362A8EAE6702AB91 /* [CP] Check Pods Manifest.lock */, 190 | D3DC73D61CCEC49F00C1DF18 /* Sources */, 191 | D3DC73D71CCEC49F00C1DF18 /* Frameworks */, 192 | D3DC73D81CCEC49F00C1DF18 /* Resources */, 193 | 4FF3905E5DAF2AF3CDC126AC /* [CP] Embed Pods Frameworks */, 194 | 819E2F63675BAB6B67D5501A /* [CP] Copy Pods Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | ); 200 | name = "iOS-ObjectiveC-Connect-Sample"; 201 | productName = "O365-iOS-Microsoft-Graph-SDK"; 202 | productReference = D3DC73DA1CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample.app */; 203 | productType = "com.apple.product-type.application"; 204 | }; 205 | /* End PBXNativeTarget section */ 206 | 207 | /* Begin PBXProject section */ 208 | D3DC73D21CCEC49F00C1DF18 /* Project object */ = { 209 | isa = PBXProject; 210 | attributes = { 211 | LastUpgradeCheck = 0800; 212 | ORGANIZATIONNAME = Microsoft; 213 | TargetAttributes = { 214 | D3DC73D91CCEC49F00C1DF18 = { 215 | CreatedOnToolsVersion = 7.2.1; 216 | }; 217 | }; 218 | }; 219 | buildConfigurationList = D3DC73D51CCEC49F00C1DF18 /* Build configuration list for PBXProject "iOS-ObjectiveC-Connect-Sample" */; 220 | compatibilityVersion = "Xcode 3.2"; 221 | developmentRegion = English; 222 | hasScannedForEncodings = 0; 223 | knownRegions = ( 224 | en, 225 | Base, 226 | ); 227 | mainGroup = D3DC73D11CCEC49F00C1DF18; 228 | productRefGroup = D3DC73DB1CCEC49F00C1DF18 /* Products */; 229 | projectDirPath = ""; 230 | projectRoot = ""; 231 | targets = ( 232 | D3DC73D91CCEC49F00C1DF18 /* iOS-ObjectiveC-Connect-Sample */, 233 | ); 234 | }; 235 | /* End PBXProject section */ 236 | 237 | /* Begin PBXResourcesBuildPhase section */ 238 | D3DC73D81CCEC49F00C1DF18 /* Resources */ = { 239 | isa = PBXResourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | D32E34271D25B9690036AA14 /* Localizable.strings in Resources */, 243 | D3DC73ED1CCEC49F00C1DF18 /* LaunchScreen.storyboard in Resources */, 244 | D3DC73EA1CCEC49F00C1DF18 /* Assets.xcassets in Resources */, 245 | D3DC73E81CCEC49F00C1DF18 /* Main.storyboard in Resources */, 246 | D3DC74001CD16C7800C1DF18 /* EmailBody.html in Resources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXShellScriptBuildPhase section */ 253 | 4FF3905E5DAF2AF3CDC126AC /* [CP] Embed Pods Frameworks */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputPaths = ( 259 | ); 260 | name = "[CP] Embed Pods Frameworks"; 261 | outputPaths = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iOS-ObjectiveC-Connect-Sample/Pods-iOS-ObjectiveC-Connect-Sample-frameworks.sh\"\n"; 266 | showEnvVarsInLog = 0; 267 | }; 268 | 819E2F63675BAB6B67D5501A /* [CP] Copy Pods Resources */ = { 269 | isa = PBXShellScriptBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | inputPaths = ( 274 | ); 275 | name = "[CP] Copy Pods Resources"; 276 | outputPaths = ( 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | shellPath = /bin/sh; 280 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iOS-ObjectiveC-Connect-Sample/Pods-iOS-ObjectiveC-Connect-Sample-resources.sh\"\n"; 281 | showEnvVarsInLog = 0; 282 | }; 283 | D68F6980362A8EAE6702AB91 /* [CP] Check Pods Manifest.lock */ = { 284 | isa = PBXShellScriptBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | ); 288 | inputPaths = ( 289 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 290 | "${PODS_ROOT}/Manifest.lock", 291 | ); 292 | name = "[CP] Check Pods Manifest.lock"; 293 | outputPaths = ( 294 | "$(DERIVED_FILE_DIR)/Pods-iOS-ObjectiveC-Connect-Sample-checkManifestLockResult.txt", 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | shellPath = /bin/sh; 298 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 299 | showEnvVarsInLog = 0; 300 | }; 301 | /* End PBXShellScriptBuildPhase section */ 302 | 303 | /* Begin PBXSourcesBuildPhase section */ 304 | D3DC73D61CCEC49F00C1DF18 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | D3DC73FE1CD1267600C1DF18 /* SendMailViewController.m in Sources */, 309 | D3DC73FB1CCEC63A00C1DF18 /* ConnectViewController.m in Sources */, 310 | D3DAE87B1CE3A5EC00696F75 /* AuthenticationProvider.m in Sources */, 311 | D3DC73F81CCEC4FE00C1DF18 /* AuthenticationConstants.m in Sources */, 312 | D3DC73E21CCEC49F00C1DF18 /* AppDelegate.m in Sources */, 313 | D3DC73DF1CCEC49F00C1DF18 /* main.m in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXSourcesBuildPhase section */ 318 | 319 | /* Begin PBXVariantGroup section */ 320 | D3DC73E61CCEC49F00C1DF18 /* Main.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | D3DC73E71CCEC49F00C1DF18 /* Base */, 324 | ); 325 | name = Main.storyboard; 326 | sourceTree = ""; 327 | }; 328 | D3DC73EB1CCEC49F00C1DF18 /* LaunchScreen.storyboard */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | D3DC73EC1CCEC49F00C1DF18 /* Base */, 332 | ); 333 | name = LaunchScreen.storyboard; 334 | sourceTree = ""; 335 | }; 336 | /* End PBXVariantGroup section */ 337 | 338 | /* Begin XCBuildConfiguration section */ 339 | D3DC73EF1CCEC49F00C1DF18 /* Debug */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ALWAYS_SEARCH_USER_PATHS = NO; 343 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 344 | CLANG_CXX_LIBRARY = "libc++"; 345 | CLANG_ENABLE_MODULES = YES; 346 | CLANG_ENABLE_OBJC_ARC = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_CONSTANT_CONVERSION = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_EMPTY_BODY = YES; 351 | CLANG_WARN_ENUM_CONVERSION = YES; 352 | CLANG_WARN_INFINITE_RECURSION = YES; 353 | CLANG_WARN_INT_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 356 | CLANG_WARN_UNREACHABLE_CODE = YES; 357 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 358 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 359 | COPY_PHASE_STRIP = NO; 360 | DEBUG_INFORMATION_FORMAT = dwarf; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | ENABLE_TESTABILITY = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu99; 364 | GCC_DYNAMIC_NO_PIC = NO; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_OPTIMIZATION_LEVEL = 0; 367 | GCC_PREPROCESSOR_DEFINITIONS = ( 368 | "DEBUG=1", 369 | "$(inherited)", 370 | ); 371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 373 | GCC_WARN_UNDECLARED_SELECTOR = YES; 374 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 375 | GCC_WARN_UNUSED_FUNCTION = YES; 376 | GCC_WARN_UNUSED_VARIABLE = YES; 377 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 378 | MTL_ENABLE_DEBUG_INFO = YES; 379 | ONLY_ACTIVE_ARCH = YES; 380 | SDKROOT = iphoneos; 381 | }; 382 | name = Debug; 383 | }; 384 | D3DC73F01CCEC49F00C1DF18 /* Release */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | ALWAYS_SEARCH_USER_PATHS = NO; 388 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 389 | CLANG_CXX_LIBRARY = "libc++"; 390 | CLANG_ENABLE_MODULES = YES; 391 | CLANG_ENABLE_OBJC_ARC = YES; 392 | CLANG_WARN_BOOL_CONVERSION = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 395 | CLANG_WARN_EMPTY_BODY = YES; 396 | CLANG_WARN_ENUM_CONVERSION = YES; 397 | CLANG_WARN_INFINITE_RECURSION = YES; 398 | CLANG_WARN_INT_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 401 | CLANG_WARN_UNREACHABLE_CODE = YES; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | COPY_PHASE_STRIP = NO; 405 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 411 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 412 | GCC_WARN_UNDECLARED_SELECTOR = YES; 413 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 414 | GCC_WARN_UNUSED_FUNCTION = YES; 415 | GCC_WARN_UNUSED_VARIABLE = YES; 416 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 417 | MTL_ENABLE_DEBUG_INFO = NO; 418 | SDKROOT = iphoneos; 419 | VALIDATE_PRODUCT = YES; 420 | }; 421 | name = Release; 422 | }; 423 | D3DC73F21CCEC49F00C1DF18 /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | baseConfigurationReference = 71462FFA4A8F7D911008D6B2 /* Pods-iOS-ObjectiveC-Connect-Sample.debug.xcconfig */; 426 | buildSettings = { 427 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 428 | DEVELOPMENT_TEAM = ""; 429 | INFOPLIST_FILE = "O365-iOS-Microsoft-Graph-SDK/Info.plist"; 430 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 431 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.ios-objectivec-connect-sample"; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | }; 434 | name = Debug; 435 | }; 436 | D3DC73F31CCEC49F00C1DF18 /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | baseConfigurationReference = 0E7A9AAB13A00E54F334258A /* Pods-iOS-ObjectiveC-Connect-Sample.release.xcconfig */; 439 | buildSettings = { 440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 441 | DEVELOPMENT_TEAM = ""; 442 | INFOPLIST_FILE = "O365-iOS-Microsoft-Graph-SDK/Info.plist"; 443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 444 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.ios-objectivec-connect-sample"; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | }; 447 | name = Release; 448 | }; 449 | /* End XCBuildConfiguration section */ 450 | 451 | /* Begin XCConfigurationList section */ 452 | D3DC73D51CCEC49F00C1DF18 /* Build configuration list for PBXProject "iOS-ObjectiveC-Connect-Sample" */ = { 453 | isa = XCConfigurationList; 454 | buildConfigurations = ( 455 | D3DC73EF1CCEC49F00C1DF18 /* Debug */, 456 | D3DC73F01CCEC49F00C1DF18 /* Release */, 457 | ); 458 | defaultConfigurationIsVisible = 0; 459 | defaultConfigurationName = Release; 460 | }; 461 | D3DC73F11CCEC49F00C1DF18 /* Build configuration list for PBXNativeTarget "iOS-ObjectiveC-Connect-Sample" */ = { 462 | isa = XCConfigurationList; 463 | buildConfigurations = ( 464 | D3DC73F21CCEC49F00C1DF18 /* Debug */, 465 | D3DC73F31CCEC49F00C1DF18 /* Release */, 466 | ); 467 | defaultConfigurationIsVisible = 0; 468 | defaultConfigurationName = Release; 469 | }; 470 | /* End XCConfigurationList section */ 471 | }; 472 | rootObject = D3DC73D21CCEC49F00C1DF18 /* Project object */; 473 | } 474 | -------------------------------------------------------------------------------- /ios-objectivec-connect-sample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3E5968A48D40AE0661E043BE /* libPods-O365-iOS-Microsoft-Graph-SDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CB6721F956C1B8D5FBBFEEDB /* libPods-O365-iOS-Microsoft-Graph-SDK.a */; }; 11 | 5E2631FDDEA6393A3C7AD399 /* libPods-ios-objectivec-connect-sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A23959EF9BF537936B2556A /* libPods-ios-objectivec-connect-sample.a */; }; 12 | D32E34271D25B9690036AA14 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D32E34261D25B9690036AA14 /* Localizable.strings */; }; 13 | D3DAE87B1CE3A5EC00696F75 /* AuthenticationProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DAE87A1CE3A5EC00696F75 /* AuthenticationProvider.m */; }; 14 | D3DC73DF1CCEC49F00C1DF18 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73DE1CCEC49F00C1DF18 /* main.m */; }; 15 | D3DC73E21CCEC49F00C1DF18 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73E11CCEC49F00C1DF18 /* AppDelegate.m */; }; 16 | D3DC73E81CCEC49F00C1DF18 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73E61CCEC49F00C1DF18 /* Main.storyboard */; }; 17 | D3DC73EA1CCEC49F00C1DF18 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73E91CCEC49F00C1DF18 /* Assets.xcassets */; }; 18 | D3DC73ED1CCEC49F00C1DF18 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73EB1CCEC49F00C1DF18 /* LaunchScreen.storyboard */; }; 19 | D3DC73F81CCEC4FE00C1DF18 /* AuthenticationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73F71CCEC4FE00C1DF18 /* AuthenticationConstants.m */; }; 20 | D3DC73FB1CCEC63A00C1DF18 /* ConnectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73FA1CCEC63A00C1DF18 /* ConnectViewController.m */; }; 21 | D3DC73FE1CD1267600C1DF18 /* SendMailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3DC73FD1CD1267600C1DF18 /* SendMailViewController.m */; }; 22 | D3DC74001CD16C7800C1DF18 /* EmailBody.html in Resources */ = {isa = PBXBuildFile; fileRef = D3DC73FF1CD16C7800C1DF18 /* EmailBody.html */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 027C6680FAE500DDD3E097DF /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 27 | 1B67B02D36F3E5C97A1FFC05 /* Pods-ios-objectivec-connect-sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios-objectivec-connect-sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-ios-objectivec-connect-sample/Pods-ios-objectivec-connect-sample.release.xcconfig"; sourceTree = ""; }; 28 | 2DD4BF8A5C636065F182E7F1 /* Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig"; path = "Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-SDK/Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig"; sourceTree = ""; }; 29 | 2E831AF7AAE5F4914073107B /* Pods-ios-objectivec-connect-sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios-objectivec-connect-sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ios-objectivec-connect-sample/Pods-ios-objectivec-connect-sample.debug.xcconfig"; sourceTree = ""; }; 30 | 65F7B536F008EC61217C0BFC /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 8C2BA958479F5FE1E76B534F /* Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-SDK/Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig"; sourceTree = ""; }; 32 | 96FEA8F21D92860F007963C0 /* ios-objectivec-connect-sample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "ios-objectivec-connect-sample.entitlements"; sourceTree = ""; }; 33 | 9A23959EF9BF537936B2556A /* libPods-ios-objectivec-connect-sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ios-objectivec-connect-sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | CB6721F956C1B8D5FBBFEEDB /* libPods-O365-iOS-Microsoft-Graph-SDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-O365-iOS-Microsoft-Graph-SDK.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | D32E34261D25B9690036AA14 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; 36 | D3DAE8791CE3A5EC00696F75 /* AuthenticationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationProvider.h; sourceTree = ""; }; 37 | D3DAE87A1CE3A5EC00696F75 /* AuthenticationProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationProvider.m; sourceTree = ""; }; 38 | D3DC73DA1CCEC49F00C1DF18 /* ios-objectivec-connect-sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-objectivec-connect-sample.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | D3DC73DE1CCEC49F00C1DF18 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | D3DC73E01CCEC49F00C1DF18 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | D3DC73E11CCEC49F00C1DF18 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | D3DC73E71CCEC49F00C1DF18 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | D3DC73E91CCEC49F00C1DF18 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | D3DC73EC1CCEC49F00C1DF18 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | D3DC73EE1CCEC49F00C1DF18 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | D3DC73F61CCEC4FE00C1DF18 /* AuthenticationConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationConstants.h; sourceTree = ""; }; 47 | D3DC73F71CCEC4FE00C1DF18 /* AuthenticationConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationConstants.m; sourceTree = ""; }; 48 | D3DC73F91CCEC63A00C1DF18 /* ConnectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectViewController.h; sourceTree = ""; }; 49 | D3DC73FA1CCEC63A00C1DF18 /* ConnectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectViewController.m; sourceTree = ""; }; 50 | D3DC73FC1CD1267600C1DF18 /* SendMailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SendMailViewController.h; sourceTree = ""; }; 51 | D3DC73FD1CD1267600C1DF18 /* SendMailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SendMailViewController.m; sourceTree = ""; }; 52 | D3DC73FF1CD16C7800C1DF18 /* EmailBody.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = EmailBody.html; sourceTree = ""; }; 53 | F4DEBC45D9FE8CB23350506F /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | D3DC73D71CCEC49F00C1DF18 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | 3E5968A48D40AE0661E043BE /* libPods-O365-iOS-Microsoft-Graph-SDK.a in Frameworks */, 62 | 5E2631FDDEA6393A3C7AD399 /* libPods-ios-objectivec-connect-sample.a in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 48789700023AB65E520FF8EE /* Pods */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | F4DEBC45D9FE8CB23350506F /* Pods.debug.xcconfig */, 73 | 027C6680FAE500DDD3E097DF /* Pods.release.xcconfig */, 74 | 8C2BA958479F5FE1E76B534F /* Pods-O365-iOS-Microsoft-Graph-SDK.debug.xcconfig */, 75 | 2DD4BF8A5C636065F182E7F1 /* Pods-O365-iOS-Microsoft-Graph-SDK.release.xcconfig */, 76 | 2E831AF7AAE5F4914073107B /* Pods-ios-objectivec-connect-sample.debug.xcconfig */, 77 | 1B67B02D36F3E5C97A1FFC05 /* Pods-ios-objectivec-connect-sample.release.xcconfig */, 78 | ); 79 | name = Pods; 80 | sourceTree = ""; 81 | }; 82 | B4F53F2BC1FB1DA7593EABE0 /* Frameworks */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 65F7B536F008EC61217C0BFC /* libPods.a */, 86 | CB6721F956C1B8D5FBBFEEDB /* libPods-O365-iOS-Microsoft-Graph-SDK.a */, 87 | 9A23959EF9BF537936B2556A /* libPods-ios-objectivec-connect-sample.a */, 88 | ); 89 | name = Frameworks; 90 | sourceTree = ""; 91 | }; 92 | D3DC73D11CCEC49F00C1DF18 = { 93 | isa = PBXGroup; 94 | children = ( 95 | D3DC73DC1CCEC49F00C1DF18 /* ios-objectivec-connect-sample */, 96 | D3DC73DB1CCEC49F00C1DF18 /* Products */, 97 | 48789700023AB65E520FF8EE /* Pods */, 98 | B4F53F2BC1FB1DA7593EABE0 /* Frameworks */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | D3DC73DB1CCEC49F00C1DF18 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | D3DC73DA1CCEC49F00C1DF18 /* ios-objectivec-connect-sample.app */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | D3DC73DC1CCEC49F00C1DF18 /* ios-objectivec-connect-sample */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 96FEA8F21D92860F007963C0 /* ios-objectivec-connect-sample.entitlements */, 114 | D3FBFF031CEB747F00727130 /* Application */, 115 | D3FBFF041CEB748E00727130 /* Controllers */, 116 | D3FBFF051CEB749600727130 /* Views */, 117 | D3FBFF061CEB749D00727130 /* Resources */, 118 | D3FBFF071CEB74AA00727130 /* Authentication */, 119 | D3DC73DD1CCEC49F00C1DF18 /* Supporting Files */, 120 | ); 121 | path = "ios-objectivec-connect-sample"; 122 | sourceTree = ""; 123 | }; 124 | D3DC73DD1CCEC49F00C1DF18 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | D3DC73DE1CCEC49F00C1DF18 /* main.m */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | D3FBFF031CEB747F00727130 /* Application */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | D3DC73F61CCEC4FE00C1DF18 /* AuthenticationConstants.h */, 136 | D3DC73F71CCEC4FE00C1DF18 /* AuthenticationConstants.m */, 137 | ); 138 | name = Application; 139 | sourceTree = ""; 140 | }; 141 | D3FBFF041CEB748E00727130 /* Controllers */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | D3DC73F91CCEC63A00C1DF18 /* ConnectViewController.h */, 145 | D3DC73FA1CCEC63A00C1DF18 /* ConnectViewController.m */, 146 | D3DC73FC1CD1267600C1DF18 /* SendMailViewController.h */, 147 | D3DC73FD1CD1267600C1DF18 /* SendMailViewController.m */, 148 | D3DC73E01CCEC49F00C1DF18 /* AppDelegate.h */, 149 | D3DC73E11CCEC49F00C1DF18 /* AppDelegate.m */, 150 | ); 151 | name = Controllers; 152 | sourceTree = ""; 153 | }; 154 | D3FBFF051CEB749600727130 /* Views */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | D3DC73E61CCEC49F00C1DF18 /* Main.storyboard */, 158 | D3DC73EB1CCEC49F00C1DF18 /* LaunchScreen.storyboard */, 159 | ); 160 | name = Views; 161 | sourceTree = ""; 162 | }; 163 | D3FBFF061CEB749D00727130 /* Resources */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | D3DC73EE1CCEC49F00C1DF18 /* Info.plist */, 167 | D3DC73E91CCEC49F00C1DF18 /* Assets.xcassets */, 168 | D3DC73FF1CD16C7800C1DF18 /* EmailBody.html */, 169 | D32E34261D25B9690036AA14 /* Localizable.strings */, 170 | ); 171 | name = Resources; 172 | sourceTree = ""; 173 | }; 174 | D3FBFF071CEB74AA00727130 /* Authentication */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | D3DAE8791CE3A5EC00696F75 /* AuthenticationProvider.h */, 178 | D3DAE87A1CE3A5EC00696F75 /* AuthenticationProvider.m */, 179 | ); 180 | name = Authentication; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXNativeTarget section */ 186 | D3DC73D91CCEC49F00C1DF18 /* ios-objectivec-connect-sample */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = D3DC73F11CCEC49F00C1DF18 /* Build configuration list for PBXNativeTarget "ios-objectivec-connect-sample" */; 189 | buildPhases = ( 190 | D68F6980362A8EAE6702AB91 /* [CP] Check Pods Manifest.lock */, 191 | D3DC73D61CCEC49F00C1DF18 /* Sources */, 192 | D3DC73D71CCEC49F00C1DF18 /* Frameworks */, 193 | D3DC73D81CCEC49F00C1DF18 /* Resources */, 194 | 4FF3905E5DAF2AF3CDC126AC /* [CP] Embed Pods Frameworks */, 195 | 819E2F63675BAB6B67D5501A /* [CP] Copy Pods Resources */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | ); 201 | name = "ios-objectivec-connect-sample"; 202 | productName = "O365-iOS-Microsoft-Graph-SDK"; 203 | productReference = D3DC73DA1CCEC49F00C1DF18 /* ios-objectivec-connect-sample.app */; 204 | productType = "com.apple.product-type.application"; 205 | }; 206 | /* End PBXNativeTarget section */ 207 | 208 | /* Begin PBXProject section */ 209 | D3DC73D21CCEC49F00C1DF18 /* Project object */ = { 210 | isa = PBXProject; 211 | attributes = { 212 | LastUpgradeCheck = 0830; 213 | ORGANIZATIONNAME = Microsoft; 214 | TargetAttributes = { 215 | D3DC73D91CCEC49F00C1DF18 = { 216 | CreatedOnToolsVersion = 7.2.1; 217 | SystemCapabilities = { 218 | com.apple.Keychain = { 219 | enabled = 1; 220 | }; 221 | }; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = D3DC73D51CCEC49F00C1DF18 /* Build configuration list for PBXProject "ios-objectivec-connect-sample" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = D3DC73D11CCEC49F00C1DF18; 234 | productRefGroup = D3DC73DB1CCEC49F00C1DF18 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | D3DC73D91CCEC49F00C1DF18 /* ios-objectivec-connect-sample */, 239 | ); 240 | }; 241 | /* End PBXProject section */ 242 | 243 | /* Begin PBXResourcesBuildPhase section */ 244 | D3DC73D81CCEC49F00C1DF18 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | D32E34271D25B9690036AA14 /* Localizable.strings in Resources */, 249 | D3DC73ED1CCEC49F00C1DF18 /* LaunchScreen.storyboard in Resources */, 250 | D3DC73EA1CCEC49F00C1DF18 /* Assets.xcassets in Resources */, 251 | D3DC73E81CCEC49F00C1DF18 /* Main.storyboard in Resources */, 252 | D3DC74001CD16C7800C1DF18 /* EmailBody.html in Resources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXResourcesBuildPhase section */ 257 | 258 | /* Begin PBXShellScriptBuildPhase section */ 259 | 4FF3905E5DAF2AF3CDC126AC /* [CP] Embed Pods Frameworks */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | ); 266 | name = "[CP] Embed Pods Frameworks"; 267 | outputPaths = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | shellPath = /bin/sh; 271 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ios-objectivec-connect-sample/Pods-ios-objectivec-connect-sample-frameworks.sh\"\n"; 272 | showEnvVarsInLog = 0; 273 | }; 274 | 819E2F63675BAB6B67D5501A /* [CP] Copy Pods Resources */ = { 275 | isa = PBXShellScriptBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | inputPaths = ( 280 | ); 281 | name = "[CP] Copy Pods Resources"; 282 | outputPaths = ( 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | shellPath = /bin/sh; 286 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ios-objectivec-connect-sample/Pods-ios-objectivec-connect-sample-resources.sh\"\n"; 287 | showEnvVarsInLog = 0; 288 | }; 289 | D68F6980362A8EAE6702AB91 /* [CP] Check Pods Manifest.lock */ = { 290 | isa = PBXShellScriptBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | inputPaths = ( 295 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 296 | "${PODS_ROOT}/Manifest.lock", 297 | ); 298 | name = "[CP] Check Pods Manifest.lock"; 299 | outputPaths = ( 300 | "$(DERIVED_FILE_DIR)/Pods-ios-objectivec-connect-sample-checkManifestLockResult.txt", 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | shellPath = /bin/sh; 304 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 305 | showEnvVarsInLog = 0; 306 | }; 307 | /* End PBXShellScriptBuildPhase section */ 308 | 309 | /* Begin PBXSourcesBuildPhase section */ 310 | D3DC73D61CCEC49F00C1DF18 /* Sources */ = { 311 | isa = PBXSourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | D3DC73FE1CD1267600C1DF18 /* SendMailViewController.m in Sources */, 315 | D3DC73FB1CCEC63A00C1DF18 /* ConnectViewController.m in Sources */, 316 | D3DAE87B1CE3A5EC00696F75 /* AuthenticationProvider.m in Sources */, 317 | D3DC73F81CCEC4FE00C1DF18 /* AuthenticationConstants.m in Sources */, 318 | D3DC73E21CCEC49F00C1DF18 /* AppDelegate.m in Sources */, 319 | D3DC73DF1CCEC49F00C1DF18 /* main.m in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | /* End PBXSourcesBuildPhase section */ 324 | 325 | /* Begin PBXVariantGroup section */ 326 | D3DC73E61CCEC49F00C1DF18 /* Main.storyboard */ = { 327 | isa = PBXVariantGroup; 328 | children = ( 329 | D3DC73E71CCEC49F00C1DF18 /* Base */, 330 | ); 331 | name = Main.storyboard; 332 | sourceTree = ""; 333 | }; 334 | D3DC73EB1CCEC49F00C1DF18 /* LaunchScreen.storyboard */ = { 335 | isa = PBXVariantGroup; 336 | children = ( 337 | D3DC73EC1CCEC49F00C1DF18 /* Base */, 338 | ); 339 | name = LaunchScreen.storyboard; 340 | sourceTree = ""; 341 | }; 342 | /* End PBXVariantGroup section */ 343 | 344 | /* Begin XCBuildConfiguration section */ 345 | D3DC73EF1CCEC49F00C1DF18 /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ALWAYS_SEARCH_USER_PATHS = NO; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INFINITE_RECURSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 362 | CLANG_WARN_UNREACHABLE_CODE = YES; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = NO; 366 | DEBUG_INFORMATION_FORMAT = dwarf; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | ENABLE_TESTABILITY = YES; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_DYNAMIC_NO_PIC = NO; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_OPTIMIZATION_LEVEL = 0; 373 | GCC_PREPROCESSOR_DEFINITIONS = ( 374 | "DEBUG=1", 375 | "$(inherited)", 376 | ); 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 384 | MTL_ENABLE_DEBUG_INFO = YES; 385 | ONLY_ACTIVE_ARCH = YES; 386 | SDKROOT = iphoneos; 387 | }; 388 | name = Debug; 389 | }; 390 | D3DC73F01CCEC49F00C1DF18 /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 406 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 407 | CLANG_WARN_UNREACHABLE_CODE = YES; 408 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 409 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 410 | COPY_PHASE_STRIP = NO; 411 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 412 | ENABLE_NS_ASSERTIONS = NO; 413 | ENABLE_STRICT_OBJC_MSGSEND = YES; 414 | GCC_C_LANGUAGE_STANDARD = gnu99; 415 | GCC_NO_COMMON_BLOCKS = YES; 416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 418 | GCC_WARN_UNDECLARED_SELECTOR = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | GCC_WARN_UNUSED_VARIABLE = YES; 422 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 423 | MTL_ENABLE_DEBUG_INFO = NO; 424 | SDKROOT = iphoneos; 425 | VALIDATE_PRODUCT = YES; 426 | }; 427 | name = Release; 428 | }; 429 | D3DC73F21CCEC49F00C1DF18 /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | baseConfigurationReference = 2E831AF7AAE5F4914073107B /* Pods-ios-objectivec-connect-sample.debug.xcconfig */; 432 | buildSettings = { 433 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 434 | CODE_SIGN_ENTITLEMENTS = "ios-objectivec-connect-sample/ios-objectivec-connect-sample.entitlements"; 435 | DEVELOPMENT_TEAM = ""; 436 | INFOPLIST_FILE = "ios-objectivec-connect-sample/Info.plist"; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 438 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.ios-objectivec-connect-sample"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | }; 441 | name = Debug; 442 | }; 443 | D3DC73F31CCEC49F00C1DF18 /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 1B67B02D36F3E5C97A1FFC05 /* Pods-ios-objectivec-connect-sample.release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CODE_SIGN_ENTITLEMENTS = "ios-objectivec-connect-sample/ios-objectivec-connect-sample.entitlements"; 449 | DEVELOPMENT_TEAM = ""; 450 | INFOPLIST_FILE = "ios-objectivec-connect-sample/Info.plist"; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 452 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.ios-objectivec-connect-sample"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | }; 455 | name = Release; 456 | }; 457 | /* End XCBuildConfiguration section */ 458 | 459 | /* Begin XCConfigurationList section */ 460 | D3DC73D51CCEC49F00C1DF18 /* Build configuration list for PBXProject "ios-objectivec-connect-sample" */ = { 461 | isa = XCConfigurationList; 462 | buildConfigurations = ( 463 | D3DC73EF1CCEC49F00C1DF18 /* Debug */, 464 | D3DC73F01CCEC49F00C1DF18 /* Release */, 465 | ); 466 | defaultConfigurationIsVisible = 0; 467 | defaultConfigurationName = Release; 468 | }; 469 | D3DC73F11CCEC49F00C1DF18 /* Build configuration list for PBXNativeTarget "ios-objectivec-connect-sample" */ = { 470 | isa = XCConfigurationList; 471 | buildConfigurations = ( 472 | D3DC73F21CCEC49F00C1DF18 /* Debug */, 473 | D3DC73F31CCEC49F00C1DF18 /* Release */, 474 | ); 475 | defaultConfigurationIsVisible = 0; 476 | defaultConfigurationName = Release; 477 | }; 478 | /* End XCConfigurationList section */ 479 | }; 480 | rootObject = D3DC73D21CCEC49F00C1DF18 /* Project object */; 481 | } 482 | --------------------------------------------------------------------------------