diff --git a/.gitignore b/.gitignore index 7edde7b..59e8fc1 100755 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,4 @@ fastlane/Preview.html fastlane/screenshots fastlane/test_output - +Example diff --git a/Pyrobase.podspec b/Pyrobase.podspec index ef407c0..ee945a2 100755 --- a/Pyrobase.podspec +++ b/Pyrobase.podspec @@ -9,4 +9,5 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/mownier/pyrobase.git', :tag => s.version.to_s } s.source_files = 'Pyrobase/*.swift' s.requires_arc = true + s.resources = 'Pyrobase/Plist.bundle' end diff --git a/Pyrobase.xcodeproj/project.pbxproj b/Pyrobase.xcodeproj/project.pbxproj index 00db958..05a71d3 100755 --- a/Pyrobase.xcodeproj/project.pbxproj +++ b/Pyrobase.xcodeproj/project.pbxproj @@ -43,7 +43,6 @@ B99651E71EB8573A0046810D /* RequestMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B99651E61EB8573A0046810D /* RequestMock.swift */; }; B99651EC1EB858900046810D /* RequestTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B99651EB1EB858900046810D /* RequestTest.swift */; }; B99651EE1EB85AF50046810D /* URLSessionMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B99651ED1EB85AF50046810D /* URLSessionMock.swift */; }; - B999C9421EEA66B700385AEA /* PyroAuthInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = B999C9411EEA66B700385AEA /* PyroAuthInfo.plist */; }; B999C9441EEA690600385AEA /* PlistReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = B999C9431EEA690600385AEA /* PlistReader.swift */; }; B999C9461EEA71A600385AEA /* PlistReaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B999C9451EEA71A600385AEA /* PlistReaderTest.swift */; }; B999C9481EEA723000385AEA /* PlistReaderResourceMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B999C9471EEA723000385AEA /* PlistReaderResourceMock.swift */; }; @@ -113,7 +112,6 @@ B99651E61EB8573A0046810D /* RequestMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestMock.swift; sourceTree = ""; }; B99651EB1EB858900046810D /* RequestTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTest.swift; sourceTree = ""; }; B99651ED1EB85AF50046810D /* URLSessionMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLSessionMock.swift; sourceTree = ""; }; - B999C9411EEA66B700385AEA /* PyroAuthInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = PyroAuthInfo.plist; sourceTree = ""; }; B999C9431EEA690600385AEA /* PlistReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlistReader.swift; sourceTree = ""; }; B999C9451EEA71A600385AEA /* PlistReaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlistReaderTest.swift; sourceTree = ""; }; B999C9471EEA723000385AEA /* PlistReaderResourceMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlistReaderResourceMock.swift; sourceTree = ""; }; @@ -175,7 +173,6 @@ children = ( B90D2CD71EB7051500FC0ADD /* Pyrobase.h */, B90D2CD81EB7051500FC0ADD /* Info.plist */, - B999C9411EEA66B700385AEA /* PyroAuthInfo.plist */, B999C9431EEA690600385AEA /* PlistReader.swift */, B939D1451EE53BB900CFDA98 /* PyroAuth.swift */, B951C2F41EEBB2C8004DA16F /* PyroAuthResult.swift */, @@ -317,9 +314,8 @@ TargetAttributes = { B90D2CD31EB7051500FC0ADD = { CreatedOnToolsVersion = 8.0; - DevelopmentTeam = 4WBRGV5Z9M; LastSwiftMigration = 0900; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; B90D2CDC1EB7051500FC0ADD = { CreatedOnToolsVersion = 8.0; @@ -352,7 +348,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - B999C9421EEA66B700385AEA /* PyroAuthInfo.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -562,8 +557,9 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 4WBRGV5Z9M; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -572,6 +568,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ner.Pyrobase; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; @@ -584,8 +581,9 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 4WBRGV5Z9M; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -594,6 +592,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ner.Pyrobase; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; diff --git a/Pyrobase.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Pyrobase.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Pyrobase.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Pyrobase/PyroAuthInfo.plist b/Pyrobase/Plist.bundle/PyroAuthInfo.plist similarity index 100% rename from Pyrobase/PyroAuthInfo.plist rename to Pyrobase/Plist.bundle/PyroAuthInfo.plist diff --git a/Pyrobase/PyroAuth.swift b/Pyrobase/PyroAuth.swift index 9a02239..88e822d 100755 --- a/Pyrobase/PyroAuth.swift +++ b/Pyrobase/PyroAuth.swift @@ -15,15 +15,21 @@ public class PyroAuth { internal var refreshPath: String internal var confirmationCodePath: String - public class func create(key: String, bundleIdentifier: String = "com.ner.Pyrobase", plistName: String = "PyroAuthInfo", request: RequestProtocol = Request.create() ) -> PyroAuth? { - guard let bundle = Bundle(identifier: bundleIdentifier) else { - return nil - } - - guard let reader = PlistReader.create(name: plistName, bundle: bundle) else { - return nil - } + public class func create(key: String, request: RequestProtocol = Request.create() ) -> PyroAuth? { + guard let bundlePath = Bundle(for: PyroAuth.self).path(forResource: "Plist", ofType: "bundle") else { return nil } + guard let bundle = Bundle(path: bundlePath) else { return nil } + guard let reader = PlistReader.create(name: "PyroAuthInfo", bundle: bundle) else { return nil } + return PyroAuth.create(with: key, request: request, reader: reader) + } + + public class func create(key: String, bundleIdentifier: String, plistName: String = "PyroAuthInfo", request: RequestProtocol = Request.create() ) -> PyroAuth? { + guard let bundle = Bundle(identifier: bundleIdentifier) else { return nil } + guard let reader = PlistReader.create(name: plistName, bundle: bundle) else { return nil } + return PyroAuth.create(with: key, request: request, reader: reader) + } + + fileprivate class func create(with key: String, request: RequestProtocol, reader: PlistReader) -> PyroAuth { var registerPath: String = "" var signInPath: String = "" var refreshPath: String = ""