├── O365-iOS-Microsoft-Graph-Snippets ├── eventDataPatch.json ├── patchMetadataFile.json ├── patchGroupData.json ├── newFolderData.json ├── newGroupData.json ├── newUserData.json ├── emailData.json ├── eventData.json ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── MultiformObject.m ├── ConnectViewController.h ├── AFHTTPResponseSerializerHTML.h ├── AppDelegate.h ├── SnippetsManagerConf.h ├── DetailTableViewController.h ├── MultiformObject.h ├── main.m ├── MasterViewController.h ├── ResizableTextTableViewCell.h ├── ParamsPostDataViewController.h ├── ParamsListTableViewController.h ├── SnippetsManagerConf.m ├── ParamsHelperDelegate.h ├── ResizableTextTableViewCell.m ├── AFHTTPResponseSerializerHTML.m ├── SnippetsManager.h ├── ParamsTextTableViewController.h ├── ParamsPostDataViewController.m ├── ParamsTextTableViewController.m ├── AuthenticationManager.h ├── AppDelegate.m ├── Base.lproj │ └── LaunchScreen.xib ├── Operation.h ├── NetworkManager.h ├── MasterViewController.m ├── Operation.m ├── ConnectViewController.m ├── AuthenticationManager.m ├── ParamsListTableViewController.m ├── NetworkManager.m └── DetailTableViewController.m ├── Resources └── o365.png ├── readme-images ├── AADPermissions.jpg └── OneNotePermissions.jpg ├── Podfile ├── .travis.yml ├── Notices.md ├── License.txt ├── .gitignore ├── O365-iOS-Microsoft-Graph-Snippets.xcodeproj ├── xcshareddata │ └── xcschemes │ │ └── O365-iOS-Microsoft-Graph-Snippets.xcscheme └── project.pbxproj └── README.md /O365-iOS-Microsoft-Graph-Snippets/eventDataPatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "Subject": "Sync of the Week" 3 | } -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/patchMetadataFile.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "New File Name", 3 | 4 | } -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/patchGroupData.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "This is an updated description" 3 | } 4 | -------------------------------------------------------------------------------- /Resources/o365.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoftgraph/ios-objectivec-snippets-rest-sample/master/Resources/o365.png -------------------------------------------------------------------------------- /readme-images/AADPermissions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoftgraph/ios-objectivec-snippets-rest-sample/master/readme-images/AADPermissions.jpg -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/newFolderData.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Test Folder", 3 | "folder": { }, 4 | "@name.conflictBehavior": "rename" 5 | } -------------------------------------------------------------------------------- /readme-images/OneNotePermissions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoftgraph/ios-objectivec-snippets-rest-sample/master/readme-images/OneNotePermissions.jpg -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/newGroupData.json: -------------------------------------------------------------------------------- 1 | { 2 | "displayName": "", 3 | "mailEnabled": false, 4 | "mailNickname": "", 5 | "securityEnabled": true 6 | } 7 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '6.0' 3 | 4 | target 'O365-iOS-Microsoft-Graph-Snippets' do 5 | pod 'AFNetworking', '2.6.0' 6 | pod 'ADALiOS', '1.2.4' 7 | end 8 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/newUserData.json: -------------------------------------------------------------------------------- 1 | { 2 | "accountEnabled": true, 3 | "displayName": "User ", 4 | "mailNickname": "", 5 | "passwordProfile": { 6 | "password": "p@ssw0rd!" 7 | }, 8 | "userPrincipalName": "@" 9 | } 10 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/emailData.json: -------------------------------------------------------------------------------- 1 | { 2 | "Message": { 3 | "Subject": "Unified API snippets", 4 | "Body": { 5 | "ContentType": "Text", 6 | "Content": "You can send an email by making a POST request to /me/sendMail." 7 | }, 8 | "ToRecipients": [ 9 | { 10 | "EmailAddress": { 11 | "Address": "" 12 | } 13 | } 14 | ] 15 | }, 16 | "SaveToSentItems": "true" 17 | } 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7 3 | xcode_workspace: O365-iOS-Microsoft-Graph-Snippets.xcworkspace 4 | xcode_scheme: O365-iOS-Microsoft-Graph-Snippets 5 | script: 6 | - xctool -workspace O365-iOS-Microsoft-Graph-Snippets.xcworkspace -scheme O365-iOS-Microsoft-Graph-Snippets -sdk iphonesimulator 7 | notifications: 8 | slack: 9 | secure: DBmG6F56yrQmLX7EDaht5qmCJbOOQNQT65IossyWRzuepDEul1qbZwHFt8C9yF5tatgmV5vgDPh0ByR8mq9LaHlgW1YAJ+4mbRva74p5MD7tE7ZspscguNrQFUxzEQroj3j4Qa++ScOgkf+dDaXab57r1WP3wlL7Zkm6p9B+D34= 10 | email: 11 | recipients: 12 | - jak@microsoft.com 13 | on_success: never 14 | on_failure: always 15 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/eventData.json: -------------------------------------------------------------------------------- 1 | { 2 | "Subject": "Weekly Sync", 3 | "Location": { 4 | "DisplayName": "Water cooler" 5 | }, 6 | "Attendees": [ 7 | {"Type": "Required", "EmailAddress": {"Address": "mara@fabrikam.com"}} 8 | ], 9 | "Start": { 10 | "DateTime": "", 11 | "TimeZone": "" 12 | }, 13 | "End": { 14 | "DateTime": "", 15 | "TimeZone": "" 16 | }, 17 | "Body": { 18 | "Content": "Status updates, blocking issues, and next steps.", 19 | "ContentType": "Text" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Notices.md: -------------------------------------------------------------------------------- 1 | #Third Party Notices for iOS REST API Explorer 2 | 3 | This project incorporates material from the project(s) listed below (collectively, "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notices and licenses, under which Microsoft received such Third Party Code, are set out below together with the full text of such licenses. These notices and licenses are provided for informational purposes only. This Third Party Code is licensed to you under the terms set forth in the licenses set forth below. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. 4 | 5 | 6 | 7 | - [Azure Active Directory Authentication Library for iOS](https://github.com/AzureAD/azure-activedirectory-library-for-objc), which is Copyright (c) Microsoft Open Technologies, Inc. and is available under the Apache 2.0 license: [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) ("License"). 8 | 9 | - [AFNetworking](https://github.com/AFNetworking/AFNetworking), which is Copyright (c) Alamofire Software Foundation and is available under the MIT license. 10 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | 4 | Copyright (c) 2015 Microsoft 5 | 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Xcode ### 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.xcuserstate 18 | 19 | 20 | ### Objective-C ### 21 | # Xcode 22 | # 23 | build/ 24 | *.pbxuser 25 | !default.pbxuser 26 | *.mode1v3 27 | !default.mode1v3 28 | *.mode2v3 29 | !default.mode2v3 30 | *.perspectivev3 31 | !default.perspectivev3 32 | xcuserdata 33 | *.xccheckout 34 | *.moved-aside 35 | DerivedData 36 | *.hmap 37 | *.ipa 38 | *.xcuserstate 39 | *.xcworkspace 40 | 41 | # CocoaPods 42 | # 43 | Pods/ 44 | *Podfile.lock 45 | 46 | ### OSX ### 47 | .DS_Store 48 | .AppleDouble 49 | .LSOverride 50 | 51 | # Icon must end with two \r 52 | Icon 53 | 54 | 55 | # Thumbnails 56 | ._* 57 | 58 | # Files that might appear in the root of a volume 59 | .DocumentRevisions-V100 60 | .fseventsd 61 | .Spotlight-V100 62 | .TemporaryItems 63 | .Trashes 64 | .VolumeIcon.icns 65 | 66 | # Directories potentially created on remote AFP share 67 | .AppleDB 68 | .AppleDesktop 69 | Network Trash Folder 70 | Temporary Items 71 | .apdisk 72 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.microsoft.$(PRODUCT_NAME:rfc1034identifier) 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 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/MultiformObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "MultiformObject.h" 6 | 7 | @implementation MultiformObject 8 | 9 | @end 10 | 11 | 12 | // ********************************************************* 13 | // 14 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 15 | // 16 | // Copyright (c) Microsoft Corporation 17 | // All rights reserved. 18 | // 19 | // MIT License: 20 | // Permission is hereby granted, free of charge, to any person obtaining 21 | // a copy of this software and associated documentation files (the 22 | // "Software"), to deal in the Software without restriction, including 23 | // without limitation the rights to use, copy, modify, merge, publish, 24 | // distribute, sublicense, and/or sell copies of the Software, and to 25 | // permit persons to whom the Software is furnished to do so, subject to 26 | // the following conditions: 27 | // 28 | // The above copyright notice and this permission notice shall be 29 | // included in all copies or substantial portions of the Software. 30 | // 31 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 32 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 33 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 34 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 35 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 36 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 37 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38 | // 39 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ConnectViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @interface ConnectViewController : UIViewController 8 | 9 | @end 10 | 11 | 12 | 13 | // ********************************************************* 14 | // 15 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 16 | // 17 | // Copyright (c) Microsoft Corporation 18 | // All rights reserved. 19 | // 20 | // MIT License: 21 | // Permission is hereby granted, free of charge, to any person obtaining 22 | // a copy of this software and associated documentation files (the 23 | // "Software"), to deal in the Software without restriction, including 24 | // without limitation the rights to use, copy, modify, merge, publish, 25 | // distribute, sublicense, and/or sell copies of the Software, and to 26 | // permit persons to whom the Software is furnished to do so, subject to 27 | // the following conditions: 28 | // 29 | // The above copyright notice and this permission notice shall be 30 | // included in all copies or substantial portions of the Software. 31 | // 32 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 33 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 34 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 35 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 36 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 37 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 38 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 39 | // 40 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/AFHTTPResponseSerializerHTML.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "AFURLResponseSerialization.h" 6 | 7 | @interface AFHTTPResponseSerializerHTML : AFHTTPResponseSerializer 8 | 9 | @end 10 | 11 | 12 | // ********************************************************* 13 | // 14 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 15 | // 16 | // Copyright (c) Microsoft Corporation 17 | // All rights reserved. 18 | // 19 | // MIT License: 20 | // Permission is hereby granted, free of charge, to any person obtaining 21 | // a copy of this software and associated documentation files (the 22 | // "Software"), to deal in the Software without restriction, including 23 | // without limitation the rights to use, copy, modify, merge, publish, 24 | // distribute, sublicense, and/or sell copies of the Software, and to 25 | // permit persons to whom the Software is furnished to do so, subject to 26 | // the following conditions: 27 | // 28 | // The above copyright notice and this permission notice shall be 29 | // included in all copies or substantial portions of the Software. 30 | // 31 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 32 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 33 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 34 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 35 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 36 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 37 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38 | // 39 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @interface AppDelegate : UIResponder 8 | 9 | @property (strong, nonatomic) UIWindow *window; 10 | 11 | 12 | @end 13 | 14 | 15 | // ********************************************************* 16 | // 17 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 18 | // 19 | // Copyright (c) Microsoft Corporation 20 | // All rights reserved. 21 | // 22 | // MIT License: 23 | // Permission is hereby granted, free of charge, to any person obtaining 24 | // a copy of this software and associated documentation files (the 25 | // "Software"), to deal in the Software without restriction, including 26 | // without limitation the rights to use, copy, modify, merge, publish, 27 | // distribute, sublicense, and/or sell copies of the Software, and to 28 | // permit persons to whom the Software is furnished to do so, subject to 29 | // the following conditions: 30 | // 31 | // The above copyright notice and this permission notice shall be 32 | // included in all copies or substantial portions of the Software. 33 | // 34 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 36 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 38 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 39 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 40 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41 | // 42 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/SnippetsManagerConf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @interface SnippetsManagerConf : NSObject 8 | 9 | + (NSString *) hostName_beta ; 10 | + (NSString *) protocol ; 11 | 12 | @end 13 | 14 | 15 | // ********************************************************* 16 | // 17 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 18 | // 19 | // Copyright (c) Microsoft Corporation 20 | // All rights reserved. 21 | // 22 | // MIT License: 23 | // Permission is hereby granted, free of charge, to any person obtaining 24 | // a copy of this software and associated documentation files (the 25 | // "Software"), to deal in the Software without restriction, including 26 | // without limitation the rights to use, copy, modify, merge, publish, 27 | // distribute, sublicense, and/or sell copies of the Software, and to 28 | // permit persons to whom the Software is furnished to do so, subject to 29 | // the following conditions: 30 | // 31 | // The above copyright notice and this permission notice shall be 32 | // included in all copies or substantial portions of the Software. 33 | // 34 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 36 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 38 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 39 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 40 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41 | // 42 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/DetailTableViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import "Operation.h" 7 | 8 | @interface DetailTableViewController : UITableViewController 9 | 10 | @property (strong, nonatomic) Operation *operation; 11 | 12 | @end 13 | 14 | 15 | // ********************************************************* 16 | // 17 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 18 | // 19 | // Copyright (c) Microsoft Corporation 20 | // All rights reserved. 21 | // 22 | // MIT License: 23 | // Permission is hereby granted, free of charge, to any person obtaining 24 | // a copy of this software and associated documentation files (the 25 | // "Software"), to deal in the Software without restriction, including 26 | // without limitation the rights to use, copy, modify, merge, publish, 27 | // distribute, sublicense, and/or sell copies of the Software, and to 28 | // permit persons to whom the Software is furnished to do so, subject to 29 | // the following conditions: 30 | // 31 | // The above copyright notice and this permission notice shall be 32 | // included in all copies or substantial portions of the Software. 33 | // 34 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 36 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 38 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 39 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 40 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41 | // 42 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/MultiformObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @interface MultiformObject : NSObject 8 | 9 | @property (nonatomic, strong) NSDictionary *headers; 10 | @property (nonatomic, strong) NSData *body; 11 | 12 | @end 13 | 14 | 15 | // ********************************************************* 16 | // 17 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 18 | // 19 | // Copyright (c) Microsoft Corporation 20 | // All rights reserved. 21 | // 22 | // MIT License: 23 | // Permission is hereby granted, free of charge, to any person obtaining 24 | // a copy of this software and associated documentation files (the 25 | // "Software"), to deal in the Software without restriction, including 26 | // without limitation the rights to use, copy, modify, merge, publish, 27 | // distribute, sublicense, and/or sell copies of the Software, and to 28 | // permit persons to whom the Software is furnished to do so, subject to 29 | // the following conditions: 30 | // 31 | // The above copyright notice and this permission notice shall be 32 | // included in all copies or substantial portions of the Software. 33 | // 34 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 36 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 38 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 39 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 40 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41 | // 42 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import "AppDelegate.h" 7 | 8 | int main(int argc, char * argv[]) { 9 | @autoreleasepool { 10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 11 | } 12 | } 13 | 14 | 15 | 16 | // ********************************************************* 17 | // 18 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 19 | // 20 | // Copyright (c) Microsoft Corporation 21 | // All rights reserved. 22 | // 23 | // MIT License: 24 | // Permission is hereby granted, free of charge, to any person obtaining 25 | // a copy of this software and associated documentation files (the 26 | // "Software"), to deal in the Software without restriction, including 27 | // without limitation the rights to use, copy, modify, merge, publish, 28 | // distribute, sublicense, and/or sell copies of the Software, and to 29 | // permit persons to whom the Software is furnished to do so, subject to 30 | // the following conditions: 31 | // 32 | // The above copyright notice and this permission notice shall be 33 | // included in all copies or substantial portions of the Software. 34 | // 35 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 36 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 37 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 38 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 39 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 40 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 41 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 42 | // 43 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/MasterViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @class DetailViewController; 8 | 9 | @interface MasterViewController : UITableViewController 10 | 11 | @property (strong, nonatomic) DetailViewController *detailViewController; 12 | 13 | 14 | @end 15 | 16 | 17 | // ********************************************************* 18 | // 19 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 20 | // 21 | // Copyright (c) Microsoft Corporation 22 | // All rights reserved. 23 | // 24 | // MIT License: 25 | // Permission is hereby granted, free of charge, to any person obtaining 26 | // a copy of this software and associated documentation files (the 27 | // "Software"), to deal in the Software without restriction, including 28 | // without limitation the rights to use, copy, modify, merge, publish, 29 | // distribute, sublicense, and/or sell copies of the Software, and to 30 | // permit persons to whom the Software is furnished to do so, subject to 31 | // the following conditions: 32 | // 33 | // The above copyright notice and this permission notice shall be 34 | // included in all copies or substantial portions of the Software. 35 | // 36 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 38 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 40 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 41 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 42 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | // 44 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ResizableTextTableViewCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @interface ResizableTextTableViewCell : UITableViewCell 8 | 9 | @property (weak, nonatomic) IBOutlet UITextView *textView; 10 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *heightConstraint; 11 | 12 | @end 13 | 14 | 15 | // ********************************************************* 16 | // 17 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 18 | // 19 | // Copyright (c) Microsoft Corporation 20 | // All rights reserved. 21 | // 22 | // MIT License: 23 | // Permission is hereby granted, free of charge, to any person obtaining 24 | // a copy of this software and associated documentation files (the 25 | // "Software"), to deal in the Software without restriction, including 26 | // without limitation the rights to use, copy, modify, merge, publish, 27 | // distribute, sublicense, and/or sell copies of the Software, and to 28 | // permit persons to whom the Software is furnished to do so, subject to 29 | // the following conditions: 30 | // 31 | // The above copyright notice and this permission notice shall be 32 | // included in all copies or substantial portions of the Software. 33 | // 34 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 36 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 38 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 39 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 40 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41 | // 42 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsPostDataViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import "ParamsHelperDelegate.h" 7 | 8 | @interface ParamsPostDataViewController : UIViewController 9 | 10 | 11 | @property (nonatomic, strong) NSString *payload; 12 | 13 | @property (nonatomic, weak) id paramsDelegate; 14 | @end 15 | 16 | 17 | // ********************************************************* 18 | // 19 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 20 | // 21 | // Copyright (c) Microsoft Corporation 22 | // All rights reserved. 23 | // 24 | // MIT License: 25 | // Permission is hereby granted, free of charge, to any person obtaining 26 | // a copy of this software and associated documentation files (the 27 | // "Software"), to deal in the Software without restriction, including 28 | // without limitation the rights to use, copy, modify, merge, publish, 29 | // distribute, sublicense, and/or sell copies of the Software, and to 30 | // permit persons to whom the Software is furnished to do so, subject to 31 | // the following conditions: 32 | // 33 | // The above copyright notice and this permission notice shall be 34 | // included in all copies or substantial portions of the Software. 35 | // 36 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 38 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 40 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 41 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 42 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | // 44 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsListTableViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import "Operation.h" 7 | #import "ParamsHelperDelegate.h" 8 | 9 | @interface ParamsListTableViewController : UITableViewController 10 | 11 | @property (nonatomic, assign) ParamsSourceType paramsSourceType; 12 | @property (nonatomic, weak) id paramsDelegate; 13 | 14 | @end 15 | 16 | 17 | // ********************************************************* 18 | // 19 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 20 | // 21 | // Copyright (c) Microsoft Corporation 22 | // All rights reserved. 23 | // 24 | // MIT License: 25 | // Permission is hereby granted, free of charge, to any person obtaining 26 | // a copy of this software and associated documentation files (the 27 | // "Software"), to deal in the Software without restriction, including 28 | // without limitation the rights to use, copy, modify, merge, publish, 29 | // distribute, sublicense, and/or sell copies of the Software, and to 30 | // permit persons to whom the Software is furnished to do so, subject to 31 | // the following conditions: 32 | // 33 | // The above copyright notice and this permission notice shall be 34 | // included in all copies or substantial portions of the Software. 35 | // 36 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 38 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 40 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 41 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 42 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | // 44 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/SnippetsManagerConf.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "SnippetsManagerConf.h" 6 | 7 | #define HOSTNAME_BETA @"graph.microsoft.com/v1.0"; 8 | #define PROTOCOL @"https"; 9 | 10 | @implementation SnippetsManagerConf 11 | 12 | + (NSString *)hostName_beta { 13 | return HOSTNAME_BETA; 14 | } 15 | 16 | + (NSString *)protocol { 17 | return PROTOCOL; 18 | } 19 | 20 | @end 21 | 22 | 23 | // ********************************************************* 24 | // 25 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 26 | // 27 | // Copyright (c) Microsoft Corporation 28 | // All rights reserved. 29 | // 30 | // MIT License: 31 | // Permission is hereby granted, free of charge, to any person obtaining 32 | // a copy of this software and associated documentation files (the 33 | // "Software"), to deal in the Software without restriction, including 34 | // without limitation the rights to use, copy, modify, merge, publish, 35 | // distribute, sublicense, and/or sell copies of the Software, and to 36 | // permit persons to whom the Software is furnished to do so, subject to 37 | // the following conditions: 38 | // 39 | // The above copyright notice and this permission notice shall be 40 | // included in all copies or substantial portions of the Software. 41 | // 42 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 43 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 44 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 45 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 46 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 47 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 48 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 49 | // 50 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsHelperDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #ifndef O365_iOS_Unified_API_Snippets_ParamsHelperDelegate_h 6 | #define O365_iOS_Unified_API_Snippets_ParamsHelperDelegate_h 7 | 8 | #import "Operation.h" 9 | 10 | @protocol ParamsHelperDelegate 11 | 12 | - (void) onSelectedValue:(NSString *)value 13 | withParamsType:(ParamsSourceType)sourceType; 14 | 15 | @end 16 | #endif 17 | 18 | 19 | 20 | // ********************************************************* 21 | // 22 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 23 | // 24 | // Copyright (c) Microsoft Corporation 25 | // All rights reserved. 26 | // 27 | // MIT License: 28 | // Permission is hereby granted, free of charge, to any person obtaining 29 | // a copy of this software and associated documentation files (the 30 | // "Software"), to deal in the Software without restriction, including 31 | // without limitation the rights to use, copy, modify, merge, publish, 32 | // distribute, sublicense, and/or sell copies of the Software, and to 33 | // permit persons to whom the Software is furnished to do so, subject to 34 | // the following conditions: 35 | // 36 | // The above copyright notice and this permission notice shall be 37 | // included in all copies or substantial portions of the Software. 38 | // 39 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 40 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 41 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 42 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 43 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 44 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 45 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 46 | // 47 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ResizableTextTableViewCell.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | // 5 | 6 | #import "ResizableTextTableViewCell.h" 7 | 8 | @implementation ResizableTextTableViewCell 9 | 10 | - (void)awakeFromNib { 11 | // Initialization code 12 | } 13 | 14 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 15 | [super setSelected:selected animated:animated]; 16 | 17 | // Configure the view for the selected state 18 | } 19 | 20 | @end 21 | 22 | 23 | // ********************************************************* 24 | // 25 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 26 | // 27 | // Copyright (c) Microsoft Corporation 28 | // All rights reserved. 29 | // 30 | // MIT License: 31 | // Permission is hereby granted, free of charge, to any person obtaining 32 | // a copy of this software and associated documentation files (the 33 | // "Software"), to deal in the Software without restriction, including 34 | // without limitation the rights to use, copy, modify, merge, publish, 35 | // distribute, sublicense, and/or sell copies of the Software, and to 36 | // permit persons to whom the Software is furnished to do so, subject to 37 | // the following conditions: 38 | // 39 | // The above copyright notice and this permission notice shall be 40 | // included in all copies or substantial portions of the Software. 41 | // 42 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 43 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 44 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 45 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 46 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 47 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 48 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 49 | // 50 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/AFHTTPResponseSerializerHTML.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "AFHTTPResponseSerializerHTML.h" 6 | 7 | @implementation AFHTTPResponseSerializerHTML 8 | 9 | - (id)responseObjectForResponse:(NSURLResponse *)response 10 | data:(NSData *)data 11 | error:(NSError *__autoreleasing *)error 12 | { 13 | return [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; 14 | } 15 | 16 | @end 17 | 18 | 19 | // ********************************************************* 20 | // 21 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 22 | // 23 | // Copyright (c) Microsoft Corporation 24 | // All rights reserved. 25 | // 26 | // MIT License: 27 | // Permission is hereby granted, free of charge, to any person obtaining 28 | // a copy of this software and associated documentation files (the 29 | // "Software"), to deal in the Software without restriction, including 30 | // without limitation the rights to use, copy, modify, merge, publish, 31 | // distribute, sublicense, and/or sell copies of the Software, and to 32 | // permit persons to whom the Software is furnished to do so, subject to 33 | // the following conditions: 34 | // 35 | // The above copyright notice and this permission notice shall be 36 | // included in all copies or substantial portions of the Software. 37 | // 38 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 39 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 40 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 41 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 42 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 43 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 44 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 45 | // 46 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/SnippetsManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | @class Operation; 8 | 9 | @interface SnippetsManager : NSObject 10 | 11 | // Section names 12 | @property (nonatomic, strong) NSArray *sections; 13 | 14 | // Operations array 15 | @property (nonatomic, strong) NSMutableArray *operationsArray; 16 | 17 | // Public operations 18 | - (Operation *) getUserEvents; 19 | - (Operation *) getGroupsInTenant; 20 | - (Operation *) getUserFiles; 21 | @end 22 | 23 | 24 | // ********************************************************* 25 | // 26 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 27 | // 28 | // Copyright (c) Microsoft Corporation 29 | // All rights reserved. 30 | // 31 | // MIT License: 32 | // Permission is hereby granted, free of charge, to any person obtaining 33 | // a copy of this software and associated documentation files (the 34 | // "Software"), to deal in the Software without restriction, including 35 | // without limitation the rights to use, copy, modify, merge, publish, 36 | // distribute, sublicense, and/or sell copies of the Software, and to 37 | // permit persons to whom the Software is furnished to do so, subject to 38 | // the following conditions: 39 | // 40 | // The above copyright notice and this permission notice shall be 41 | // included in all copies or substantial portions of the Software. 42 | // 43 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 44 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 45 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 46 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 47 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 48 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 49 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 50 | // 51 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsTextTableViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import "ParamsHelperDelegate.h" 7 | 8 | @class Operation; 9 | 10 | @interface ParamsTextTableViewController : UITableViewController 11 | 12 | @property (nonatomic, weak) Operation *operation; 13 | 14 | @property (nonatomic, assign) NSString *selectedKey; 15 | @property (nonatomic, assign )BOOL isEditable; 16 | @property (weak, nonatomic) IBOutlet UITextField *textField; 17 | 18 | @property (nonatomic, weak) id delegate; 19 | 20 | @end 21 | 22 | 23 | // ********************************************************* 24 | // 25 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 26 | // 27 | // Copyright (c) Microsoft Corporation 28 | // All rights reserved. 29 | // 30 | // MIT License: 31 | // Permission is hereby granted, free of charge, to any person obtaining 32 | // a copy of this software and associated documentation files (the 33 | // "Software"), to deal in the Software without restriction, including 34 | // without limitation the rights to use, copy, modify, merge, publish, 35 | // distribute, sublicense, and/or sell copies of the Software, and to 36 | // permit persons to whom the Software is furnished to do so, subject to 37 | // the following conditions: 38 | // 39 | // The above copyright notice and this permission notice shall be 40 | // included in all copies or substantial portions of the Software. 41 | // 42 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 43 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 44 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 45 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 46 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 47 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 48 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 49 | // 50 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsPostDataViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "ParamsPostDataViewController.h" 6 | 7 | 8 | @interface ParamsPostDataViewController() 9 | @property (weak, nonatomic) IBOutlet UITextView *textView; 10 | 11 | @end 12 | 13 | @implementation ParamsPostDataViewController 14 | 15 | - (void)viewDidLoad { 16 | [super viewDidLoad]; 17 | self.textView.text = self.payload; 18 | self.textView.delegate = self; 19 | } 20 | 21 | #pragma mark - uitextfield delegate 22 | - (void) textViewDidEndEditing:(UITextView *)textView { 23 | [self.paramsDelegate onSelectedValue:textView.text 24 | withParamsType:ParamsSourcePostData]; 25 | 26 | } 27 | 28 | @end 29 | 30 | 31 | // ********************************************************* 32 | // 33 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 34 | // 35 | // Copyright (c) Microsoft Corporation 36 | // All rights reserved. 37 | // 38 | // MIT License: 39 | // Permission is hereby granted, free of charge, to any person obtaining 40 | // a copy of this software and associated documentation files (the 41 | // "Software"), to deal in the Software without restriction, including 42 | // without limitation the rights to use, copy, modify, merge, publish, 43 | // distribute, sublicense, and/or sell copies of the Software, and to 44 | // permit persons to whom the Software is furnished to do so, subject to 45 | // the following conditions: 46 | // 47 | // The above copyright notice and this permission notice shall be 48 | // included in all copies or substantial portions of the Software. 49 | // 50 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 51 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 52 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 53 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 54 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 55 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 56 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 57 | // 58 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsTextTableViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "ParamsTextTableViewController.h" 6 | #import "Operation.h" 7 | 8 | @interface ParamsTextTableViewController () 9 | 10 | @end 11 | 12 | @implementation ParamsTextTableViewController 13 | 14 | - (void) viewDidLoad { 15 | [super viewDidLoad]; 16 | 17 | self.title = self.selectedKey; 18 | self.textField.delegate = self; 19 | 20 | if([self.selectedKey isEqualToString:@"API URL"]){ 21 | self.textField.text = self.operation.operationURLString; 22 | self.textField.placeholder = self.selectedKey; 23 | } 24 | 25 | else{ 26 | self.textField.text = [self.operation.params objectForKey:self.selectedKey]; 27 | self.textField.placeholder = self.selectedKey; 28 | } 29 | 30 | } 31 | 32 | - (void) didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | - (void) textFieldDidEndEditing:(UITextField *)textField { 38 | 39 | if([self.selectedKey isEqualToString:@"API URL"]) 40 | self.operation.operationURLString = self.textField.text; 41 | 42 | else{ 43 | NSMutableDictionary *newParams = [NSMutableDictionary dictionaryWithDictionary:self.operation.params]; 44 | [newParams setObject:self.textField.text forKey:self.selectedKey]; 45 | self.operation.params = newParams; 46 | } 47 | [self.delegate onSelectedValue:self.textField.text withParamsType:ParamsSourceTextEdit]; 48 | } 49 | 50 | @end 51 | 52 | 53 | // ********************************************************* 54 | // 55 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 56 | // 57 | // Copyright (c) Microsoft Corporation 58 | // All rights reserved. 59 | // 60 | // MIT License: 61 | // Permission is hereby granted, free of charge, to any person obtaining 62 | // a copy of this software and associated documentation files (the 63 | // "Software"), to deal in the Software without restriction, including 64 | // without limitation the rights to use, copy, modify, merge, publish, 65 | // distribute, sublicense, and/or sell copies of the Software, and to 66 | // permit persons to whom the Software is furnished to do so, subject to 67 | // the following conditions: 68 | // 69 | // The above copyright notice and this permission notice shall be 70 | // included in all copies or substantial portions of the Software. 71 | // 72 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 73 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 74 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 75 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 76 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 77 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 78 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 79 | // 80 | // ********************************************************* 81 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/AuthenticationManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import 7 | #import 8 | 9 | /** 10 | * AuthenticationManager 11 | * This class is used as an interface between a UIViewController and authentication. 12 | * If additional authentication mechanisms are used, this class is scalable. 13 | */ 14 | 15 | @interface AuthenticationManager : NSObject 16 | 17 | + (AuthenticationManager*)sharedInstance; 18 | 19 | - (void)initWithAuthority:(NSString *)authority 20 | clientId:(NSString *)clientId 21 | redirectURI:(NSString *)redirectURI 22 | resourceID: (NSString *)resourceID 23 | completion:(void (^)(ADAuthenticationError *error))completion; 24 | 25 | @property (nonatomic, strong) NSString *accessToken; 26 | @property (nonatomic, strong) NSString *refreshToken; 27 | @property (nonatomic, strong) NSDate *expiresDate; 28 | 29 | @property (nonatomic, strong) NSString *givenName; 30 | @property (nonatomic, strong) NSString *familyName; 31 | @property (nonatomic, strong) NSString *userID; 32 | 33 | // Acquire token 34 | - (void)acquireAuthTokenWithResource:(NSString *)resourceID 35 | clientID:(NSString *)clientID 36 | redirectURI:(NSURL*)redirectURI 37 | completion:(void (^)(ADAuthenticationError *error))completion; 38 | 39 | - (void) acquireAuthTokenCompletion:(void (^)(ADAuthenticationError *error))completion; 40 | 41 | // Clears the ADAL token cache and the cookie cache. 42 | - (void) clearCredentials; 43 | 44 | // Check and refresh tokens if needed 45 | - (void) checkAndRefreshTokenWithCompletion:(void (^)(ADAuthenticationError *error))completion; 46 | 47 | @end 48 | 49 | // ********************************************************* 50 | // 51 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 52 | // 53 | // Copyright (c) Microsoft Corporation 54 | // All rights reserved. 55 | // 56 | // MIT License: 57 | // Permission is hereby granted, free of charge, to any person obtaining 58 | // a copy of this software and associated documentation files (the 59 | // "Software"), to deal in the Software without restriction, including 60 | // without limitation the rights to use, copy, modify, merge, publish, 61 | // distribute, sublicense, and/or sell copies of the Software, and to 62 | // permit persons to whom the Software is furnished to do so, subject to 63 | // the following conditions: 64 | // 65 | // The above copyright notice and this permission notice shall be 66 | // included in all copies or substantial portions of the Software. 67 | // 68 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 69 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 70 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 71 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 72 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 73 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 74 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 75 | // 76 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "AppDelegate.h" 6 | #import "DetailTableViewController.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 | 43 | 44 | 45 | @end 46 | 47 | 48 | // ********************************************************* 49 | // 50 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 51 | // 52 | // Copyright (c) Microsoft Corporation 53 | // All rights reserved. 54 | // 55 | // MIT License: 56 | // Permission is hereby granted, free of charge, to any person obtaining 57 | // a copy of this software and associated documentation files (the 58 | // "Software"), to deal in the Software without restriction, including 59 | // without limitation the rights to use, copy, modify, merge, publish, 60 | // distribute, sublicense, and/or sell copies of the Software, and to 61 | // permit persons to whom the Software is furnished to do so, subject to 62 | // the following conditions: 63 | // 64 | // The above copyright notice and this permission notice shall be 65 | // included in all copies or substantial portions of the Software. 66 | // 67 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 68 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 69 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 70 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 71 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 72 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 73 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 74 | // 75 | // ********************************************************* 76 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets.xcodeproj/xcshareddata/xcschemes/O365-iOS-Microsoft-Graph-Snippets.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/Operation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | 7 | typedef enum{ 8 | OperationPost, 9 | OperationPostCustom, 10 | OperationGet, 11 | OperationDelete, 12 | OperationPostMultiPart, 13 | OperationPatch, 14 | OperationPatchCustom, 15 | OperationPut 16 | } OperationType; 17 | 18 | typedef enum{ 19 | ParamsSourceTextEdit = 1, 20 | ParamsSourceGetEvents = 2, 21 | ParamsSourceGetGroups = 3, 22 | ParamsSourcePostData = 4, 23 | ParamsSourceGetFiles = 5 24 | } ParamsSourceType; 25 | 26 | extern NSString* const ParamsEventIDKey; 27 | extern NSString* const ParamsGroupIDKey; 28 | extern NSString* const ParamsFileIDKey; 29 | 30 | extern NSString* const ParamsPostDataKey; 31 | 32 | @interface Operation : NSObject 33 | 34 | @property (nonatomic, strong) NSString *operationName; 35 | @property (nonatomic, strong) NSString *operationURLString; 36 | 37 | @property (nonatomic, strong) NSString *descriptionString; 38 | @property (nonatomic, strong) NSString *documentationLinkString; 39 | 40 | @property (nonatomic, assign) OperationType operationType; 41 | 42 | @property (nonatomic, strong) NSDictionary *customHeader; 43 | @property (nonatomic, strong) NSString *customBody; 44 | 45 | @property (nonatomic, strong) NSDictionary *params; 46 | @property (nonatomic, strong) NSDictionary *paramsSource; 47 | 48 | @property (nonatomic, strong) NSString *customResponseType; 49 | 50 | @property (nonatomic, strong) NSArray *multiPartObjectArray; 51 | 52 | @property (nonatomic, assign) BOOL isAdminRequired; 53 | 54 | - (instancetype) initWithOperationName:(NSString *)operationName 55 | urlString:(NSString *)urlString 56 | operationType:(OperationType)operationType 57 | description:(NSString *)description 58 | documentationLink:(NSString *)documentationLink 59 | params:(NSDictionary *)params 60 | paramsSource:(NSDictionary *)paramsSource; 61 | 62 | - (instancetype) initWithOperationName:(NSString *)operationName 63 | urlString:(NSString *)urlString 64 | operationType:(OperationType)operationType 65 | customHeader:(NSDictionary *)customHeader 66 | customBody:(NSString *)customBody 67 | description:(NSString *)description 68 | documentationLink:(NSString *)documentationLink 69 | params:(NSDictionary *)params 70 | paramsSource:(NSDictionary *)paramsSource; 71 | 72 | - (instancetype) initWithOperationName:(NSString *)operationName 73 | urlString:(NSString *)urlString 74 | operationType:(OperationType)operationType 75 | description:(NSString *)description 76 | documentationLink:(NSString *)documentationLink 77 | multiPartObjects:(NSArray *)multiPartObjects; 78 | 79 | @end 80 | 81 | 82 | // ********************************************************* 83 | // 84 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 85 | // 86 | // Copyright (c) Microsoft Corporation 87 | // All rights reserved. 88 | // 89 | // MIT License: 90 | // Permission is hereby granted, free of charge, to any person obtaining 91 | // a copy of this software and associated documentation files (the 92 | // "Software"), to deal in the Software without restriction, including 93 | // without limitation the rights to use, copy, modify, merge, publish, 94 | // distribute, sublicense, and/or sell copies of the Software, and to 95 | // permit persons to whom the Software is furnished to do so, subject to 96 | // the following conditions: 97 | // 98 | // The above copyright notice and this permission notice shall be 99 | // included in all copies or substantial portions of the Software. 100 | // 101 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 102 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 103 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 104 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 105 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 106 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 107 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 108 | // 109 | // ********************************************************* 110 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/NetworkManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import 6 | #import "MultiformObject.h" 7 | 8 | @interface NetworkManager : NSObject 9 | 10 | // GET 11 | + (void)getOperation:(NSString *)path 12 | queryParams:(NSDictionary *)queryParams 13 | success:(void (^)(id responseHeader, id responseObject))success 14 | failure:(void (^)(id responseObject))failure; 15 | 16 | // GET with custom response type 17 | // For example, acceptable response type @"text/html" 18 | + (void)getOperation:(NSString *)path 19 | queryParams:(NSDictionary *)queryParams 20 | customResponseType:(NSString *)responseType 21 | success:(void (^)(id responseHeader, id responseObject))success 22 | failure:(void (^)(id responseObject))failure; 23 | 24 | // POST using query params in a dictionary 25 | // This will create json payload in the request 26 | + (void)postOperation:(NSString *)path 27 | queryParams:(NSDictionary *)queryParams 28 | success:(void (^)(id responseHeader, id responseObject))success 29 | failure:(void (^)(id responseObject))failure; 30 | 31 | // POST using custom header and body 32 | + (void)postOperation:(NSString *)path 33 | customHeader:(NSDictionary *)customHeader 34 | customBody:(NSString *)bodyString 35 | success:(void (^)(id responseHeader, id responseObject))success 36 | failure:(void (^)(id responseObject))failure; 37 | 38 | // DELETE 39 | + (void)deleteOperation:(NSString *)path queryParams:(NSDictionary *)queryParams 40 | success:(void (^)(id responseHeader, id responseObject))success 41 | failure:(void (^)(id responseObject))failure; 42 | 43 | 44 | // PATCH using query params in a dictionary 45 | // This will create json payload in the request 46 | + (void)patchOperation:(NSString *)path 47 | queryParams:(NSDictionary *)queryParams 48 | success:(void (^)(id responseHeader, id responseObject))success 49 | failure:(void (^)(id responseObject))failure; 50 | 51 | 52 | // PATCH using custom header and body 53 | + (void)patchOperation:(NSString *)path 54 | customHeader:(NSDictionary *)customHeader 55 | customBody:(NSString *)bodyString 56 | success:(void (^)(id responseHeader, id responseObject))success 57 | failure:(void (^)(id responseObject))failure; 58 | 59 | // POST multipart form 60 | + (void)postWithMultipartForm:(NSString *)path 61 | queryParams:(NSDictionary *)queryParams 62 | multiformObjects:(NSArray *)multiformObjects 63 | success:(void (^)(id responseHeader, id responseObject))success 64 | failure:(void (^)(id responseObject))failure; 65 | 66 | //PUT using custom header and body 67 | + (void)putOperation:(NSString *)path 68 | customHeader:(NSDictionary *)customHeader 69 | customBody:(NSString *)bodyString 70 | success:(void (^)(id responseHeader, id responseObject))success 71 | failure:(void (^)(id responseObject))failure; 72 | 73 | @end 74 | 75 | 76 | // ********************************************************* 77 | // 78 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 79 | // 80 | // Copyright (c) Microsoft Corporation 81 | // All rights reserved. 82 | // 83 | // MIT License: 84 | // Permission is hereby granted, free of charge, to any person obtaining 85 | // a copy of this software and associated documentation files (the 86 | // "Software"), to deal in the Software without restriction, including 87 | // without limitation the rights to use, copy, modify, merge, publish, 88 | // distribute, sublicense, and/or sell copies of the Software, and to 89 | // permit persons to whom the Software is furnished to do so, subject to 90 | // the following conditions: 91 | // 92 | // The above copyright notice and this permission notice shall be 93 | // included in all copies or substantial portions of the Software. 94 | // 95 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 96 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 97 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 98 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 99 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 100 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 101 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 102 | // 103 | // ********************************************************* 104 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/MasterViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "MasterViewController.h" 6 | #import "DetailTableViewController.h" 7 | #import "AuthenticationManager.h" 8 | #import "ConnectViewController.h" 9 | #import "SnippetsManager.h" 10 | #import "Operation.h" 11 | 12 | @interface MasterViewController () 13 | 14 | //@property NSMutableArray *objects; 15 | @property (nonatomic, strong) SnippetsManager *snippetManager; 16 | 17 | @end 18 | 19 | @implementation MasterViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | 25 | _snippetManager = [[SnippetsManager alloc] init]; 26 | 27 | UIBarButtonItem *signOutButton = [[UIBarButtonItem alloc] initWithTitle:@"Disconnect" style:UIBarButtonItemStylePlain target:self action:@selector(signOut:)]; 28 | self.navigationItem.leftBarButtonItem = signOutButton; 29 | 30 | self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; 31 | 32 | 33 | } 34 | 35 | - (void)didReceiveMemoryWarning { 36 | [super didReceiveMemoryWarning]; 37 | // Dispose of any resources that can be recreated. 38 | } 39 | 40 | - (void)signOut:(id)sender { 41 | [[AuthenticationManager sharedInstance] clearCredentials]; 42 | [self dismissViewControllerAnimated:YES completion:^{ 43 | ; 44 | }]; 45 | 46 | } 47 | 48 | #pragma mark - Segues 49 | 50 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 51 | if ([[segue identifier] isEqualToString:@"showDetail"]) { 52 | NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; 53 | DetailTableViewController *controller = (DetailTableViewController *)[[segue destinationViewController] topViewController]; 54 | 55 | controller.operation = [(self.snippetManager.operationsArray[indexPath.section])[indexPath.row] copy]; 56 | 57 | [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; 58 | controller.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem; 59 | controller.navigationItem.leftItemsSupplementBackButton = YES; 60 | } 61 | } 62 | 63 | #pragma mark - Table View 64 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 65 | return self.snippetManager.sections[section]; 66 | } 67 | 68 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 69 | return [self.snippetManager.sections count]; 70 | } 71 | 72 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 73 | return ((NSArray *)self.snippetManager.operationsArray[section]).count; 74 | } 75 | 76 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 77 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; 78 | 79 | Operation *operation = (self.snippetManager.operationsArray[indexPath.section])[indexPath.row]; 80 | cell.textLabel.text = [operation operationName]; 81 | 82 | if(operation.isAdminRequired) 83 | cell.detailTextLabel.text = @"Requires admin account"; 84 | else 85 | cell.detailTextLabel.text = @" "; 86 | 87 | return cell; 88 | } 89 | 90 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 91 | [self performSegueWithIdentifier:@"showDetail" sender:nil]; 92 | } 93 | 94 | @end 95 | 96 | 97 | // ********************************************************* 98 | // 99 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 100 | // 101 | // Copyright (c) Microsoft Corporation 102 | // All rights reserved. 103 | // 104 | // MIT License: 105 | // Permission is hereby granted, free of charge, to any person obtaining 106 | // a copy of this software and associated documentation files (the 107 | // "Software"), to deal in the Software without restriction, including 108 | // without limitation the rights to use, copy, modify, merge, publish, 109 | // distribute, sublicense, and/or sell copies of the Software, and to 110 | // permit persons to whom the Software is furnished to do so, subject to 111 | // the following conditions: 112 | // 113 | // The above copyright notice and this permission notice shall be 114 | // included in all copies or substantial portions of the Software. 115 | // 116 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 117 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 118 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 119 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 120 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 121 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 122 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 123 | // 124 | // ********************************************************* 125 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/Operation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "Operation.h" 6 | 7 | @implementation Operation 8 | 9 | NSString* const ParamsEventIDKey = @"eventID"; 10 | NSString* const ParamsPostDataKey = @"Post data"; 11 | NSString* const ParamsGroupIDKey = @"groupID"; 12 | NSString* const ParamsFileIDKey = @"fileID"; 13 | 14 | - (instancetype) initWithOperationName:(NSString *)operationName 15 | urlString:(NSString *)urlString 16 | operationType:(OperationType)operationType 17 | description:(NSString *)description 18 | documentationLink:(NSString *)documentationLink 19 | params:(NSDictionary *)params 20 | paramsSource:(NSDictionary *)paramsSource { 21 | self = [super init]; 22 | if(self){ 23 | _operationName = operationName; 24 | _operationURLString = urlString; 25 | _operationType = operationType; 26 | _documentationLinkString = documentationLink; 27 | _descriptionString = description; 28 | _params = params; 29 | _paramsSource = paramsSource; 30 | _customResponseType = nil; 31 | } 32 | 33 | return self; 34 | } 35 | 36 | - (instancetype) initWithOperationName:(NSString *)operationName 37 | urlString:(NSString *)urlString 38 | operationType:(OperationType)operationType 39 | customHeader:(NSDictionary *)customHeader 40 | customBody:(NSString *)customBody 41 | description:(NSString *)description 42 | documentationLink:(NSString *)documentationLink 43 | params:(NSDictionary *)params 44 | paramsSource:(NSDictionary *)paramsSource { 45 | self = [super init]; 46 | if(self){ 47 | _operationName = operationName; 48 | _operationURLString = urlString; 49 | _operationType = operationType; 50 | _customHeader = customHeader; 51 | _customBody = customBody; 52 | _documentationLinkString = documentationLink; 53 | _descriptionString = description; 54 | _params = params; 55 | _paramsSource = paramsSource; 56 | _customResponseType = nil; 57 | } 58 | 59 | return self; 60 | } 61 | 62 | - (instancetype) initWithOperationName:(NSString *)operationName 63 | urlString:(NSString *)urlString 64 | operationType:(OperationType)operationType 65 | description:(NSString *)description 66 | documentationLink:(NSString *)documentationLink 67 | multiPartObjects:(NSArray *)multiPartObjects { 68 | self = [super init]; 69 | if(self){ 70 | _operationName = operationName; 71 | _operationURLString = urlString; 72 | _operationType = operationType; 73 | _documentationLinkString = documentationLink; 74 | _descriptionString = description; 75 | _multiPartObjectArray = multiPartObjects; 76 | _customResponseType = nil; 77 | } 78 | return self; 79 | 80 | 81 | } 82 | - (id)copy { 83 | Operation *obj = [[Operation alloc] initWithOperationName:self.operationName 84 | urlString:self.operationURLString 85 | operationType:self.operationType 86 | customHeader:self.customHeader 87 | customBody:self.customBody 88 | description:self.descriptionString 89 | documentationLink:self.documentationLinkString 90 | params:self.params 91 | paramsSource:self.paramsSource]; 92 | obj.customResponseType = self.customResponseType; 93 | obj.multiPartObjectArray = self.multiPartObjectArray; 94 | obj.isAdminRequired = self.isAdminRequired; 95 | 96 | return obj; 97 | } 98 | 99 | @end 100 | 101 | 102 | // ********************************************************* 103 | // 104 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 105 | // 106 | // Copyright (c) Microsoft Corporation 107 | // All rights reserved. 108 | // 109 | // MIT License: 110 | // Permission is hereby granted, free of charge, to any person obtaining 111 | // a copy of this software and associated documentation files (the 112 | // "Software"), to deal in the Software without restriction, including 113 | // without limitation the rights to use, copy, modify, merge, publish, 114 | // distribute, sublicense, and/or sell copies of the Software, and to 115 | // permit persons to whom the Software is furnished to do so, subject to 116 | // the following conditions: 117 | // 118 | // The above copyright notice and this permission notice shall be 119 | // included in all copies or substantial portions of the Software. 120 | // 121 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 122 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 123 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 124 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 125 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 126 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 127 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 128 | // 129 | // ********************************************************* 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [ARCHIVED] Office 365 iOS Microsoft Graph Snippets 2 | 3 | This project is being archived. As part of the archival process, we're closing all open issues and pull requests. For a current Objective-C sample, see [ios-objectivec-connect-sample](https://github.com/microsoftgraph/ios-objectivec-connect-sample). 4 | 5 | You can continue to use this sample "as-is", but it won't be maintained moving forward. We apologize for any inconvenience. 6 | 7 | ## Introduction 8 | 9 | Microsoft Graph (previously called Office 365 unified API) exposes multiple APIs from Microsoft cloud services through a single REST API endpoint. This repository shows you how to access multiple resources, including Microsoft Azure Active Directory (AD) and the Office 365 APIs, by making HTTP requests to the Microsoft Graph API in an iOS application. 10 | 11 | 12 | ## Prerequisites 13 | * [Xcode](https://developer.apple.com/xcode/downloads/) from Apple 14 | * Installation of [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) as a dependency manager. 15 | * An Office 365 account. You can sign up for [an Office 365 Developer subscription](https://aka.ms/devprogramsignup) that includes the resources that you need to start building Office 365 apps. 16 | 17 | > 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. 18 | * A Microsoft Azure tenant to register your application. Azure AD provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: [Microsoft Azure](https://account.windowsazure.com/SignUp). 19 | 20 | > Important: You will also need to ensure your Azure subscription is bound to your Office 365 tenant. To do this see the Active Directory team's blog post, [Creating and Managing Multiple Windows Azure Active Directories](http://blogs.technet.com/b/ad/archive/2013/11/08/creating-and-managing-multiple-windows-azure-active-directories.aspx). The section **Adding a new directory** will explain how to do this. You can also see [Set up your Office 365 development environment](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_CreateAzureSubscription) and the section **Associate your Office 365 account with Azure AD to create and manage apps** for more information. 21 | 22 | * * A client id (application id) and redirect uri values of an application registered in Azure. This sample application must be granted several permissions for **Microsoft Graph**. To create the registration, see [Grant permissions to the Snippets application in Azure](https://github.com/microsoftgraph/ios-objectivec-snippets-rest-sample/wiki/Grant-permissions-to-the-Snippets-application-in-Azure). 23 | 24 | 25 | ## Running this sample in Xcode 26 | 27 | 1. Clone this repository 28 | 2. Use CocoaPods to import the necessary dependencies: 29 | 30 | pod 'AFNetworking', '2.6.0' 31 | pod 'ADALiOS', '1.2.4' 32 | 33 | This sample app already contains a podfile that will get the necessary components(pods) into the project. Simply navigate to the project from **Terminal** and run 34 | 35 | pod install 36 | 37 | For more information, see **Using CocoaPods** in [Additional Resources](#AdditionalResources) 38 | 39 | 3. Open **O365-iOS-Microsoft-Graph-Snippets.xcworkspace** 40 | 4. Open **ConnectViewController.m** under the **Controllers** folder in the project. Ensure you have registered your app in Microsoft Azure, configured the proper permissions as specified, and obtained the **ClientID** (application id) and **RedirectUri** values from the registration. Again, this procedure is detailed under the fifth bullet point in the prerequisites section: **A client id and redirect uri values of an application registered in Azure.** You'll see that the **ClientID** and **RedirectUri** values can be added to the top of the file. Supply the necessary values here: 41 | 42 | // You will set your application's clientId and redirect URI. You get 43 | // these when you register your application in Microsoft Azure. 44 | NSString * const kRedirectUri = @"ENTER_REDIRECT_URI_HERE"; 45 | NSString * const kClientId = @"ENTER_CLIENT_ID_HERE"; 46 | NSString * const kResourceId = @"https://graph.microsoft.com"; 47 | NSString * const kAuthority = @"https://login.microsoftonline.com/common"; 48 | 49 | 50 | 5.Run the sample 51 | 52 | To learn more about the sample, visit our [understanding the code](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Snippets/wiki/Understanding-the-Snippets-sample-code) wiki page. 53 | 54 | 55 | ## Questions and comments 56 | 57 | We'd love to get your feedback about the Office 365 iOS Snippets project. You can send your questions and suggestions to us in the [Issues](https://github.com/OfficeDev/O365-iOS-Microsoft-Graph-Snippets/issues) section of this repository. 58 | 59 | 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]. 60 | 61 | ## Contributing 62 | 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. 63 | 64 | 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. 65 | 66 | ## Additional resources 67 | 68 | * [Office Dev Center](http://dev.office.com/) 69 | * [Microsoft Graph overview page](https://graph.microsoft.io) 70 | * [Using CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) 71 | 72 | ## Copyright 73 | Copyright (c) 2015 Microsoft. All rights reserved. 74 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ConnectViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "ConnectViewController.h" 6 | #import "AuthenticationManager.h" 7 | #import 8 | #import 9 | #import "DetailTableViewController.h" 10 | 11 | 12 | // You will set your application's clientId and redirect URI. 13 | NSString * const kRedirectUri = @"ENTER_REDIRECT_URI_HERE"; 14 | NSString * const kClientId = @"ENTER_CLIENT_ID_HERE"; 15 | NSString * const kResourceId = @"https://graph.microsoft.com"; 16 | NSString * const kAuthority = @"https://login.microsoftonline.com/common"; 17 | 18 | @interface ConnectViewController () 19 | 20 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; 21 | @property (weak, nonatomic) IBOutlet UIButton *connectButton; 22 | 23 | @end 24 | 25 | @implementation ConnectViewController 26 | 27 | - (void) viewDidLoad { 28 | [super viewDidLoad]; 29 | } 30 | 31 | 32 | - (void) viewDidAppear:(BOOL)animated { 33 | [super viewDidAppear:animated]; 34 | 35 | } 36 | 37 | - (void) didReceiveMemoryWarning { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | - (IBAction) connectToOffice365:(id)sender { 43 | [self showLoadingUI:YES]; 44 | AuthenticationManager *authManager = [AuthenticationManager sharedInstance]; 45 | 46 | [authManager initWithAuthority:kAuthority 47 | clientId:kClientId 48 | redirectURI:kRedirectUri 49 | resourceID:kResourceId 50 | completion:^(ADAuthenticationError *error) { 51 | if(error){ 52 | [self showLoadingUI:NO]; 53 | [self handleADAuthenticationError:error]; 54 | } 55 | else{ 56 | [authManager acquireAuthTokenCompletion:^(ADAuthenticationError *acquireTokenError) { 57 | if(acquireTokenError){ 58 | [self showLoadingUI:NO]; 59 | [self handleADAuthenticationError:acquireTokenError]; 60 | } 61 | else{ 62 | [[NSOperationQueue mainQueue] addOperationWithBlock:^{ 63 | [self performSegueWithIdentifier:@"showSplitView" sender:nil]; 64 | [self showLoadingUI:NO]; 65 | }]; 66 | } 67 | }]; 68 | } 69 | }]; 70 | } 71 | 72 | #pragma mark - helper 73 | - (void) showLoadingUI:(BOOL)loading { 74 | if(loading){ 75 | [self.activityIndicator startAnimating]; 76 | [self.connectButton setTitle:@"Connecting..." forState:UIControlStateNormal]; 77 | self.connectButton.enabled = NO; 78 | } 79 | else{ 80 | [self.activityIndicator stopAnimating]; 81 | [self.connectButton setTitle:@"Connect to Office 365" forState:UIControlStateNormal]; 82 | self.connectButton.enabled = YES; 83 | } 84 | } 85 | 86 | - (void) handleADAuthenticationError:(ADAuthenticationError *)error { 87 | NSLog(@"Error\nProtocol Code %@\nDescription %@", error.protocolCode, error.description); 88 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Error" 89 | message:@"Please see the log for more details" 90 | preferredStyle:UIAlertControllerStyleAlert]; 91 | [alert addAction:[UIAlertAction actionWithTitle:@"Close" 92 | style:UIAlertActionStyleDefault handler:nil]]; 93 | [self presentViewController:alert animated:YES completion:nil]; 94 | } 95 | 96 | #pragma mark - Navigation 97 | 98 | // In a storyboard-based application, you will often want to do a little preparation before navigation 99 | - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 100 | // Get the new view controller using [segue destinationViewController]. 101 | // Pass the selected object to the new view controller. 102 | UISplitViewController *splitViewController = segue.destinationViewController; 103 | splitViewController.delegate = self; 104 | } 105 | 106 | 107 | - (BOOL) splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController { 108 | if ([secondaryViewController isKindOfClass:[UINavigationController class]] && [[(UINavigationController *)secondaryViewController topViewController] isKindOfClass:[DetailTableViewController class]] && ([(DetailTableViewController *)[(UINavigationController *)secondaryViewController topViewController] operation] == nil)) { 109 | // Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. 110 | return YES; 111 | } else { 112 | return NO; 113 | } 114 | } 115 | 116 | @end 117 | 118 | 119 | // ********************************************************* 120 | // 121 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 122 | // 123 | // Copyright (c) Microsoft Corporation 124 | // All rights reserved. 125 | // 126 | // MIT License: 127 | // Permission is hereby granted, free of charge, to any person obtaining 128 | // a copy of this software and associated documentation files (the 129 | // "Software"), to deal in the Software without restriction, including 130 | // without limitation the rights to use, copy, modify, merge, publish, 131 | // distribute, sublicense, and/or sell copies of the Software, and to 132 | // permit persons to whom the Software is furnished to do so, subject to 133 | // the following conditions: 134 | // 135 | // The above copyright notice and this permission notice shall be 136 | // included in all copies or substantial portions of the Software. 137 | // 138 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 139 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 140 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 141 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 142 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 143 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 144 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 145 | // 146 | // ********************************************************* 147 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/AuthenticationManager.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "AuthenticationManager.h" 6 | #import 7 | #import 8 | 9 | //The buffer in number of seconds added to the current time when checking if the access token expired 10 | NSInteger const TokenExpirationBuffer = 300; 11 | 12 | @interface AuthenticationManager() 13 | 14 | @property (nonatomic, strong) NSString *authority; 15 | @property (nonatomic, strong) NSString *clientID; 16 | @property (nonatomic, strong) NSString *redirectUri; 17 | @property (nonatomic, strong) NSString *resourceID; 18 | 19 | @property (nonatomic, strong) ADAuthenticationContext *context; 20 | 21 | @end 22 | 23 | @implementation AuthenticationManager 24 | 25 | // Use a single authentication manager for the application. 26 | + (AuthenticationManager *)sharedInstance { 27 | static AuthenticationManager *sharedInstance; 28 | static dispatch_once_t onceToken; 29 | 30 | // Initialize the AuthenticationManager only once. 31 | dispatch_once(&onceToken, ^{ 32 | sharedInstance = [[AuthenticationManager alloc] init]; 33 | }); 34 | 35 | return sharedInstance; 36 | } 37 | 38 | #pragma mark - init 39 | - (void)initWithAuthority:(NSString *)authority 40 | clientId:(NSString *)clientId 41 | redirectURI:(NSString *)redirectURI 42 | resourceID:(NSString *)resourceID 43 | completion:(void (^)(ADAuthenticationError *error))completion { 44 | ADAuthenticationError *error; 45 | _context = [ADAuthenticationContext authenticationContextWithAuthority:authority error:&error]; 46 | 47 | if(error){ 48 | // Log error 49 | completion(error); 50 | } 51 | else{ 52 | self.clientID = clientId; 53 | self.redirectUri = redirectURI; 54 | self.authority = authority; 55 | self.resourceID = resourceID; 56 | 57 | completion(nil); 58 | } 59 | } 60 | 61 | #pragma mark - acquire token 62 | - (void)acquireAuthTokenCompletion:(void (^)(ADAuthenticationError *error))completion { 63 | [self acquireAuthTokenWithResource:self.resourceID 64 | clientID:self.clientID 65 | redirectURI: [NSURL URLWithString:self.redirectUri] 66 | completion:^(ADAuthenticationError *error) { 67 | completion(error);}]; 68 | } 69 | 70 | - (void)acquireAuthTokenWithResource:(NSString *)resourceID 71 | clientID:(NSString *)clientID 72 | redirectURI:(NSURL*)redirectURI 73 | completion:(void (^)(ADAuthenticationError *error))completion { 74 | [self.context acquireTokenWithResource:resourceID 75 | clientId:clientID 76 | redirectUri:redirectURI 77 | completionBlock:^(ADAuthenticationResult *result) { 78 | if (result.status !=AD_SUCCEEDED){ 79 | completion(result.error); 80 | } 81 | 82 | else{ 83 | self.accessToken = result.accessToken; 84 | self.refreshToken = result.tokenCacheStoreItem.refreshToken; 85 | self.familyName = result.tokenCacheStoreItem.userInformation.familyName; 86 | self.givenName = result.tokenCacheStoreItem.userInformation.givenName; 87 | self.userID = result.tokenCacheStoreItem.userInformation.userId; 88 | completion(nil); 89 | } 90 | }]; 91 | } 92 | 93 | #pragma mark - Refresh token 94 | - (void) checkAndRefreshTokenWithCompletion:(void (^)(ADAuthenticationError *error))completion{ 95 | if(self.refreshToken) { 96 | NSDate *nowWithBuffer = [NSDate dateWithTimeIntervalSinceNow:TokenExpirationBuffer]; 97 | NSComparisonResult result = [self.expiresDate compare:nowWithBuffer]; 98 | if (result == NSOrderedSame || result == NSOrderedAscending) { 99 | [self.context acquireTokenByRefreshToken:self.refreshToken 100 | clientId:self.clientID 101 | completionBlock:^(ADAuthenticationResult *result) { 102 | if(AD_SUCCEEDED == result.status){ 103 | completion(nil); 104 | } 105 | else{ 106 | completion(result.error); 107 | } 108 | }]; 109 | return; 110 | } 111 | } 112 | completion(nil); 113 | } 114 | 115 | #pragma mark - clear credentials 116 | //Clears the ADAL token cache and the cookie cache. 117 | - (void)clearCredentials{ 118 | 119 | // Remove all the cookies from this application's sandbox. The authorization code is stored in the 120 | // cookies and ADAL will try to get to access tokens based on auth code in the cookie. 121 | NSHTTPCookieStorage *cookieStore = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 122 | for (NSHTTPCookie *cookie in cookieStore.cookies) { 123 | [cookieStore deleteCookie:cookie]; 124 | } 125 | 126 | [self.context.tokenCacheStore removeAllWithError:nil]; 127 | } 128 | 129 | 130 | @end 131 | 132 | 133 | // ********************************************************* 134 | // 135 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 136 | // 137 | // Copyright (c) Microsoft Corporation 138 | // All rights reserved. 139 | // 140 | // MIT License: 141 | // Permission is hereby granted, free of charge, to any person obtaining 142 | // a copy of this software and associated documentation files (the 143 | // "Software"), to deal in the Software without restriction, including 144 | // without limitation the rights to use, copy, modify, merge, publish, 145 | // distribute, sublicense, and/or sell copies of the Software, and to 146 | // permit persons to whom the Software is furnished to do so, subject to 147 | // the following conditions: 148 | // 149 | // The above copyright notice and this permission notice shall be 150 | // included in all copies or substantial portions of the Software. 151 | // 152 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 153 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 154 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 155 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 156 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 157 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 158 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 159 | // 160 | // ********************************************************* 161 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/ParamsListTableViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "ParamsListTableViewController.h" 6 | #import "NetworkManager.h" 7 | #import "Operation.h" 8 | #import "SnippetsManager.h" 9 | 10 | 11 | @interface ParamsListTableViewController () 12 | 13 | @property (nonatomic, strong) NSMutableArray *displayArray; 14 | @property (nonatomic, strong) NSMutableArray *guidArray; 15 | 16 | @property (nonatomic, strong) UIActivityIndicatorView *activityIndicator; 17 | 18 | @end 19 | 20 | @implementation ParamsListTableViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | _displayArray = [NSMutableArray new]; 26 | _guidArray = [NSMutableArray new]; 27 | 28 | _activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 29 | self.activityIndicator.transform = CGAffineTransformMakeScale(1.5, 1.5); 30 | self.tableView.tableHeaderView = self.activityIndicator; 31 | [self.activityIndicator startAnimating]; 32 | 33 | 34 | if(self.paramsSourceType == ParamsSourceGetEvents) 35 | [self loadEvents]; 36 | 37 | else if(self.paramsSourceType == ParamsSourceGetGroups) 38 | [self loadGroups]; 39 | 40 | else if(self.paramsSourceType == ParamsSourceGetFiles) 41 | [self loadFiles]; 42 | 43 | } 44 | 45 | - (void) loadEvents { 46 | Operation *getCalendarEvents = [[[SnippetsManager alloc] init] getUserEvents]; 47 | [NetworkManager getOperation:getCalendarEvents.operationURLString 48 | queryParams:getCalendarEvents.params 49 | customResponseType:nil 50 | success:^(id responseHeader, id responseObject) { 51 | // population 52 | [self.displayArray removeAllObjects]; 53 | [self.guidArray removeAllObjects]; 54 | 55 | NSArray *value = [responseObject objectForKey:@"value"]; 56 | 57 | for(id event in value){ 58 | if([event objectForKey:@"id"]){ 59 | [self.guidArray addObject:[event objectForKey:@"id"]]; 60 | 61 | if(![[event objectForKey:@"subject"] isEqual:[NSNull null]]) 62 | [self.displayArray addObject:[event objectForKey:@"subject"]]; 63 | else 64 | [self.displayArray addObject:@""]; 65 | } 66 | } 67 | 68 | // reload tableview 69 | [self.activityIndicator stopAnimating]; 70 | [self.tableView reloadData]; 71 | } failure:^(id responseObject) { 72 | // fail 73 | [self.activityIndicator stopAnimating]; 74 | }]; 75 | 76 | 77 | } 78 | 79 | 80 | - (void) loadGroups { 81 | Operation *getGroups = [[[SnippetsManager alloc] init] getGroupsInTenant]; 82 | [NetworkManager getOperation:getGroups.operationURLString 83 | queryParams:getGroups.params 84 | customResponseType:nil 85 | success:^(id responseHeader, id responseObject) { 86 | // population 87 | [self.displayArray removeAllObjects]; 88 | [self.guidArray removeAllObjects]; 89 | 90 | NSArray *value = [responseObject objectForKey:@"value"]; 91 | 92 | for(id event in value){ 93 | 94 | if([event objectForKey:@"id"]){ 95 | [self.guidArray addObject:[event objectForKey:@"id"]]; 96 | if(![[event objectForKey:@"displayName"] isEqual:[NSNull null]]) 97 | [self.displayArray addObject:[event objectForKey:@"displayName"]]; 98 | else 99 | [self.displayArray addObject:@""]; 100 | 101 | } 102 | 103 | } 104 | 105 | // reload tableview 106 | [self.activityIndicator stopAnimating]; 107 | [self.tableView reloadData]; 108 | } failure:^(id responseObject) { 109 | // fail 110 | [self.activityIndicator stopAnimating]; 111 | }]; 112 | 113 | 114 | } 115 | 116 | 117 | - (void) loadFiles { 118 | Operation *getAllFiles = [[[SnippetsManager alloc] init] getUserFiles]; 119 | [NetworkManager getOperation:getAllFiles.operationURLString 120 | queryParams:getAllFiles.params 121 | customResponseType:nil 122 | success:^(id responseHeader, id responseObject) { 123 | 124 | NSLog(@"Success %@",responseObject); 125 | // population 126 | [self.displayArray removeAllObjects]; 127 | [self.guidArray removeAllObjects]; 128 | 129 | NSArray *value = [responseObject objectForKey:@"value"]; 130 | 131 | for(id event in value){ 132 | 133 | if([event objectForKey:@"id"]){ 134 | [self.guidArray addObject:[event objectForKey:@"id"]]; 135 | if(![[event objectForKey:@"name"] isEqual:[NSNull null]]) 136 | [self.displayArray addObject:[event objectForKey:@"name"]]; 137 | else 138 | [self.displayArray addObject:@""]; 139 | 140 | } 141 | 142 | } 143 | 144 | // reload tableview 145 | [self.activityIndicator stopAnimating]; 146 | [self.tableView reloadData]; 147 | } failure:^(id responseObject) { 148 | // fail 149 | NSLog(@"Fail %@",responseObject); 150 | [self.activityIndicator stopAnimating]; 151 | }]; 152 | 153 | 154 | } 155 | 156 | - (void)didReceiveMemoryWarning { 157 | [super didReceiveMemoryWarning]; 158 | // Dispose of any resources that can be recreated. 159 | } 160 | 161 | #pragma mark - Table view data source 162 | 163 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 164 | 165 | // Return the number of sections. 166 | return 1; 167 | } 168 | 169 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 170 | // Return the number of rows in the section. 171 | return self.displayArray.count; 172 | } 173 | 174 | 175 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 176 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellId" forIndexPath:indexPath]; 177 | 178 | // Configure the cell... 179 | cell.textLabel.text = self.displayArray[indexPath.row]; 180 | cell.detailTextLabel.text = self.guidArray[indexPath.row]; 181 | 182 | return cell; 183 | } 184 | 185 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 186 | [self.paramsDelegate onSelectedValue:self.guidArray[indexPath.row] withParamsType:self.paramsSourceType]; 187 | [self.navigationController popViewControllerAnimated:YES]; 188 | } 189 | 190 | @end 191 | 192 | 193 | 194 | // ********************************************************* 195 | // 196 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 197 | // 198 | // Copyright (c) Microsoft Corporation 199 | // All rights reserved. 200 | // 201 | // MIT License: 202 | // Permission is hereby granted, free of charge, to any person obtaining 203 | // a copy of this software and associated documentation files (the 204 | // "Software"), to deal in the Software without restriction, including 205 | // without limitation the rights to use, copy, modify, merge, publish, 206 | // distribute, sublicense, and/or sell copies of the Software, and to 207 | // permit persons to whom the Software is furnished to do so, subject to 208 | // the following conditions: 209 | // 210 | // The above copyright notice and this permission notice shall be 211 | // included in all copies or substantial portions of the Software. 212 | // 213 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 214 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 215 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 216 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 217 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 218 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 219 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 220 | // 221 | // ********************************************************* -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/NetworkManager.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "NetworkManager.h" 6 | #import 7 | #import "AuthenticationManager.h" 8 | #import "Operation.h" 9 | #import "AFHTTPResponseSerializerHTML.h" 10 | 11 | @interface NetworkManager () 12 | 13 | @property (nonatomic, strong) NSString *protocol; 14 | @property (nonatomic, strong) NSString *host; 15 | @property (nonatomic, strong) NSArray *keysToRemove; 16 | @end 17 | 18 | @implementation NetworkManager 19 | 20 | // These keys will be removed from the request parameters 21 | + (NSArray *) keysToRemove { 22 | static NSArray *_keysToRemove; 23 | if(_keysToRemove == nil) 24 | _keysToRemove = @[ParamsEventIDKey, ParamsGroupIDKey]; 25 | return _keysToRemove; 26 | } 27 | 28 | // Helper to remove certains keys from the NSDictionary 29 | + (NSDictionary *) paramsRemove:(NSArray *)keys from:(NSDictionary *)params { 30 | NSMutableDictionary *newParams = [NSMutableDictionary dictionaryWithDictionary:params]; 31 | [newParams removeObjectsForKeys:keys]; 32 | return newParams; 33 | } 34 | 35 | + (void)getOperation:(NSString *)path 36 | queryParams:(NSDictionary *)queryParams 37 | success:(void (^)(id responseHeader, id responseObject))success 38 | failure:(void (^)(id responseObject))failure { 39 | 40 | [self getOperation:path 41 | queryParams:queryParams 42 | customResponseType:nil 43 | success:^(id responseHeader, id responseObject) { 44 | success(responseHeader, responseObject); 45 | } failure:^(id responseObject) { 46 | failure(responseObject); 47 | }]; 48 | } 49 | 50 | + (void) getOperation:(NSString *)path 51 | queryParams:(NSDictionary *)queryParams 52 | customResponseType:(NSString *)responseType 53 | success:(void (^)(id responseHeader, id responseObject))success 54 | failure:(void (^)(id responseObject))failure { 55 | 56 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 57 | if(error){ 58 | failure(error); 59 | return; 60 | } 61 | 62 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 63 | 64 | [manager.requestSerializer setValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 65 | forHTTPHeaderField:@"Authorization"]; 66 | 67 | if(responseType){ 68 | manager.responseSerializer = [[AFHTTPResponseSerializerHTML alloc] init]; 69 | manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:responseType]; 70 | } 71 | 72 | [manager GET:path 73 | parameters:[self paramsRemove:self.keysToRemove from:queryParams] 74 | success:^(AFHTTPRequestOperation *operation, id responseObject) { 75 | success(operation.response.allHeaderFields, responseObject); 76 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 77 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 78 | 79 | if(![operation.responseString isEqual:[NSNull null]]) 80 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 81 | 82 | NSError *newError = [NSError errorWithDomain:error.domain 83 | code:error.code 84 | userInfo:userInfo]; 85 | 86 | 87 | failure(newError); 88 | }]; 89 | }]; 90 | } 91 | 92 | 93 | + (void)postOperation:(NSString *)path 94 | queryParams:(NSDictionary *)queryParams 95 | success:(void (^)(id responseHeader, id responseObject))success 96 | failure:(void (^)(id responseObject))failure { 97 | 98 | NSLog(@"%@", path); 99 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 100 | if(error){ 101 | failure(error); 102 | return; 103 | } 104 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 105 | 106 | AFJSONRequestSerializer *serializer = [AFJSONRequestSerializer serializer]; 107 | [serializer setValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 108 | forHTTPHeaderField:@"Authorization"]; 109 | manager.requestSerializer = serializer; 110 | 111 | [manager POST:path 112 | parameters:[self paramsRemove:self.keysToRemove from:queryParams] 113 | success:^(AFHTTPRequestOperation *operation, id responseObject) { 114 | success(operation.response.allHeaderFields, responseObject); 115 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 116 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 117 | 118 | if(![operation.responseString isEqual:[NSNull null]]) 119 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 120 | 121 | NSError *newError = [NSError errorWithDomain:error.domain 122 | code:error.code 123 | userInfo:userInfo]; 124 | 125 | 126 | failure(newError); 127 | }]; 128 | }]; 129 | } 130 | 131 | + (void) deleteOperation:(NSString *)path 132 | queryParams:(NSDictionary *)queryParams 133 | success:(void (^)(id responseHeader, id responseObject))success 134 | failure:(void (^)(id responseObject))failure { 135 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 136 | if(error){ 137 | failure(error); 138 | return; 139 | } 140 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 141 | 142 | [manager.requestSerializer setValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 143 | forHTTPHeaderField:@"Authorization"]; 144 | 145 | [manager DELETE:path 146 | parameters:[self paramsRemove:self.keysToRemove from:queryParams] 147 | success:^(AFHTTPRequestOperation *operation, id responseObject) { 148 | success(operation.response.allHeaderFields, responseObject); 149 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 150 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 151 | 152 | if(![operation.responseString isEqual:[NSNull null]]) 153 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 154 | 155 | NSError *newError = [NSError errorWithDomain:error.domain 156 | code:error.code 157 | userInfo:userInfo]; 158 | 159 | 160 | failure(newError); 161 | }]; 162 | }]; 163 | } 164 | 165 | + (void) patchOperation:(NSString *)path 166 | queryParams:(NSDictionary *)queryParams 167 | success:(void (^)(id responseHeader, id responseObject))success 168 | failure:(void (^)(id responseObject))failure { 169 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 170 | if(error){ 171 | failure(error); 172 | return; 173 | } 174 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 175 | 176 | AFJSONRequestSerializer *serializer = [AFJSONRequestSerializer serializer]; 177 | [serializer setValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 178 | forHTTPHeaderField:@"Authorization"]; 179 | [serializer setValue:@"" forHTTPHeaderField:@"Accept-Encoding"]; 180 | 181 | manager.requestSerializer = serializer; 182 | 183 | [manager PATCH:path 184 | parameters:[NSArray arrayWithObject:[self paramsRemove:self.keysToRemove from:queryParams]] 185 | success:^(AFHTTPRequestOperation *operation, id responseObject) { 186 | success(operation.response.allHeaderFields, responseObject); 187 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 188 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 189 | 190 | if(![operation.responseString isEqual:[NSNull null]]) 191 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 192 | 193 | NSError *newError = [NSError errorWithDomain:error.domain 194 | code:error.code 195 | userInfo:userInfo]; 196 | 197 | 198 | failure(newError); 199 | }]; 200 | }]; 201 | 202 | } 203 | 204 | + (void) patchOperation:(NSString *)path 205 | customHeader:(NSDictionary *)customHeader 206 | customBody:(NSString *)bodyString 207 | success:(void (^)(id responseHeader, id responseObject))success 208 | failure:(void (^)(id responseObject))failure { 209 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 210 | if(error){ 211 | failure(error); 212 | return; 213 | } 214 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 215 | [request setURL:[NSURL URLWithString:path]]; 216 | [request setHTTPMethod:@"PATCH"]; 217 | 218 | [request addValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 219 | forHTTPHeaderField:@"Authorization"]; 220 | 221 | //set headers 222 | NSArray *customHeaderArray = [customHeader allKeys]; 223 | for(NSString *key in customHeaderArray){ 224 | [request addValue:[customHeader objectForKey:key] forHTTPHeaderField:key]; 225 | } 226 | 227 | //create the body 228 | NSMutableData *postBody = [NSMutableData data]; 229 | [postBody appendData:[bodyString dataUsingEncoding:NSUTF8StringEncoding]]; 230 | 231 | //post 232 | [request setHTTPBody:postBody]; 233 | 234 | AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] 235 | initWithRequest:request]; 236 | operation.responseSerializer = [AFJSONResponseSerializer serializer]; 237 | 238 | [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { 239 | NSLog(@"status code = %ld", (long)operation.response.statusCode); 240 | 241 | success(operation.response.allHeaderFields, responseObject); 242 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 243 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 244 | 245 | if(![operation.responseString isEqual:[NSNull null]]) 246 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 247 | 248 | NSError *newError = [NSError errorWithDomain:error.domain 249 | code:error.code 250 | userInfo:userInfo]; 251 | 252 | 253 | failure(newError); 254 | }]; 255 | [operation start]; 256 | }]; 257 | } 258 | 259 | + (void)postOperation:(NSString *)path 260 | customHeader:(NSDictionary *)customHeader 261 | customBody:(NSString *)bodyString 262 | success:(void (^)(id responseHeader, id responseObject))success 263 | failure:(void (^)(id responseObject))failure { 264 | 265 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 266 | if(error){ 267 | failure(error); 268 | return; 269 | } 270 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 271 | [request setURL:[NSURL URLWithString:path]]; 272 | [request setHTTPMethod:@"POST"]; 273 | 274 | [request addValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 275 | forHTTPHeaderField:@"Authorization"]; 276 | 277 | //set headers 278 | NSArray *customHeaderArray = [customHeader allKeys]; 279 | for(NSString *key in customHeaderArray){ 280 | [request addValue:[customHeader objectForKey:key] forHTTPHeaderField:key]; 281 | } 282 | //create the body 283 | NSMutableData *postBody = [NSMutableData data]; 284 | [postBody appendData:[bodyString dataUsingEncoding:NSUTF8StringEncoding]]; 285 | 286 | //post 287 | [request setHTTPBody:postBody]; 288 | 289 | AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] 290 | initWithRequest:request]; 291 | operation.responseSerializer = [AFJSONResponseSerializer serializer]; 292 | 293 | [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { 294 | NSLog(@"status code = %ld", (long)operation.response.statusCode); 295 | 296 | success(operation.response.allHeaderFields, responseObject); 297 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 298 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 299 | 300 | if(![operation.responseString isEqual:[NSNull null]]) 301 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 302 | 303 | NSError *newError = [NSError errorWithDomain:error.domain 304 | code:error.code 305 | userInfo:userInfo]; 306 | 307 | 308 | failure(newError); 309 | }]; 310 | [operation start]; 311 | }]; 312 | } 313 | 314 | 315 | + (void)putOperation:(NSString *)path 316 | customHeader:(NSDictionary *)customHeader 317 | customBody:(NSString *)bodyString 318 | success:(void (^)(id responseHeader, id responseObject))success 319 | failure:(void (^)(id responseObject))failure { 320 | 321 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 322 | if(error){ 323 | failure(error); 324 | return; 325 | } 326 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 327 | [request setURL:[NSURL URLWithString:path]]; 328 | [request setHTTPMethod:@"PUT"]; 329 | 330 | [request addValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 331 | forHTTPHeaderField:@"Authorization"]; 332 | 333 | //set headers 334 | NSArray *customHeaderArray = [customHeader allKeys]; 335 | for(NSString *key in customHeaderArray){ 336 | [request addValue:[customHeader objectForKey:key] forHTTPHeaderField:key]; 337 | } 338 | //create the body 339 | NSMutableData *postBody = [NSMutableData data]; 340 | [postBody appendData:[bodyString dataUsingEncoding:NSUTF8StringEncoding]]; 341 | 342 | //post 343 | [request setHTTPBody:postBody]; 344 | 345 | AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] 346 | initWithRequest:request]; 347 | operation.responseSerializer = [AFJSONResponseSerializer serializer]; 348 | 349 | [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { 350 | NSLog(@"status code = %ld", (long)operation.response.statusCode); 351 | 352 | success(operation.response.allHeaderFields, responseObject); 353 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 354 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 355 | 356 | if(![operation.responseString isEqual:[NSNull null]]) 357 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 358 | 359 | NSError *newError = [NSError errorWithDomain:error.domain 360 | code:error.code 361 | userInfo:userInfo]; 362 | 363 | 364 | failure(newError); 365 | }]; 366 | [operation start]; 367 | }]; 368 | } 369 | 370 | 371 | + (void) postWithMultipartForm:(NSString *)path 372 | queryParams:(NSDictionary *)queryParams 373 | multiformObjects:(NSArray *)multiformObjects 374 | success:(void (^)(id responseHeader, id responseObject))success 375 | failure:(void (^)(id responseObject))failure { 376 | [[AuthenticationManager sharedInstance] checkAndRefreshTokenWithCompletion:^(ADAuthenticationError *error) { 377 | if(error){ 378 | failure(error); 379 | return; 380 | } 381 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 382 | 383 | [manager.requestSerializer setValue:[NSString stringWithFormat:@"Bearer %@", [[AuthenticationManager sharedInstance] accessToken]] 384 | forHTTPHeaderField:@"Authorization"]; 385 | 386 | [manager POST:path parameters:[self paramsRemove:self.keysToRemove from:queryParams] constructingBodyWithBlock:^(id formData) { 387 | 388 | for (MultiformObject *obj in multiformObjects){ 389 | [formData appendPartWithHeaders:obj.headers body:obj.body]; 390 | } 391 | } success:^(AFHTTPRequestOperation *operation, id responseObject) { 392 | success(operation.response.allHeaderFields, responseObject); 393 | 394 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 395 | NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; 396 | 397 | if(![operation.responseString isEqual:[NSNull null]]) 398 | [userInfo setObject:operation.responseString forKey:@"responseString"]; 399 | 400 | NSError *newError = [NSError errorWithDomain:error.domain 401 | code:error.code 402 | userInfo:userInfo]; 403 | 404 | 405 | failure(newError); 406 | }]; 407 | }]; 408 | } 409 | 410 | @end 411 | 412 | 413 | // ********************************************************* 414 | // 415 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 416 | // 417 | // Copyright (c) Microsoft Corporation 418 | // All rights reserved. 419 | // 420 | // MIT License: 421 | // Permission is hereby granted, free of charge, to any person obtaining 422 | // a copy of this software and associated documentation files (the 423 | // "Software"), to deal in the Software without restriction, including 424 | // without limitation the rights to use, copy, modify, merge, publish, 425 | // distribute, sublicense, and/or sell copies of the Software, and to 426 | // permit persons to whom the Software is furnished to do so, subject to 427 | // the following conditions: 428 | // 429 | // The above copyright notice and this permission notice shall be 430 | // included in all copies or substantial portions of the Software. 431 | // 432 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 433 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 434 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 435 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 436 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 437 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 438 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 439 | // 440 | // ********************************************************* 441 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets/DetailTableViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | #import "DetailTableViewController.h" 6 | #import "ResizableTextTableViewCell.h" 7 | #import "NetworkManager.h" 8 | #import "ParamsListTableViewController.h" 9 | #import "ParamsHelperDelegate.h" 10 | #import "ParamsTextTableViewController.h" 11 | #import "ParamsPostDataViewController.h" 12 | 13 | NSString* const kResizableTextCellId = @"resizableCellId"; 14 | NSString* const kParamsCellId = @"paramsCellId"; 15 | NSString* const kUrlCellId = @"urlCellId"; 16 | 17 | @interface DetailTableViewController () 18 | 19 | @property (nonatomic, assign) BOOL hasParams; 20 | @property (nonatomic, assign) BOOL hasCustomHeader; 21 | 22 | @property (nonatomic, strong) NSString *responseHeader; 23 | @property (nonatomic, strong) NSString *responseBody; 24 | 25 | @end 26 | 27 | @implementation DetailTableViewController 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | 32 | self.tableView.rowHeight = UITableViewAutomaticDimension; 33 | self.tableView.estimatedRowHeight = 44.0; 34 | 35 | if(self.operation.params && self.operation.params > 0) 36 | _hasParams = YES; 37 | else 38 | _hasParams = NO; 39 | 40 | if(self.operation.customHeader && self.operation.customHeader.count > 0) 41 | _hasCustomHeader = YES; 42 | else 43 | _hasCustomHeader = NO; 44 | 45 | _responseHeader = @""; 46 | _responseBody = @""; 47 | 48 | self.title = self.operation.operationName; 49 | 50 | } 51 | 52 | - (void)didReceiveMemoryWarning { 53 | [super didReceiveMemoryWarning]; 54 | // Dispose of any resources that can be recreated. 55 | } 56 | 57 | #pragma mark - Table view data source 58 | 59 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 60 | if(section == 0) 61 | return @"Operation Description"; 62 | 63 | if(section == 1) 64 | return @"API URL"; 65 | 66 | if(_hasParams && _hasCustomHeader){ 67 | if(section == 2) 68 | return @"Custom Request Header"; 69 | else if(section == 3) 70 | return @"Parameters"; 71 | else if(section == 4) 72 | return @"Response Header"; 73 | else 74 | return @"Response Body"; 75 | } 76 | else if(_hasParams){ 77 | if(section == 2) 78 | return @"Parameters"; 79 | else if(section == 3) 80 | return @"Response Header"; 81 | else 82 | return @"Response Body"; 83 | 84 | } 85 | else if(_hasCustomHeader){ 86 | if(section == 2) 87 | return @"Custom Request Header"; 88 | else if(section == 3) 89 | return @"Response Header"; 90 | else 91 | return @"Response Body"; 92 | } 93 | else{ 94 | if(section == 2) 95 | return @"Response Header"; 96 | else 97 | return @"Response Body"; 98 | } 99 | } 100 | 101 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 102 | 103 | // Return the number of sections. 104 | return 4 + (_hasParams?1:0) + (_hasCustomHeader?1:0); 105 | } 106 | 107 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 108 | if((_hasParams && _hasCustomHeader && section == 3) || 109 | (_hasParams && !_hasCustomHeader && section == 2)) 110 | return self.operation.params.count; 111 | 112 | else 113 | return 1; 114 | } 115 | 116 | 117 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 118 | // Snippet Info 119 | if(indexPath.section == 0){ 120 | if(indexPath.row == 0){ 121 | 122 | ResizableTextTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kResizableTextCellId]; 123 | 124 | // resizing of the row height 125 | cell.textView.text = nil; // to negate the bug where whole text becomes a link after reload 126 | if(self.operation){ 127 | cell.textView.text = [NSString stringWithFormat:@"%@\n\nDocumentation link: %@\n%@", self.operation.descriptionString, self.operation.documentationLinkString, self.operation.isAdminRequired?@"\nThis operation requires a user with an admin account.":@""]; 128 | } 129 | else{ 130 | cell.textView.text = @""; 131 | } 132 | cell.textView.editable = NO; 133 | cell.textView.dataDetectorTypes = UIDataDetectorTypeLink; 134 | 135 | cell.heightConstraint.constant = ceilf([[cell textView] sizeThatFits:CGSizeMake(self.tableView.frame.size.width - 20, FLT_MAX)].height); 136 | 137 | [cell layoutIfNeeded]; 138 | [cell updateConstraints]; 139 | 140 | return cell; 141 | } 142 | else 143 | return nil; 144 | } 145 | // API URL 146 | else if(indexPath.section == 1){ 147 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kUrlCellId]; 148 | 149 | cell.textLabel.text = self.operation.operationURLString; 150 | 151 | return cell; 152 | } 153 | else if(indexPath.section == 2 && _hasCustomHeader){ 154 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kParamsCellId]; 155 | 156 | cell.textLabel.text = [self.operation.customHeader allKeys][indexPath.row]; 157 | cell.detailTextLabel.text = [self.operation.customHeader allValues][indexPath.row]; 158 | 159 | cell.accessoryType = UITableViewCellAccessoryNone; 160 | return cell; 161 | } 162 | 163 | // params 164 | else if((indexPath.section == 2 && _hasParams) || 165 | (indexPath.section == 3 && _hasParams && _hasCustomHeader)){ 166 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kParamsCellId]; 167 | 168 | cell.textLabel.text = nil; 169 | cell.textLabel.text = self.operation.params.allKeys[indexPath.row]; 170 | 171 | if([[self.operation.params.allValues[indexPath.row] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@""]) 172 | cell.detailTextLabel.text = @"Required"; 173 | else 174 | cell.detailTextLabel.text = self.operation.params.allValues[indexPath.row]; 175 | 176 | return cell; 177 | } 178 | 179 | // response header 180 | else if((indexPath.section == 2 && !_hasParams && !_hasCustomHeader) || 181 | (indexPath.section == 3 && _hasParams && !_hasCustomHeader) || 182 | (indexPath.section == 3 && !_hasParams && _hasCustomHeader) || 183 | (indexPath.section == 4 && _hasParams && _hasCustomHeader)){ 184 | ResizableTextTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kResizableTextCellId]; 185 | 186 | // resizing of the row height 187 | cell.textView.text = @""; 188 | cell.textView.text = self.responseHeader; 189 | cell.textView.dataDetectorTypes = UIDataDetectorTypeLink; 190 | cell.textView.scrollEnabled = YES; 191 | 192 | // restrict height to be less than 500 for performance as some response bodies are long 193 | cell.heightConstraint.constant = MIN(500, [[cell textView] sizeThatFits:CGSizeMake(self.tableView.frame.size.width - 20, FLT_MAX)].height); 194 | 195 | [cell layoutIfNeeded]; 196 | [cell updateConstraints]; 197 | 198 | return cell; 199 | 200 | } 201 | else{ // response body 202 | ResizableTextTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kResizableTextCellId]; 203 | 204 | // resizing of the row height 205 | cell.textView.text = @""; 206 | cell.textView.text = self.responseBody; 207 | cell.textView.dataDetectorTypes = UIDataDetectorTypeLink; 208 | cell.textView.scrollEnabled = YES; 209 | 210 | // restrict height to be less than 500 for performance as some response bodies are long 211 | cell.heightConstraint.constant = MIN(500, ceilf([[cell textView] sizeThatFits:CGSizeMake(self.tableView.frame.size.width - 20, FLT_MAX)].height)); 212 | 213 | [cell layoutIfNeeded]; 214 | [cell updateConstraints]; 215 | 216 | return cell; 217 | } 218 | 219 | } 220 | 221 | 222 | 223 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 224 | 225 | if(indexPath.section == 1){ 226 | [self performSegueWithIdentifier:@"showTextEdit" sender:nil]; 227 | } 228 | 229 | 230 | else if((indexPath.section == 2 && _hasParams && !_hasCustomHeader) || 231 | (indexPath.section == 3 && _hasParams && _hasCustomHeader)){ 232 | 233 | int row = (int)indexPath.row; 234 | NSString *key = self.operation.params.allKeys[row]; 235 | ParamsSourceType type = [[self.operation.paramsSource objectForKey:key] intValue]; 236 | 237 | if(type == ParamsSourceTextEdit) 238 | [self performSegueWithIdentifier:@"showTextEdit" sender:nil]; 239 | 240 | else if(type == ParamsSourceGetEvents) 241 | [self performSegueWithIdentifier:@"showListEvents" sender:nil]; 242 | 243 | else if(type == ParamsSourceGetGroups) 244 | [self performSegueWithIdentifier:@"showListGroups" sender:nil]; 245 | 246 | else if(type == ParamsSourcePostData) 247 | [self performSegueWithIdentifier:@"showPostParams" sender:nil]; 248 | else if(type == ParamsSourceGetFiles) 249 | [self performSegueWithIdentifier:@"showListFiles" sender:nil]; 250 | } 251 | 252 | else{ 253 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 254 | } 255 | } 256 | 257 | #pragma mark - Navigation 258 | 259 | // In a storyboard-based application, you will often want to do a little preparation before navigation 260 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 261 | // Get the new view controller using [segue destinationViewController]. 262 | // Pass the selected object to the new view controller. 263 | if([segue.identifier isEqualToString:@"showTextEdit"]){ 264 | ParamsTextTableViewController *vc = segue.destinationViewController; 265 | vc.operation = self.operation; 266 | 267 | if(self.tableView.indexPathForSelectedRow.section == 1) 268 | vc.selectedKey = @"API URL"; 269 | else 270 | vc.selectedKey = self.operation.params.allKeys[self.tableView.indexPathForSelectedRow.row]; 271 | vc.isEditable = YES; 272 | vc.delegate = self; 273 | } 274 | 275 | else if([segue.identifier isEqualToString:@"showListEvents"]){ 276 | ParamsListTableViewController *vc = segue.destinationViewController; 277 | vc.paramsSourceType = ParamsSourceGetEvents; 278 | vc.title = @"EventID"; 279 | vc.paramsDelegate = self; 280 | } 281 | 282 | else if([segue.identifier isEqualToString:@"showListGroups"]){ 283 | ParamsListTableViewController *vc = segue.destinationViewController; 284 | vc.paramsSourceType = ParamsSourceGetGroups; 285 | vc.title = @"GroupID"; 286 | vc.paramsDelegate = self; 287 | } 288 | 289 | else if([segue.identifier isEqualToString:@"showListFiles"]){ 290 | ParamsListTableViewController *vc = segue.destinationViewController; 291 | vc.paramsSourceType = ParamsSourceGetFiles; 292 | vc.title = @"FileID"; 293 | vc.paramsDelegate = self; 294 | 295 | } 296 | 297 | else if([segue.identifier isEqualToString:@"showPostParams"]){ 298 | ParamsPostDataViewController *vc = segue.destinationViewController; 299 | vc.payload = [self.operation.params valueForKey:ParamsPostDataKey]; 300 | vc.paramsDelegate = self; 301 | 302 | } 303 | 304 | 305 | } 306 | 307 | 308 | 309 | #pragma mark - Run 310 | 311 | - (BOOL) paramsTest { 312 | // check operation loaded 313 | if(!self.operation){ 314 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Error" 315 | message:@"Select an operation" 316 | preferredStyle:UIAlertControllerStyleAlert]; 317 | [alertController addAction:[UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 318 | ; 319 | }]]; 320 | 321 | [self presentViewController:alertController animated:YES completion:^{ 322 | ; 323 | }]; 324 | 325 | return NO; 326 | } 327 | 328 | // test all params filled 329 | NSArray *keys = self.operation.params.allKeys; 330 | NSMutableArray *nonFilledParamsList = [NSMutableArray new]; 331 | 332 | for (NSString *key in keys){ 333 | if( [[[self.operation.params objectForKey:key] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@""]){ 334 | [nonFilledParamsList addObject:key]; 335 | } 336 | } 337 | 338 | if(nonFilledParamsList.count == 0) 339 | return YES; 340 | else{ 341 | NSMutableString *errorString = [NSMutableString stringWithString:@"The following parameters are not filled in:\n"]; 342 | for(NSString *key in nonFilledParamsList){ 343 | [errorString appendString:@"\n"]; 344 | [errorString appendString:key]; 345 | } 346 | 347 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Error" 348 | message:errorString 349 | preferredStyle:UIAlertControllerStyleAlert]; 350 | [alertController addAction:[UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 351 | ; 352 | }]]; 353 | 354 | [self presentViewController:alertController animated:YES completion:^{ 355 | ; 356 | }]; 357 | 358 | return NO; 359 | } 360 | } 361 | 362 | - (IBAction)runTapped:(id)sender { 363 | // Check if operation is valid and all parameters are filled 364 | if(![self paramsTest]){ 365 | return; 366 | } 367 | 368 | // Set activity indicator 369 | UIActivityIndicatorView *ac = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 370 | ac.transform = CGAffineTransformMakeScale(1.5, 1.5); 371 | [ac startAnimating]; 372 | self.tableView.tableHeaderView = ac; 373 | 374 | // GET 375 | if(self.operation.operationType == OperationGet){ 376 | 377 | [NetworkManager getOperation:self.operation.operationURLString 378 | queryParams:self.operation.params 379 | success:^(id responseHeader, id responseObject) { 380 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 381 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject];; 382 | self.tableView.tableHeaderView = nil; 383 | 384 | [self.tableView reloadData]; 385 | } failure:^(id responseObject) { 386 | NSError *error = (NSError*)responseObject; 387 | 388 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 389 | 390 | self.tableView.tableHeaderView = nil; 391 | [self.tableView reloadData]; 392 | }]; 393 | } 394 | 395 | //Custom POST 396 | else if(self.operation.operationType == OperationPostCustom) { 397 | 398 | [NetworkManager postOperation:self.operation.operationURLString 399 | customHeader:self.operation.customHeader 400 | customBody:self.operation.customBody 401 | success:^(id responseHeader, id responseObject) { 402 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 403 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject]; 404 | 405 | self.tableView.tableHeaderView = nil; 406 | [self.tableView reloadData]; 407 | 408 | } failure:^(id responseObject) { 409 | NSError *error = (NSError*)responseObject; 410 | 411 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 412 | 413 | self.tableView.tableHeaderView = nil; 414 | [self.tableView reloadData]; 415 | }]; 416 | } 417 | 418 | // POST 419 | else if(self.operation.operationType == OperationPost){ 420 | [NetworkManager postOperation:self.operation.operationURLString 421 | queryParams:self.operation.params 422 | success:^(id responseHeader, id responseObject) { 423 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 424 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject];; 425 | self.tableView.tableHeaderView = nil; 426 | [self.tableView reloadData]; 427 | 428 | } failure:^(id responseObject) { 429 | NSError *error = (NSError*)responseObject; 430 | 431 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 432 | 433 | self.tableView.tableHeaderView = nil; 434 | [self.tableView reloadData]; 435 | }]; 436 | } 437 | 438 | // PUT 439 | else if(self.operation.operationType == OperationPut){ 440 | [NetworkManager putOperation:self.operation.operationURLString 441 | customHeader:self.operation.customHeader 442 | customBody:self.operation.customBody 443 | success:^(id responseHeader, id responseObject) { 444 | 445 | NSLog(@"1"); 446 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 447 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject];; 448 | self.tableView.tableHeaderView = nil; 449 | [self.tableView reloadData]; 450 | 451 | } failure:^(id responseObject) { 452 | 453 | NSLog(@"2"); 454 | NSError *error = (NSError*)responseObject; 455 | 456 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 457 | 458 | self.tableView.tableHeaderView = nil; 459 | [self.tableView reloadData]; 460 | }]; 461 | } 462 | 463 | // DELETE 464 | else if(self.operation.operationType == OperationDelete){ 465 | [NetworkManager deleteOperation:self.operation.operationURLString 466 | queryParams:self.operation.params 467 | success:^(id responseHeader, id responseObject) { 468 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 469 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject]; 470 | self.tableView.tableHeaderView = nil; 471 | [self.tableView reloadData]; 472 | 473 | } failure:^(id responseObject) { 474 | NSError *error = (NSError*)responseObject; 475 | 476 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 477 | 478 | self.tableView.tableHeaderView = nil; 479 | [self.tableView reloadData]; 480 | }]; 481 | } 482 | 483 | // POST multipart form 484 | else if(self.operation.operationType == OperationPostMultiPart){ 485 | [NetworkManager postWithMultipartForm:self.operation.operationURLString 486 | queryParams:self.operation.params 487 | multiformObjects:self.operation.multiPartObjectArray 488 | success:^(id responseHeader, id responseObject) { 489 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 490 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject]; 491 | self.tableView.tableHeaderView = nil; 492 | [self.tableView reloadData]; 493 | } failure:^(id responseObject) { 494 | NSError *error = (NSError*)responseObject; 495 | 496 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 497 | 498 | self.tableView.tableHeaderView = nil; 499 | [self.tableView reloadData]; 500 | }]; 501 | } 502 | 503 | // PATCH 504 | else if(self.operation.operationType == OperationPatch){ 505 | [NetworkManager patchOperation:self.operation.operationURLString 506 | queryParams:self.operation.params 507 | success:^(id responseHeader, id responseObject) { 508 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 509 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject]; 510 | self.tableView.tableHeaderView = nil; 511 | [self.tableView reloadData]; 512 | } failure:^(id responseObject) { 513 | NSError *error = (NSError*)responseObject; 514 | 515 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 516 | 517 | self.tableView.tableHeaderView = nil; 518 | [self.tableView reloadData]; 519 | }]; 520 | } 521 | 522 | else if(self.operation.operationType == OperationPatchCustom){ 523 | [NetworkManager patchOperation:self.operation.operationURLString 524 | customHeader:self.operation.customHeader 525 | customBody:self.operation.customBody 526 | success:^(id responseHeader, id responseObject) { 527 | self.responseHeader = [NSString stringWithFormat:@"%@", responseHeader]; 528 | self.responseBody = [NSString stringWithFormat:@"%@", responseObject]; 529 | 530 | self.tableView.tableHeaderView = nil; 531 | [self.tableView reloadData]; 532 | 533 | } failure:^(id responseObject) { 534 | NSError *error = (NSError*)responseObject; 535 | 536 | self.responseBody = [NSString stringWithFormat:@"%@\n\n%@", error.localizedDescription, [error.userInfo objectForKey:@"responseString"]]; 537 | 538 | self.tableView.tableHeaderView = nil; 539 | [self.tableView reloadData]; 540 | }]; 541 | 542 | 543 | } 544 | } 545 | 546 | #pragma mark - Params Delegate 547 | 548 | - (void)onSelectedValue:(NSString *)value withParamsType:(ParamsSourceType)sourceType { 549 | 550 | if(sourceType == ParamsSourceGetEvents){ 551 | // change the url 552 | NSString *paramsId = ParamsEventIDKey; 553 | 554 | NSMutableString *newURLString = [[NSMutableString alloc] initWithString:self.operation.operationURLString]; 555 | [newURLString replaceOccurrencesOfString:[NSString stringWithFormat:@"{%@}", paramsId] 556 | withString:value options:NSLiteralSearch range:NSMakeRange(0, self.operation.operationURLString.length)]; 557 | 558 | self.operation.operationURLString = newURLString; 559 | 560 | NSMutableDictionary *newParams = [NSMutableDictionary dictionaryWithDictionary:self.operation.params]; 561 | [newParams setObject:value forKey:paramsId]; 562 | 563 | self.operation.params = newParams; 564 | } 565 | 566 | if(sourceType == ParamsSourceGetGroups){ 567 | // change the url 568 | NSString *paramsId = ParamsGroupIDKey; 569 | 570 | NSMutableString *newURLString = [[NSMutableString alloc] initWithString:self.operation.operationURLString]; 571 | [newURLString replaceOccurrencesOfString:[NSString stringWithFormat:@"{%@}", paramsId] 572 | withString:value options:NSLiteralSearch range:NSMakeRange(0, self.operation.operationURLString.length)]; 573 | 574 | self.operation.operationURLString = newURLString; 575 | 576 | NSMutableDictionary *newParams = [NSMutableDictionary dictionaryWithDictionary:self.operation.params]; 577 | [newParams setObject:value forKey:paramsId]; 578 | 579 | self.operation.params = newParams; 580 | } 581 | 582 | if(sourceType == ParamsSourceGetFiles){ 583 | // change the url 584 | NSString *paramsId = ParamsFileIDKey; 585 | 586 | NSMutableString *newURLString = [[NSMutableString alloc] initWithString:self.operation.operationURLString]; 587 | [newURLString replaceOccurrencesOfString:[NSString stringWithFormat:@"{%@}", paramsId] 588 | withString:value options:NSLiteralSearch range:NSMakeRange(0, self.operation.operationURLString.length)]; 589 | 590 | self.operation.operationURLString = newURLString; 591 | 592 | NSMutableDictionary *newParams = [NSMutableDictionary dictionaryWithDictionary:self.operation.params]; 593 | [newParams setObject:value forKey:paramsId]; 594 | 595 | self.operation.params = newParams; 596 | } 597 | 598 | if (sourceType == ParamsSourcePostData) { 599 | NSMutableDictionary *newParams = [NSMutableDictionary dictionaryWithDictionary:self.operation.params]; 600 | [newParams setObject:value forKey:ParamsPostDataKey]; 601 | 602 | // for display 603 | self.operation.params = newParams; 604 | 605 | // actual value to be passed on when runtapped is pressed 606 | self.operation.customBody = value; 607 | 608 | } 609 | 610 | [self.tableView reloadData]; 611 | } 612 | 613 | @end 614 | 615 | 616 | // ********************************************************* 617 | // 618 | // O365-iOS-Unified-API-Snippets, https://github.com/OfficeDev/O365-iOS-Unified-API-Snippets 619 | // 620 | // Copyright (c) Microsoft Corporation 621 | // All rights reserved. 622 | // 623 | // MIT License: 624 | // Permission is hereby granted, free of charge, to any person obtaining 625 | // a copy of this software and associated documentation files (the 626 | // "Software"), to deal in the Software without restriction, including 627 | // without limitation the rights to use, copy, modify, merge, publish, 628 | // distribute, sublicense, and/or sell copies of the Software, and to 629 | // permit persons to whom the Software is furnished to do so, subject to 630 | // the following conditions: 631 | // 632 | // The above copyright notice and this permission notice shall be 633 | // included in all copies or substantial portions of the Software. 634 | // 635 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 636 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 637 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 638 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 639 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 640 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 641 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 642 | // 643 | // ********************************************************* 644 | -------------------------------------------------------------------------------- /O365-iOS-Microsoft-Graph-Snippets.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 096E28EF2C20215DADCC3578 /* libPods-O365-iOS-Microsoft-Graph-Snippets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3970DF6DF34BC98F021447 /* libPods-O365-iOS-Microsoft-Graph-Snippets.a */; }; 11 | 960C1FCC1B3B639700918D53 /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = 960C1FCB1B3B639700918D53 /* Podfile */; }; 12 | 963E9EED1B38C50400D57EAA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9EEC1B38C50400D57EAA /* main.m */; }; 13 | 963E9EF01B38C50400D57EAA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9EEF1B38C50400D57EAA /* AppDelegate.m */; }; 14 | 963E9EF31B38C50400D57EAA /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9EF21B38C50400D57EAA /* MasterViewController.m */; }; 15 | 963E9EF91B38C50400D57EAA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 963E9EF71B38C50400D57EAA /* Main.storyboard */; }; 16 | 963E9EFB1B38C50400D57EAA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 963E9EFA1B38C50400D57EAA /* Images.xcassets */; }; 17 | 963E9EFE1B38C50400D57EAA /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 963E9EFC1B38C50400D57EAA /* LaunchScreen.xib */; }; 18 | 963E9F161B38C6E100D57EAA /* ConnectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9F151B38C6E100D57EAA /* ConnectViewController.m */; }; 19 | 963E9F1C1B38CE5F00D57EAA /* AuthenticationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9F1B1B38CE5F00D57EAA /* AuthenticationManager.m */; }; 20 | 963E9F261B38CED900D57EAA /* SnippetsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9F251B38CED900D57EAA /* SnippetsManager.m */; }; 21 | 963E9F2A1B38CF1D00D57EAA /* NetworkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 963E9F291B38CF1D00D57EAA /* NetworkManager.m */; }; 22 | 9642FCC11BA2CE9D00BCC6F0 /* newUserData.json in Resources */ = {isa = PBXBuildFile; fileRef = 9642FCC01BA2CE9D00BCC6F0 /* newUserData.json */; }; 23 | 9642FCC31BA2D0D800BCC6F0 /* newGroupData.json in Resources */ = {isa = PBXBuildFile; fileRef = 9642FCC21BA2D0D800BCC6F0 /* newGroupData.json */; }; 24 | 9642FCC71BA2D6BF00BCC6F0 /* patchGroupData.json in Resources */ = {isa = PBXBuildFile; fileRef = 9642FCC61BA2D6BF00BCC6F0 /* patchGroupData.json */; }; 25 | 965A310E1BA0EEE400644CFA /* eventDataPatch.json in Resources */ = {isa = PBXBuildFile; fileRef = 965A310D1BA0EEE400644CFA /* eventDataPatch.json */; }; 26 | 965A31101BA0F2ED00644CFA /* emailData.json in Resources */ = {isa = PBXBuildFile; fileRef = 965A310F1BA0F2ED00644CFA /* emailData.json */; }; 27 | 9663321C1B3CA12C007A9E5E /* Operation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9663321B1B3CA12C007A9E5E /* Operation.m */; }; 28 | 969D393B1B5709C700604B95 /* o365.png in Resources */ = {isa = PBXBuildFile; fileRef = 969D39281B5709C700604B95 /* o365.png */; }; 29 | 96A4C7E31B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 96A4C7E21B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.m */; }; 30 | 96A4C7E81B560D17007AC7F2 /* MultiformObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 96A4C7E71B560D17007AC7F2 /* MultiformObject.m */; }; 31 | 96AA992B1B507F9900ABFEA1 /* ParamsListTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96AA992A1B507F9900ABFEA1 /* ParamsListTableViewController.m */; }; 32 | 96AA992E1B50842600ABFEA1 /* ParamsTextTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96AA992D1B50842600ABFEA1 /* ParamsTextTableViewController.m */; }; 33 | 96AD908F1B4EE45900DE266B /* DetailTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96AD908E1B4EE45900DE266B /* DetailTableViewController.m */; }; 34 | 96AD90931B4EE5A800DE266B /* ResizableTextTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 96AD90921B4EE5A800DE266B /* ResizableTextTableViewCell.m */; }; 35 | 96AE86C71B59BDE600D803B2 /* SnippetsManagerConf.m in Sources */ = {isa = PBXBuildFile; fileRef = 96AE86C61B59BDE600D803B2 /* SnippetsManagerConf.m */; }; 36 | 96D316F01B864FB3003348E7 /* ParamsPostDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96D316EF1B864FB3003348E7 /* ParamsPostDataViewController.m */; }; 37 | D31B940B1BE27B2800AC1CEE /* newFolderData.json in Resources */ = {isa = PBXBuildFile; fileRef = D31B940A1BE27B2800AC1CEE /* newFolderData.json */; }; 38 | D31B940F1BE298E500AC1CEE /* patchMetadataFile.json in Resources */ = {isa = PBXBuildFile; fileRef = D31B940E1BE298E500AC1CEE /* patchMetadataFile.json */; }; 39 | D3EB832B1B87CBCD007509BD /* eventData.json in Resources */ = {isa = PBXBuildFile; fileRef = D3EB832A1B87CBCD007509BD /* eventData.json */; }; 40 | /* End PBXBuildFile section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 0ACF234EA15CD472473610B6 /* Pods-O365-iOS-Microsoft-Graph-Snippets.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-O365-iOS-Microsoft-Graph-Snippets.debug.xcconfig"; path = "Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-Snippets/Pods-O365-iOS-Microsoft-Graph-Snippets.debug.xcconfig"; sourceTree = ""; }; 44 | 854A3998C333805F74F8CA48 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 960C1FCB1B3B639700918D53 /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 46 | 963E9EE71B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "O365-iOS-Microsoft-Graph-Snippets.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 963E9EEB1B38C50400D57EAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 963E9EEC1B38C50400D57EAA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 963E9EEE1B38C50400D57EAA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | 963E9EEF1B38C50400D57EAA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 51 | 963E9EF11B38C50400D57EAA /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 52 | 963E9EF21B38C50400D57EAA /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 53 | 963E9EF81B38C50400D57EAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | 963E9EFA1B38C50400D57EAA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 55 | 963E9EFD1B38C50400D57EAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 56 | 963E9F141B38C6E100D57EAA /* ConnectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectViewController.h; sourceTree = ""; }; 57 | 963E9F151B38C6E100D57EAA /* ConnectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectViewController.m; sourceTree = ""; }; 58 | 963E9F1A1B38CE5F00D57EAA /* AuthenticationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationManager.h; sourceTree = ""; }; 59 | 963E9F1B1B38CE5F00D57EAA /* AuthenticationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthenticationManager.m; sourceTree = ""; }; 60 | 963E9F241B38CED900D57EAA /* SnippetsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SnippetsManager.h; sourceTree = ""; }; 61 | 963E9F251B38CED900D57EAA /* SnippetsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SnippetsManager.m; sourceTree = ""; }; 62 | 963E9F281B38CF1D00D57EAA /* NetworkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkManager.h; sourceTree = ""; }; 63 | 963E9F291B38CF1D00D57EAA /* NetworkManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkManager.m; sourceTree = ""; }; 64 | 9642FCC01BA2CE9D00BCC6F0 /* newUserData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = newUserData.json; sourceTree = ""; }; 65 | 9642FCC21BA2D0D800BCC6F0 /* newGroupData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = newGroupData.json; sourceTree = ""; }; 66 | 9642FCC61BA2D6BF00BCC6F0 /* patchGroupData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = patchGroupData.json; sourceTree = ""; }; 67 | 965A310D1BA0EEE400644CFA /* eventDataPatch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = eventDataPatch.json; sourceTree = ""; }; 68 | 965A310F1BA0F2ED00644CFA /* emailData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = emailData.json; sourceTree = ""; }; 69 | 9663321A1B3CA12C007A9E5E /* Operation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Operation.h; sourceTree = ""; }; 70 | 9663321B1B3CA12C007A9E5E /* Operation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Operation.m; sourceTree = ""; }; 71 | 969D39281B5709C700604B95 /* o365.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = o365.png; path = Resources/o365.png; sourceTree = SOURCE_ROOT; }; 72 | 96A4C7E11B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPResponseSerializerHTML.h; sourceTree = ""; }; 73 | 96A4C7E21B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPResponseSerializerHTML.m; sourceTree = ""; }; 74 | 96A4C7E61B560D17007AC7F2 /* MultiformObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MultiformObject.h; sourceTree = ""; }; 75 | 96A4C7E71B560D17007AC7F2 /* MultiformObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MultiformObject.m; sourceTree = ""; }; 76 | 96AA99291B507F9900ABFEA1 /* ParamsListTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParamsListTableViewController.h; sourceTree = ""; }; 77 | 96AA992A1B507F9900ABFEA1 /* ParamsListTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParamsListTableViewController.m; sourceTree = ""; }; 78 | 96AA992C1B50842600ABFEA1 /* ParamsTextTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParamsTextTableViewController.h; sourceTree = ""; }; 79 | 96AA992D1B50842600ABFEA1 /* ParamsTextTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParamsTextTableViewController.m; sourceTree = ""; }; 80 | 96AA992F1B50844E00ABFEA1 /* ParamsHelperDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParamsHelperDelegate.h; sourceTree = ""; }; 81 | 96AD908D1B4EE45900DE266B /* DetailTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailTableViewController.h; sourceTree = ""; }; 82 | 96AD908E1B4EE45900DE266B /* DetailTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailTableViewController.m; sourceTree = ""; }; 83 | 96AD90911B4EE5A800DE266B /* ResizableTextTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResizableTextTableViewCell.h; sourceTree = ""; }; 84 | 96AD90921B4EE5A800DE266B /* ResizableTextTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResizableTextTableViewCell.m; sourceTree = ""; }; 85 | 96AE86C51B59BDE600D803B2 /* SnippetsManagerConf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SnippetsManagerConf.h; sourceTree = ""; }; 86 | 96AE86C61B59BDE600D803B2 /* SnippetsManagerConf.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SnippetsManagerConf.m; sourceTree = ""; }; 87 | 96D316EE1B864FB3003348E7 /* ParamsPostDataViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParamsPostDataViewController.h; sourceTree = ""; }; 88 | 96D316EF1B864FB3003348E7 /* ParamsPostDataViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParamsPostDataViewController.m; sourceTree = ""; }; 89 | CA3970DF6DF34BC98F021447 /* libPods-O365-iOS-Microsoft-Graph-Snippets.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-O365-iOS-Microsoft-Graph-Snippets.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 90 | D249061BA29ED1810F73734C /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 91 | D31B940A1BE27B2800AC1CEE /* newFolderData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = newFolderData.json; sourceTree = ""; }; 92 | D31B940E1BE298E500AC1CEE /* patchMetadataFile.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = patchMetadataFile.json; sourceTree = ""; }; 93 | D35D18131BA33C20006CAA17 /* README.MD */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.MD; sourceTree = ""; }; 94 | D3EB832A1B87CBCD007509BD /* eventData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = eventData.json; sourceTree = ""; }; 95 | DEDB4C928D1FFA1D63CDF269 /* Pods-O365-iOS-Microsoft-Graph-Snippets.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-O365-iOS-Microsoft-Graph-Snippets.release.xcconfig"; path = "Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-Snippets/Pods-O365-iOS-Microsoft-Graph-Snippets.release.xcconfig"; sourceTree = ""; }; 96 | F92D0DB9EA9FCA42FD4BE0E7 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 97 | /* End PBXFileReference section */ 98 | 99 | /* Begin PBXFrameworksBuildPhase section */ 100 | 963E9EE41B38C50400D57EAA /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | 096E28EF2C20215DADCC3578 /* libPods-O365-iOS-Microsoft-Graph-Snippets.a in Frameworks */, 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXFrameworksBuildPhase section */ 109 | 110 | /* Begin PBXGroup section */ 111 | 2C4455A4B973EEA43DC07AF3 /* Pods */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | D249061BA29ED1810F73734C /* Pods.debug.xcconfig */, 115 | F92D0DB9EA9FCA42FD4BE0E7 /* Pods.release.xcconfig */, 116 | 0ACF234EA15CD472473610B6 /* Pods-O365-iOS-Microsoft-Graph-Snippets.debug.xcconfig */, 117 | DEDB4C928D1FFA1D63CDF269 /* Pods-O365-iOS-Microsoft-Graph-Snippets.release.xcconfig */, 118 | ); 119 | name = Pods; 120 | sourceTree = ""; 121 | }; 122 | 963E9EDE1B38C50400D57EAA = { 123 | isa = PBXGroup; 124 | children = ( 125 | D35D18131BA33C20006CAA17 /* README.MD */, 126 | 960C1FCB1B3B639700918D53 /* Podfile */, 127 | 963E9EE91B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets */, 128 | 963E9EE81B38C50400D57EAA /* Products */, 129 | 2C4455A4B973EEA43DC07AF3 /* Pods */, 130 | DE059EE77FF333E37389127C /* Frameworks */, 131 | ); 132 | sourceTree = ""; 133 | }; 134 | 963E9EE81B38C50400D57EAA /* Products */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 963E9EE71B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets.app */, 138 | ); 139 | name = Products; 140 | sourceTree = ""; 141 | }; 142 | 963E9EE91B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 969D39191B57096900604B95 /* Resources */, 146 | 96AD90901B4EE59600DE266B /* View */, 147 | 96F889AC1B39E3C300FBC65A /* Models */, 148 | 96F889AA1B39E32600FBC65A /* Library */, 149 | 96F889A91B39E31A00FBC65A /* Controllers */, 150 | 96F889A81B39E30C00FBC65A /* Application */, 151 | ); 152 | path = "O365-iOS-Microsoft-Graph-Snippets"; 153 | sourceTree = ""; 154 | }; 155 | 963E9F191B38CE5000D57EAA /* Authentication */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 963E9F1A1B38CE5F00D57EAA /* AuthenticationManager.h */, 159 | 963E9F1B1B38CE5F00D57EAA /* AuthenticationManager.m */, 160 | ); 161 | name = Authentication; 162 | sourceTree = ""; 163 | }; 164 | 963E9F231B38CEC700D57EAA /* Snippets */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 963E9F241B38CED900D57EAA /* SnippetsManager.h */, 168 | 963E9F251B38CED900D57EAA /* SnippetsManager.m */, 169 | 96AE86C51B59BDE600D803B2 /* SnippetsManagerConf.h */, 170 | 96AE86C61B59BDE600D803B2 /* SnippetsManagerConf.m */, 171 | ); 172 | name = Snippets; 173 | sourceTree = ""; 174 | }; 175 | 963E9F271B38CF1400D57EAA /* Network */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 963E9F281B38CF1D00D57EAA /* NetworkManager.h */, 179 | 963E9F291B38CF1D00D57EAA /* NetworkManager.m */, 180 | 96A4C7E11B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.h */, 181 | 96A4C7E21B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.m */, 182 | ); 183 | name = Network; 184 | sourceTree = ""; 185 | }; 186 | 969D39191B57096900604B95 /* Resources */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | D3EB832A1B87CBCD007509BD /* eventData.json */, 190 | 965A310D1BA0EEE400644CFA /* eventDataPatch.json */, 191 | 965A310F1BA0F2ED00644CFA /* emailData.json */, 192 | 9642FCC01BA2CE9D00BCC6F0 /* newUserData.json */, 193 | 9642FCC21BA2D0D800BCC6F0 /* newGroupData.json */, 194 | 9642FCC61BA2D6BF00BCC6F0 /* patchGroupData.json */, 195 | D31B940A1BE27B2800AC1CEE /* newFolderData.json */, 196 | D31B940E1BE298E500AC1CEE /* patchMetadataFile.json */, 197 | 963E9EFA1B38C50400D57EAA /* Images.xcassets */, 198 | 969D39281B5709C700604B95 /* o365.png */, 199 | ); 200 | name = Resources; 201 | sourceTree = ""; 202 | }; 203 | 96AD90901B4EE59600DE266B /* View */ = { 204 | isa = PBXGroup; 205 | children = ( 206 | 96AD90911B4EE5A800DE266B /* ResizableTextTableViewCell.h */, 207 | 96AD90921B4EE5A800DE266B /* ResizableTextTableViewCell.m */, 208 | ); 209 | name = View; 210 | sourceTree = ""; 211 | }; 212 | 96F889A81B39E30C00FBC65A /* Application */ = { 213 | isa = PBXGroup; 214 | children = ( 215 | 963E9EEB1B38C50400D57EAA /* Info.plist */, 216 | 963E9EEC1B38C50400D57EAA /* main.m */, 217 | 963E9EEE1B38C50400D57EAA /* AppDelegate.h */, 218 | 963E9EEF1B38C50400D57EAA /* AppDelegate.m */, 219 | ); 220 | name = Application; 221 | sourceTree = ""; 222 | }; 223 | 96F889A91B39E31A00FBC65A /* Controllers */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | 96F889AE1B39E3E700FBC65A /* Main */, 227 | 96F889AD1B39E3DE00FBC65A /* Connect */, 228 | 963E9EF71B38C50400D57EAA /* Main.storyboard */, 229 | 963E9EFC1B38C50400D57EAA /* LaunchScreen.xib */, 230 | ); 231 | name = Controllers; 232 | sourceTree = ""; 233 | }; 234 | 96F889AA1B39E32600FBC65A /* Library */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | 963E9F191B38CE5000D57EAA /* Authentication */, 238 | 963E9F271B38CF1400D57EAA /* Network */, 239 | 963E9F231B38CEC700D57EAA /* Snippets */, 240 | ); 241 | name = Library; 242 | sourceTree = ""; 243 | }; 244 | 96F889AC1B39E3C300FBC65A /* Models */ = { 245 | isa = PBXGroup; 246 | children = ( 247 | 9663321A1B3CA12C007A9E5E /* Operation.h */, 248 | 9663321B1B3CA12C007A9E5E /* Operation.m */, 249 | 96A4C7E61B560D17007AC7F2 /* MultiformObject.h */, 250 | 96A4C7E71B560D17007AC7F2 /* MultiformObject.m */, 251 | ); 252 | name = Models; 253 | sourceTree = ""; 254 | }; 255 | 96F889AD1B39E3DE00FBC65A /* Connect */ = { 256 | isa = PBXGroup; 257 | children = ( 258 | 963E9F141B38C6E100D57EAA /* ConnectViewController.h */, 259 | 963E9F151B38C6E100D57EAA /* ConnectViewController.m */, 260 | ); 261 | name = Connect; 262 | sourceTree = ""; 263 | }; 264 | 96F889AE1B39E3E700FBC65A /* Main */ = { 265 | isa = PBXGroup; 266 | children = ( 267 | 963E9EF11B38C50400D57EAA /* MasterViewController.h */, 268 | 963E9EF21B38C50400D57EAA /* MasterViewController.m */, 269 | 96AD908D1B4EE45900DE266B /* DetailTableViewController.h */, 270 | 96AD908E1B4EE45900DE266B /* DetailTableViewController.m */, 271 | 96AA99291B507F9900ABFEA1 /* ParamsListTableViewController.h */, 272 | 96AA992A1B507F9900ABFEA1 /* ParamsListTableViewController.m */, 273 | 96AA992C1B50842600ABFEA1 /* ParamsTextTableViewController.h */, 274 | 96AA992D1B50842600ABFEA1 /* ParamsTextTableViewController.m */, 275 | 96AA992F1B50844E00ABFEA1 /* ParamsHelperDelegate.h */, 276 | 96D316EE1B864FB3003348E7 /* ParamsPostDataViewController.h */, 277 | 96D316EF1B864FB3003348E7 /* ParamsPostDataViewController.m */, 278 | ); 279 | name = Main; 280 | sourceTree = ""; 281 | }; 282 | DE059EE77FF333E37389127C /* Frameworks */ = { 283 | isa = PBXGroup; 284 | children = ( 285 | 854A3998C333805F74F8CA48 /* libPods.a */, 286 | CA3970DF6DF34BC98F021447 /* libPods-O365-iOS-Microsoft-Graph-Snippets.a */, 287 | ); 288 | name = Frameworks; 289 | sourceTree = ""; 290 | }; 291 | /* End PBXGroup section */ 292 | 293 | /* Begin PBXNativeTarget section */ 294 | 963E9EE61B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets */ = { 295 | isa = PBXNativeTarget; 296 | buildConfigurationList = 963E9F0D1B38C50400D57EAA /* Build configuration list for PBXNativeTarget "O365-iOS-Microsoft-Graph-Snippets" */; 297 | buildPhases = ( 298 | BB8AEE471D22A05D11A11EF9 /* [CP] Check Pods Manifest.lock */, 299 | 963E9EE31B38C50400D57EAA /* Sources */, 300 | 963E9EE41B38C50400D57EAA /* Frameworks */, 301 | 963E9EE51B38C50400D57EAA /* Resources */, 302 | 9EE967B535D311EED8AF8313 /* [CP] Copy Pods Resources */, 303 | 6C29C94150C28939B1BA9CA0 /* [CP] Embed Pods Frameworks */, 304 | ); 305 | buildRules = ( 306 | ); 307 | dependencies = ( 308 | ); 309 | name = "O365-iOS-Microsoft-Graph-Snippets"; 310 | productName = "O365-iOS-OneNoteSample"; 311 | productReference = 963E9EE71B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets.app */; 312 | productType = "com.apple.product-type.application"; 313 | }; 314 | /* End PBXNativeTarget section */ 315 | 316 | /* Begin PBXProject section */ 317 | 963E9EDF1B38C50400D57EAA /* Project object */ = { 318 | isa = PBXProject; 319 | attributes = { 320 | LastUpgradeCheck = 0630; 321 | ORGANIZATIONNAME = Microsoft; 322 | TargetAttributes = { 323 | 963E9EE61B38C50400D57EAA = { 324 | CreatedOnToolsVersion = 6.3.2; 325 | }; 326 | }; 327 | }; 328 | buildConfigurationList = 963E9EE21B38C50400D57EAA /* Build configuration list for PBXProject "O365-iOS-Microsoft-Graph-Snippets" */; 329 | compatibilityVersion = "Xcode 3.2"; 330 | developmentRegion = English; 331 | hasScannedForEncodings = 0; 332 | knownRegions = ( 333 | en, 334 | Base, 335 | ); 336 | mainGroup = 963E9EDE1B38C50400D57EAA; 337 | productRefGroup = 963E9EE81B38C50400D57EAA /* Products */; 338 | projectDirPath = ""; 339 | projectRoot = ""; 340 | targets = ( 341 | 963E9EE61B38C50400D57EAA /* O365-iOS-Microsoft-Graph-Snippets */, 342 | ); 343 | }; 344 | /* End PBXProject section */ 345 | 346 | /* Begin PBXResourcesBuildPhase section */ 347 | 963E9EE51B38C50400D57EAA /* Resources */ = { 348 | isa = PBXResourcesBuildPhase; 349 | buildActionMask = 2147483647; 350 | files = ( 351 | 963E9EF91B38C50400D57EAA /* Main.storyboard in Resources */, 352 | 965A31101BA0F2ED00644CFA /* emailData.json in Resources */, 353 | D3EB832B1B87CBCD007509BD /* eventData.json in Resources */, 354 | D31B940F1BE298E500AC1CEE /* patchMetadataFile.json in Resources */, 355 | 963E9EFE1B38C50400D57EAA /* LaunchScreen.xib in Resources */, 356 | 9642FCC11BA2CE9D00BCC6F0 /* newUserData.json in Resources */, 357 | 9642FCC31BA2D0D800BCC6F0 /* newGroupData.json in Resources */, 358 | D31B940B1BE27B2800AC1CEE /* newFolderData.json in Resources */, 359 | 960C1FCC1B3B639700918D53 /* Podfile in Resources */, 360 | 9642FCC71BA2D6BF00BCC6F0 /* patchGroupData.json in Resources */, 361 | 969D393B1B5709C700604B95 /* o365.png in Resources */, 362 | 963E9EFB1B38C50400D57EAA /* Images.xcassets in Resources */, 363 | 965A310E1BA0EEE400644CFA /* eventDataPatch.json in Resources */, 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | }; 367 | /* End PBXResourcesBuildPhase section */ 368 | 369 | /* Begin PBXShellScriptBuildPhase section */ 370 | 6C29C94150C28939B1BA9CA0 /* [CP] Embed Pods Frameworks */ = { 371 | isa = PBXShellScriptBuildPhase; 372 | buildActionMask = 2147483647; 373 | files = ( 374 | ); 375 | inputPaths = ( 376 | ); 377 | name = "[CP] Embed Pods Frameworks"; 378 | outputPaths = ( 379 | ); 380 | runOnlyForDeploymentPostprocessing = 0; 381 | shellPath = /bin/sh; 382 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-Snippets/Pods-O365-iOS-Microsoft-Graph-Snippets-frameworks.sh\"\n"; 383 | showEnvVarsInLog = 0; 384 | }; 385 | 9EE967B535D311EED8AF8313 /* [CP] Copy Pods Resources */ = { 386 | isa = PBXShellScriptBuildPhase; 387 | buildActionMask = 2147483647; 388 | files = ( 389 | ); 390 | inputPaths = ( 391 | ); 392 | name = "[CP] Copy Pods Resources"; 393 | outputPaths = ( 394 | ); 395 | runOnlyForDeploymentPostprocessing = 0; 396 | shellPath = /bin/sh; 397 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-O365-iOS-Microsoft-Graph-Snippets/Pods-O365-iOS-Microsoft-Graph-Snippets-resources.sh\"\n"; 398 | showEnvVarsInLog = 0; 399 | }; 400 | BB8AEE471D22A05D11A11EF9 /* [CP] Check Pods Manifest.lock */ = { 401 | isa = PBXShellScriptBuildPhase; 402 | buildActionMask = 2147483647; 403 | files = ( 404 | ); 405 | inputPaths = ( 406 | ); 407 | name = "[CP] Check Pods Manifest.lock"; 408 | outputPaths = ( 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | shellPath = /bin/sh; 412 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 413 | showEnvVarsInLog = 0; 414 | }; 415 | /* End PBXShellScriptBuildPhase section */ 416 | 417 | /* Begin PBXSourcesBuildPhase section */ 418 | 963E9EE31B38C50400D57EAA /* Sources */ = { 419 | isa = PBXSourcesBuildPhase; 420 | buildActionMask = 2147483647; 421 | files = ( 422 | 96AD908F1B4EE45900DE266B /* DetailTableViewController.m in Sources */, 423 | 96A4C7E81B560D17007AC7F2 /* MultiformObject.m in Sources */, 424 | 963E9EF01B38C50400D57EAA /* AppDelegate.m in Sources */, 425 | 963E9F161B38C6E100D57EAA /* ConnectViewController.m in Sources */, 426 | 963E9EF31B38C50400D57EAA /* MasterViewController.m in Sources */, 427 | 963E9EED1B38C50400D57EAA /* main.m in Sources */, 428 | 96AE86C71B59BDE600D803B2 /* SnippetsManagerConf.m in Sources */, 429 | 9663321C1B3CA12C007A9E5E /* Operation.m in Sources */, 430 | 963E9F1C1B38CE5F00D57EAA /* AuthenticationManager.m in Sources */, 431 | 96AA992E1B50842600ABFEA1 /* ParamsTextTableViewController.m in Sources */, 432 | 96AA992B1B507F9900ABFEA1 /* ParamsListTableViewController.m in Sources */, 433 | 96AD90931B4EE5A800DE266B /* ResizableTextTableViewCell.m in Sources */, 434 | 963E9F2A1B38CF1D00D57EAA /* NetworkManager.m in Sources */, 435 | 96D316F01B864FB3003348E7 /* ParamsPostDataViewController.m in Sources */, 436 | 963E9F261B38CED900D57EAA /* SnippetsManager.m in Sources */, 437 | 96A4C7E31B55CC2E007AC7F2 /* AFHTTPResponseSerializerHTML.m in Sources */, 438 | ); 439 | runOnlyForDeploymentPostprocessing = 0; 440 | }; 441 | /* End PBXSourcesBuildPhase section */ 442 | 443 | /* Begin PBXVariantGroup section */ 444 | 963E9EF71B38C50400D57EAA /* Main.storyboard */ = { 445 | isa = PBXVariantGroup; 446 | children = ( 447 | 963E9EF81B38C50400D57EAA /* Base */, 448 | ); 449 | name = Main.storyboard; 450 | sourceTree = ""; 451 | }; 452 | 963E9EFC1B38C50400D57EAA /* LaunchScreen.xib */ = { 453 | isa = PBXVariantGroup; 454 | children = ( 455 | 963E9EFD1B38C50400D57EAA /* Base */, 456 | ); 457 | name = LaunchScreen.xib; 458 | sourceTree = ""; 459 | }; 460 | /* End PBXVariantGroup section */ 461 | 462 | /* Begin XCBuildConfiguration section */ 463 | 963E9F0B1B38C50400D57EAA /* Debug */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ALWAYS_SEARCH_USER_PATHS = NO; 467 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 468 | CLANG_CXX_LIBRARY = "libc++"; 469 | CLANG_ENABLE_MODULES = YES; 470 | CLANG_ENABLE_OBJC_ARC = YES; 471 | CLANG_WARN_BOOL_CONVERSION = YES; 472 | CLANG_WARN_CONSTANT_CONVERSION = YES; 473 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INT_CONVERSION = YES; 477 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 478 | CLANG_WARN_UNREACHABLE_CODE = YES; 479 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 480 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 481 | COPY_PHASE_STRIP = NO; 482 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 483 | ENABLE_STRICT_OBJC_MSGSEND = YES; 484 | GCC_C_LANGUAGE_STANDARD = gnu99; 485 | GCC_DYNAMIC_NO_PIC = NO; 486 | GCC_NO_COMMON_BLOCKS = YES; 487 | GCC_OPTIMIZATION_LEVEL = 0; 488 | GCC_PREPROCESSOR_DEFINITIONS = ( 489 | "DEBUG=1", 490 | "$(inherited)", 491 | ); 492 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 493 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 494 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 495 | GCC_WARN_UNDECLARED_SELECTOR = YES; 496 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 497 | GCC_WARN_UNUSED_FUNCTION = YES; 498 | GCC_WARN_UNUSED_VARIABLE = YES; 499 | HEADER_SEARCH_PATHS = "$(SRCROOT)/**"; 500 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 501 | MTL_ENABLE_DEBUG_INFO = YES; 502 | ONLY_ACTIVE_ARCH = YES; 503 | SDKROOT = iphoneos; 504 | TARGETED_DEVICE_FAMILY = "1,2"; 505 | }; 506 | name = Debug; 507 | }; 508 | 963E9F0C1B38C50400D57EAA /* Release */ = { 509 | isa = XCBuildConfiguration; 510 | buildSettings = { 511 | ALWAYS_SEARCH_USER_PATHS = NO; 512 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 513 | CLANG_CXX_LIBRARY = "libc++"; 514 | CLANG_ENABLE_MODULES = YES; 515 | CLANG_ENABLE_OBJC_ARC = YES; 516 | CLANG_WARN_BOOL_CONVERSION = YES; 517 | CLANG_WARN_CONSTANT_CONVERSION = YES; 518 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 519 | CLANG_WARN_EMPTY_BODY = YES; 520 | CLANG_WARN_ENUM_CONVERSION = YES; 521 | CLANG_WARN_INT_CONVERSION = YES; 522 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 523 | CLANG_WARN_UNREACHABLE_CODE = YES; 524 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 525 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 526 | COPY_PHASE_STRIP = NO; 527 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 528 | ENABLE_NS_ASSERTIONS = NO; 529 | ENABLE_STRICT_OBJC_MSGSEND = YES; 530 | GCC_C_LANGUAGE_STANDARD = gnu99; 531 | GCC_NO_COMMON_BLOCKS = YES; 532 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 533 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 534 | GCC_WARN_UNDECLARED_SELECTOR = YES; 535 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 536 | GCC_WARN_UNUSED_FUNCTION = YES; 537 | GCC_WARN_UNUSED_VARIABLE = YES; 538 | HEADER_SEARCH_PATHS = "$(SRCROOT)/**"; 539 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 540 | MTL_ENABLE_DEBUG_INFO = NO; 541 | SDKROOT = iphoneos; 542 | TARGETED_DEVICE_FAMILY = "1,2"; 543 | VALIDATE_PRODUCT = YES; 544 | }; 545 | name = Release; 546 | }; 547 | 963E9F0E1B38C50400D57EAA /* Debug */ = { 548 | isa = XCBuildConfiguration; 549 | baseConfigurationReference = 0ACF234EA15CD472473610B6 /* Pods-O365-iOS-Microsoft-Graph-Snippets.debug.xcconfig */; 550 | buildSettings = { 551 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 552 | INFOPLIST_FILE = "O365-iOS-Microsoft-Graph-Snippets/Info.plist"; 553 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 554 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 555 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.O365-iOS-Microsoft-Graph-Snippets"; 556 | PRODUCT_NAME = "O365-iOS-Microsoft-Graph-Snippets"; 557 | TARGETED_DEVICE_FAMILY = 2; 558 | }; 559 | name = Debug; 560 | }; 561 | 963E9F0F1B38C50400D57EAA /* Release */ = { 562 | isa = XCBuildConfiguration; 563 | baseConfigurationReference = DEDB4C928D1FFA1D63CDF269 /* Pods-O365-iOS-Microsoft-Graph-Snippets.release.xcconfig */; 564 | buildSettings = { 565 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 566 | INFOPLIST_FILE = "O365-iOS-Microsoft-Graph-Snippets/Info.plist"; 567 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 568 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 569 | PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.O365-iOS-Microsoft-Graph-Snippets"; 570 | PRODUCT_NAME = "O365-iOS-Microsoft-Graph-Snippets"; 571 | TARGETED_DEVICE_FAMILY = 2; 572 | }; 573 | name = Release; 574 | }; 575 | /* End XCBuildConfiguration section */ 576 | 577 | /* Begin XCConfigurationList section */ 578 | 963E9EE21B38C50400D57EAA /* Build configuration list for PBXProject "O365-iOS-Microsoft-Graph-Snippets" */ = { 579 | isa = XCConfigurationList; 580 | buildConfigurations = ( 581 | 963E9F0B1B38C50400D57EAA /* Debug */, 582 | 963E9F0C1B38C50400D57EAA /* Release */, 583 | ); 584 | defaultConfigurationIsVisible = 0; 585 | defaultConfigurationName = Release; 586 | }; 587 | 963E9F0D1B38C50400D57EAA /* Build configuration list for PBXNativeTarget "O365-iOS-Microsoft-Graph-Snippets" */ = { 588 | isa = XCConfigurationList; 589 | buildConfigurations = ( 590 | 963E9F0E1B38C50400D57EAA /* Debug */, 591 | 963E9F0F1B38C50400D57EAA /* Release */, 592 | ); 593 | defaultConfigurationIsVisible = 0; 594 | defaultConfigurationName = Release; 595 | }; 596 | /* End XCConfigurationList section */ 597 | }; 598 | rootObject = 963E9EDF1B38C50400D57EAA /* Project object */; 599 | } 600 | --------------------------------------------------------------------------------