9 |
10 | @implementation AuthenticationProvider
11 |
12 | - (NXOAuth2AuthenticationProvider *)authProvider {
13 | return [NXOAuth2AuthenticationProvider sharedAuthProvider];
14 | }
15 |
16 |
17 | /**
18 | Signs out the current AuthProvider, completely removing all tokens and cookies.
19 | @param completionHandler The completion handler to be called when sign out has completed.
20 | error should be non nil if there was no error, and should contain any error(s) that occurred.
21 | */
22 | -(void) disconnect{
23 | [self.authProvider logout];
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/ios-objectivec-connect-sample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | }
43 | ],
44 | "info" : {
45 | "version" : 1,
46 | "author" : "xcode"
47 | }
48 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io
2 |
3 | ### Xcode ###
4 | build/
5 | *.pbxuser
6 | !default.pbxuser
7 | *.mode1v3
8 | !default.mode1v3
9 | *.mode2v3
10 | !default.mode2v3
11 | *.perspectivev3
12 | !default.perspectivev3
13 | xcuserdata
14 | *.xccheckout
15 | *.moved-aside
16 | DerivedData
17 | *.xcuserstate
18 |
19 |
20 | ### Objective-C ###
21 | # Xcode
22 | #
23 | build/
24 | *.pbxuser
25 | !default.pbxuser
26 | *.mode1v3
27 | !default.mode1v3
28 | *.mode2v3
29 | !default.mode2v3
30 | *.perspectivev3
31 | !default.perspectivev3
32 | xcuserdata
33 | *.xccheckout
34 | *.moved-aside
35 | DerivedData
36 | *.hmap
37 | *.ipa
38 | *.xcuserstate
39 |
40 | # CocoaPods
41 | #
42 | Pods/
43 | *Podfile.lock
44 |
45 | ### OSX ###
46 | .DS_Store
47 | .AppleDouble
48 | .LSOverride
49 |
50 | # Icon must end with two \r
51 | Icon
52 |
53 |
54 | # Thumbnails
55 | ._*
56 |
57 | # Files that might appear in the root of a volume
58 | .DocumentRevisions-V100
59 | .fseventsd
60 | .Spotlight-V100
61 | .TemporaryItems
62 | .Trashes
63 | .VolumeIcon.icns
64 |
65 | # Directories potentially created on remote AFP share
66 | .AppleDB
67 | .AppleDesktop
68 | Network Trash Folder
69 | Temporary Items
70 | .apdisk
71 |
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 |
4 | Copyright (c) 2016 Microsoft
5 |
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | THE SOFTWARE.
--------------------------------------------------------------------------------
/ios-objectivec-connect-sample/Localizable.strings:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 |
7 | // ConnectViewController
8 | "CONNECT" = "Connect";
9 | "CONNECTING" = "Connecting...";
10 |
11 | // SendViewController
12 | "DISCONNECT" = "Disconnect";
13 | "DESCRIPTION" = "You're now connected to Office 365.\nTap the Send button below to send a message from your account using the iOS Microsoft Graph SDK.";
14 |
15 | "SEND" = "Send";
16 | "SEND_FAILURE" = "Send mail has failed. Please look at the log for more details.";
17 | "SEND_SUCCESS" = "Mail sent successfully.";
18 |
19 | "LOADING_USER_INFO" = "Loading user information";
20 | "GRAPH_ERROR" = "Graph Error.";
21 | "USER_INFO_LOAD_FAILURE" = "User information loading failed.";
22 | "HI_USER" = "Hi %@";
23 | "USER_INFO_LOAD_SUCCESS" = "User information loaded.";
24 |
25 | "MAIL_SUBJECT" = "Mail received from the Office 365 iOS Microsoft Graph SDK Sample";
26 |
27 | // Common
28 | "GRAPH_TITLE" = "Microsoft Graph Connect";
29 | "CHECK_LOG_ERROR" = "Check print log for error details";
30 | "ERROR" = "Error";
31 | "CLOSE" = "Close";
32 |
33 |
--------------------------------------------------------------------------------
/ios-objectivec-connect-sample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/starter-project/ios-objectivec-connect-sample/Localizable.strings:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 |
7 | // ConnectViewController
8 | "CONNECT" = "Connect";
9 | "CONNECTING" = "Connecting...";
10 |
11 | // SendViewController
12 | "DISCONNECT" = "Disconnect";
13 | "DESCRIPTION" = "You're now connected to Office 365.\nTap the Send button below to send a message from your account using the iOS Microsoft Graph SDK.";
14 |
15 | "SEND" = "Send";
16 | "SEND_FAILURE" = "Send mail has failed. Please look at the log for more details.";
17 | "SEND_SUCCESS" = "Mail sent successfully.";
18 |
19 | "LOADING_USER_INFO" = "Loading user information";
20 | "GRAPH_ERROR" = "Graph Error.";
21 | "USER_INFO_LOAD_FAILURE" = "User information loading failed.";
22 | "HI_USER" = "Hi %@";
23 | "USER_INFO_LOAD_SUCCESS" = "User information loaded.";
24 |
25 | "MAIL_SUBJECT" = "Mail received from the Office 365 iOS Microsoft Graph SDK Sample";
26 |
27 | // Common
28 | "GRAPH_TITLE" = "Microsoft Graph Connect";
29 | "CHECK_LOG_ERROR" = "Check print log for error details";
30 | "ERROR" = "Error";
31 | "CLOSE" = "Close";
32 |
33 |
--------------------------------------------------------------------------------
/starter-project/ios-objectivec-connect-sample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ios-objectivec-connect-sample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/starter-project/ios-objectivec-connect-sample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ios-objectivec-connect-sample.xcworkspace/xcshareddata/O365-iOS-Microsoft-Graph-SDK.xcscmblueprint:
--------------------------------------------------------------------------------
1 | {
2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "8C5781ECE1580644A71AD3DF94D4EECFE6387A36",
3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
4 |
5 | },
6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
7 | "E578364CA79A995DDB1916E193A9960A5CEB2B9B" : 9223372036854775807,
8 | "8C5781ECE1580644A71AD3DF94D4EECFE6387A36" : 9223372036854775807
9 | },
10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "AFD4B935-AF74-4B08-A5E0-88A10EB049AF",
11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
12 | "E578364CA79A995DDB1916E193A9960A5CEB2B9B" : "microsoft-authentication-library-for-objc\/",
13 | "8C5781ECE1580644A71AD3DF94D4EECFE6387A36" : "ios-objectivec-connect-sample\/"
14 | },
15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "ios-objectivec-connect-sample",
16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204,
17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "ios-objectivec-connect-sample.xcworkspace",
18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
19 | {
20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/microsoftgraph\/ios-objectivec-connect-sample.git",
21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C5781ECE1580644A71AD3DF94D4EECFE6387A36"
23 | },
24 | {
25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/AzureAD\/microsoft-authentication-library-for-objc.git",
26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E578364CA79A995DDB1916E193A9960A5CEB2B9B"
28 | }
29 | ]
30 | }
--------------------------------------------------------------------------------
/starter-project/ios-objectivec-connect-sample/EmailBody.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Congratulations.
9 | This is a message from the Microsoft Graph Connect sample. You are well on your way to incorporating Microsoft Graph services in your apps.
10 | What’s next?
11 |
12 | - Check out graph.microsoft.io to start building Microsoft Graph apps today with all the latest tools, templates, and guidance to get started quickly.
13 | - Use the Graph Explorer to start your testing.
14 | - Browse other samples on GitHub to see more of the APIs in action.
15 |
16 | Give us feedback
17 |
18 | - If you have any trouble running this sample, please log an issue.
19 | - For general questions about the Microsoft Graph APIs, post to Stack Overflow. Make sure that your questions or comments are tagged with [MicrosoftGraph].
20 |
21 | Thanks and happy coding!
Your Microsoft Graph Development team
22 |
32 |
33 |
34 |
35 |