Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Example stub corrections
  • Loading branch information
lukaszmargielewski committed Oct 5, 2015
1 parent 1edbb63 commit aefb398
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 53 deletions.
59 changes: 46 additions & 13 deletions Example/MIJSONRequestExample.xcodeproj/project.pbxproj
Expand Up @@ -7,12 +7,14 @@
objects = {

/* Begin PBXBuildFile section */
A14EDBE41B1C686C00CF5C9D /* ChildtestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A14EDBE31B1C686C00CF5C9D /* ChildtestViewController.m */; };
A117903C1BC31BC20029B8E1 /* MIJSONApi.m in Sources */ = {isa = PBXBuildFile; fileRef = A11790341BC31BC20029B8E1 /* MIJSONApi.m */; settings = {ASSET_TAGS = (); }; };
A117903D1BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.m in Sources */ = {isa = PBXBuildFile; fileRef = A11790361BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.m */; settings = {ASSET_TAGS = (); }; };
A117903E1BC31BC20029B8E1 /* ChildtestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A11790391BC31BC20029B8E1 /* ChildtestViewController.m */; settings = {ASSET_TAGS = (); }; };
A117903F1BC31BC20029B8E1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A117903B1BC31BC20029B8E1 /* ViewController.m */; settings = {ASSET_TAGS = (); }; };
A14EDBE71B1C830500CF5C9D /* MIJSONRequestSecureSession.m in Sources */ = {isa = PBXBuildFile; fileRef = A14EDBE61B1C830500CF5C9D /* MIJSONRequestSecureSession.m */; };
A14EDBEA1B1C869800CF5C9D /* KeychainItemWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = A14EDBE91B1C869800CF5C9D /* KeychainItemWrapper.m */; };
A173863C1B18A04D00750B53 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A173863B1B18A04D00750B53 /* main.m */; };
A173863F1B18A04D00750B53 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A173863E1B18A04D00750B53 /* AppDelegate.m */; };
A17386421B18A04D00750B53 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A17386411B18A04D00750B53 /* ViewController.m */; };
A17386451B18A04D00750B53 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A17386431B18A04D00750B53 /* Main.storyboard */; };
A17386471B18A04D00750B53 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A17386461B18A04D00750B53 /* Images.xcassets */; };
A173864A1B18A04D00750B53 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = A17386481B18A04D00750B53 /* LaunchScreen.xib */; };
Expand All @@ -36,8 +38,14 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
A14EDBE21B1C686C00CF5C9D /* ChildtestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildtestViewController.h; sourceTree = "<group>"; };
A14EDBE31B1C686C00CF5C9D /* ChildtestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChildtestViewController.m; sourceTree = "<group>"; };
A11790331BC31BC20029B8E1 /* MIJSONApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MIJSONApi.h; sourceTree = "<group>"; };
A11790341BC31BC20029B8E1 /* MIJSONApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MIJSONApi.m; sourceTree = "<group>"; };
A11790351BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MIJSONApiAuthenticateAll.h; sourceTree = "<group>"; };
A11790361BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MIJSONApiAuthenticateAll.m; sourceTree = "<group>"; };
A11790381BC31BC20029B8E1 /* ChildtestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildtestViewController.h; sourceTree = "<group>"; };
A11790391BC31BC20029B8E1 /* ChildtestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChildtestViewController.m; sourceTree = "<group>"; };
A117903A1BC31BC20029B8E1 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
A117903B1BC31BC20029B8E1 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
A14EDBE51B1C830500CF5C9D /* MIJSONRequestSecureSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MIJSONRequestSecureSession.h; sourceTree = "<group>"; };
A14EDBE61B1C830500CF5C9D /* MIJSONRequestSecureSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MIJSONRequestSecureSession.m; sourceTree = "<group>"; };
A14EDBE81B1C869800CF5C9D /* KeychainItemWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeychainItemWrapper.h; sourceTree = "<group>"; };
Expand All @@ -47,8 +55,6 @@
A173863B1B18A04D00750B53 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
A173863D1B18A04D00750B53 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
A173863E1B18A04D00750B53 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
A17386401B18A04D00750B53 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
A17386411B18A04D00750B53 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
A17386441B18A04D00750B53 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
A17386461B18A04D00750B53 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
A17386491B18A04D00750B53 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -87,6 +93,28 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
A11790321BC31BC20029B8E1 /* ExampleWebserviceAPI */ = {
isa = PBXGroup;
children = (
A11790331BC31BC20029B8E1 /* MIJSONApi.h */,
A11790341BC31BC20029B8E1 /* MIJSONApi.m */,
A11790351BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.h */,
A11790361BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.m */,
);
path = ExampleWebserviceAPI;
sourceTree = "<group>";
};
A11790371BC31BC20029B8E1 /* ViewControllers */ = {
isa = PBXGroup;
children = (
A11790381BC31BC20029B8E1 /* ChildtestViewController.h */,
A11790391BC31BC20029B8E1 /* ChildtestViewController.m */,
A117903A1BC31BC20029B8E1 /* ViewController.h */,
A117903B1BC31BC20029B8E1 /* ViewController.m */,
);
path = ViewControllers;
sourceTree = "<group>";
};
A173862D1B18A04D00750B53 = {
isa = PBXGroup;
children = (
Expand All @@ -109,12 +137,10 @@
A17386381B18A04D00750B53 /* MIJSONRequestExample */ = {
isa = PBXGroup;
children = (
A11790321BC31BC20029B8E1 /* ExampleWebserviceAPI */,
A11790371BC31BC20029B8E1 /* ViewControllers */,
A173863D1B18A04D00750B53 /* AppDelegate.h */,
A173863E1B18A04D00750B53 /* AppDelegate.m */,
A17386401B18A04D00750B53 /* ViewController.h */,
A17386411B18A04D00750B53 /* ViewController.m */,
A14EDBE21B1C686C00CF5C9D /* ChildtestViewController.h */,
A14EDBE31B1C686C00CF5C9D /* ChildtestViewController.m */,
A17386431B18A04D00750B53 /* Main.storyboard */,
A17386461B18A04D00750B53 /* Images.xcassets */,
A17386481B18A04D00750B53 /* LaunchScreen.xib */,
Expand Down Expand Up @@ -225,7 +251,7 @@
A173862E1B18A04D00750B53 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Lukasz Margielewski";
TargetAttributes = {
A17386351B18A04D00750B53 = {
Expand Down Expand Up @@ -281,18 +307,20 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A117903F1BC31BC20029B8E1 /* ViewController.m in Sources */,
A1A92DF11B1E204000F59597 /* MIJSONRequestAuthenticationPinCertificateSHA256.m in Sources */,
A14EDBE71B1C830500CF5C9D /* MIJSONRequestSecureSession.m in Sources */,
A17386421B18A04D00750B53 /* ViewController.m in Sources */,
A1A92DFA1B1E27B200F59597 /* NSData+Base64.m in Sources */,
A17386671B18A15300750B53 /* MIJSONRequest.m in Sources */,
A173863F1B18A04D00750B53 /* AppDelegate.m in Sources */,
A117903E1BC31BC20029B8E1 /* ChildtestViewController.m in Sources */,
A1A92E001B1E31AE00F59597 /* MIJSONRequestAuthenticate.m in Sources */,
A117903C1BC31BC20029B8E1 /* MIJSONApi.m in Sources */,
A17386691B18A15300750B53 /* MIJSONRequestManager.m in Sources */,
A14EDBEA1B1C869800CF5C9D /* KeychainItemWrapper.m in Sources */,
A173863C1B18A04D00750B53 /* main.m in Sources */,
A14EDBE41B1C686C00CF5C9D /* ChildtestViewController.m in Sources */,
A17386681B18A15300750B53 /* Reachability.m in Sources */,
A117903D1BC31BC20029B8E1 /* MIJSONApiAuthenticateAll.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -355,6 +383,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -420,6 +449,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MIJSONRequestExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "pl.appledevelop.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -430,6 +460,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MIJSONRequestExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "pl.appledevelop.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand All @@ -448,6 +479,7 @@
);
INFOPLIST_FILE = MIJSONRequestExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "pl.appledevelop.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MIJSONRequestExample.app/MIJSONRequestExample";
};
Expand All @@ -463,6 +495,7 @@
);
INFOPLIST_FILE = MIJSONRequestExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "pl.appledevelop.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MIJSONRequestExample.app/MIJSONRequestExample";
};
Expand Down
@@ -0,0 +1,30 @@
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "C4647815C6AB7208667EF8A826822E1C140252E6",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {

},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"C4647815C6AB7208667EF8A826822E1C140252E6" : 0,
"97052BD13268D207BDD18552CF39B5948C0B93B8" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "53CA1559-FEE4-48CA-B916-722756273AB8",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"C4647815C6AB7208667EF8A826822E1C140252E6" : "MIJSONRequest",
"97052BD13268D207BDD18552CF39B5948C0B93B8" : ""
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "MIJSONRequestExample",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Example\/MIJSONRequestExample.xcodeproj",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/bitbucket.org\/mobile-identity\/ios-hillerod.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "97052BD13268D207BDD18552CF39B5948C0B93B8"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/lukaszmargielewski\/MIJSONRequest.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C4647815C6AB7208667EF8A826822E1C140252E6"
}
]
}
Binary file not shown.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,15 +62,18 @@
ReferencedContainer = "container:MIJSONRequestExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand All @@ -86,10 +89,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
3 changes: 0 additions & 3 deletions Example/MIJSONRequestExample/AppDelegate.h
Expand Up @@ -7,13 +7,10 @@
//

#import <UIKit/UIKit.h>
#import "MIJSONRequestManager.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

+(MIJSONRequestManager *)requestManager;

@end

24 changes: 1 addition & 23 deletions Example/MIJSONRequestExample/AppDelegate.m
Expand Up @@ -7,39 +7,17 @@
//

#import "AppDelegate.h"
#import "MIJSONRequestAuthenticationPinCertificateSHA256.h"
#import "MIJSONRequestManager.h"

#define EXPECTED_CERTIFICATE_BASE64_SHA256 @"a09eab79b96bde078eebc8dc5875bddbf8744e80b678412fb44517dae6d1d3ec"
#define WEBSERVICE_URL @"https://webservice.mobile-identity.com/plugins/mflife/json"
#define HOST_NAME @"http://www.mobile-identity.com"
#define SECURE_SESSION_NAME @"default_session"

@interface AppDelegate ()
@property (nonatomic, strong) MIJSONRequestAuthenticationPinCertificateSHA256 *exampleAuthenticate;
@property (nonatomic, strong) MIJSONRequestManager *requestManager;

@end

@implementation AppDelegate

+ (MIJSONRequestManager *)requestManager{

AppDelegate *appDel = (AppDelegate *)[[UIApplication sharedApplication] delegate];
return appDel.requestManager;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.

self.requestManager = [MIJSONRequestManager requestManagerWithUrlString:WEBSERVICE_URL
hostName:HOST_NAME
loginSessionName:SECURE_SESSION_NAME];

self.requestManager.httpMethodDefault = kMIJSONRequestManagerHttpMethodPOST;
self.exampleAuthenticate = [[MIJSONRequestAuthenticationPinCertificateSHA256 alloc] init];
self.exampleAuthenticate.certificateSha = EXPECTED_CERTIFICATE_BASE64_SHA256;
self.requestManager.authDelegate = self.exampleAuthenticate;

return YES;
}

Expand Down
19 changes: 19 additions & 0 deletions Example/MIJSONRequestExample/ExampleWebserviceAPI/MIJSONApi.h
@@ -0,0 +1,19 @@
//
// MIJSONApi.h
// Hillerod
//
// Created by Lukasz Margielewski on 03/06/15.
// Copyright (c) 2015 Mobile Fitness. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MIJSONRequestManager.h"

extern NSString *kMIJSONApi_SessionKey;
extern NSString *kMIJSONApi_DeviceIdKey;

@interface MIJSONApi : NSObject

+(MIJSONRequestManager *)requestManager;

@end

0 comments on commit aefb398

Please sign in to comment.