Skip to content

Commit 5e32764

Browse files
authored
Merge pull request #30 from inplayer-org/develop
1.4.0
2 parents 3866731 + f9433a0 commit 5e32764

File tree

124 files changed

+1081
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1081
-555
lines changed

Example/Example.xcodeproj/project.pbxproj

+2-13
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,11 @@
272272
files = (
273273
);
274274
inputFileListPaths = (
275-
);
276-
inputPaths = (
277-
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh",
278-
"${BUILT_PRODUCTS_DIR}/AWSCore/AWSCore.framework",
279-
"${BUILT_PRODUCTS_DIR}/AWSIoT/AWSIoT.framework",
280-
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
281-
"${BUILT_PRODUCTS_DIR}/InPlayerSDK/InPlayerSDK.framework",
275+
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
282276
);
283277
name = "[CP] Embed Pods Frameworks";
284278
outputFileListPaths = (
285-
);
286-
outputPaths = (
287-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework",
288-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSIoT.framework",
289-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
290-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/InPlayerSDK.framework",
279+
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
291280
);
292281
runOnlyForDeploymentPostprocessing = 0;
293282
shellPath = /bin/sh;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1030"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "A718C05021CED043004D7EF7"
18+
BuildableName = "Example.app"
19+
BlueprintName = "Example"
20+
ReferencedContainer = "container:Example.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "A718C05021CED043004D7EF7"
36+
BuildableName = "Example.app"
37+
BlueprintName = "Example"
38+
ReferencedContainer = "container:Example.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "A718C05021CED043004D7EF7"
59+
BuildableName = "Example.app"
60+
BlueprintName = "Example"
61+
ReferencedContainer = "container:Example.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "A718C05021CED043004D7EF7"
78+
BuildableName = "Example.app"
79+
BlueprintName = "Example"
80+
ReferencedContainer = "container:Example.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>

Example/Example/AppDelegate.swift

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1717

1818
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
1919
InPlayer.Account.validateSocialLogin(url: url)
20-
2120
return true
2221
}
2322
}

Example/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ platform :ios, '10.0'
33
target 'Example' do
44
use_frameworks!
55

6-
pod 'InPlayerSDK', '1.3.0'
6+
pod 'InPlayerSDK', :path => '../'
77

88
target 'ExampleTests' do
99
inherit! :search_paths

InPlayerSDK.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "InPlayerSDK"
19-
s.version = "1.3.0"
19+
s.version = "1.4.0"
2020
s.summary = "InPlayer's iOS API client wrapper."
2121

2222
# This description is used to generate tags and improve search results.

Source/Core/API/Account/INPAccountService.swift

+33-1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,24 @@ class INPAccountService {
232232
}
233233
}
234234
}
235+
236+
static func sendPinCode(brandingId: Int?, completion: @escaping RequestCompletion<Empty>) {
237+
var params: [String: Any] = [:]
238+
if let brandingID = brandingId {
239+
params[AccountParameters.brandingID] = brandingID
240+
}
241+
242+
NetworkDataSource.performRequest(session: InPlayerSessionAPIManager.default.session,
243+
route: AccountAPIRouter.getSocialURLs(parameters: params),
244+
completion: completion)
245+
}
246+
247+
static func validatePinCode(_ pinCode: String, completion: @escaping RequestCompletion<Empty>) {
248+
let params = [AccountParameters.pinCode: pinCode]
249+
NetworkDataSource.performRequest(session: InPlayerSessionAPIManager.default.session,
250+
route: AccountAPIRouter.validatePinCode(parameters: params),
251+
completion: completion)
252+
}
235253
}
236254

237255
private extension INPAccountService {
@@ -298,6 +316,8 @@ private struct AccountParameters {
298316
static let clientSecret = "client_secret"
299317
static let state = "state"
300318
static let redirect = "redirect"
319+
static let pinCode = "pin_code"
320+
static let brandingID = "branding_id"
301321
}
302322

303323
private enum AuthenticationTypes: String {
@@ -322,6 +342,8 @@ private enum AccountAPIRouter: INPAPIConfiguration {
322342
case exportData(parameters: [String: Any])
323343
case getRegisterFields(merchantUUID: String)
324344
case getSocialURLs(parameters: [String: Any])
345+
case sendPinCode(parameters: [String: Any])
346+
case validatePinCode(parameters: [String: Any])
325347

326348
var method: HTTPMethod {
327349
switch self {
@@ -331,7 +353,9 @@ private enum AccountAPIRouter: INPAPIConfiguration {
331353
.authenticate,
332354
.refreshToken,
333355
.authenticateClientCredentials,
334-
.exportData:
356+
.exportData,
357+
.sendPinCode,
358+
.validatePinCode:
335359
return .post
336360
case .updateAccount, .setNewPassword:
337361
return .put
@@ -368,6 +392,10 @@ private enum AccountAPIRouter: INPAPIConfiguration {
368392
return String(format: NetworkConstants.Endpoints.Account.registerFields, merchantUUID)
369393
case .getSocialURLs:
370394
return NetworkConstants.Endpoints.Account.getSocialUrls
395+
case .sendPinCode:
396+
return NetworkConstants.Endpoints.Account.sendPinCode
397+
case .validatePinCode:
398+
return NetworkConstants.Endpoints.Account.validatePinCode
371399
}
372400

373401
}
@@ -396,6 +424,10 @@ private enum AccountAPIRouter: INPAPIConfiguration {
396424
return parameters
397425
case .getSocialURLs(let parameters):
398426
return parameters
427+
case .sendPinCode(let parameters):
428+
return parameters
429+
case .validatePinCode(let parameters):
430+
return parameters
399431
default:
400432
return nil
401433
}

Source/Core/API/NetworkConstants.swift

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ struct NetworkConstants {
3232
static let exportData = "/accounts/export"
3333
static let registerFields = "/accounts/register-fields/%@"
3434
static let getSocialUrls = "/accounts/social"
35+
static let sendPinCode = "/v2/accounts/pin-codes/send"
36+
static let validatePinCode = "/v2/accounts/pin-codes/validate"
3537
}
3638

3739
struct Asset {

0 commit comments

Comments
 (0)