Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
L
liberty-tunnel-client-library-apple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liberty
tunnel
liberty-tunnel-client-library-apple
Commits
2040e188
Commit
2040e188
authored
Dec 03, 2020
by
Jose Blaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update library for Account module 1.1.0
parent
66e56ded
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
14 deletions
+23
-14
PIALibrary/Sources/Core/Account/AccountProvider.swift
PIALibrary/Sources/Core/Account/AccountProvider.swift
+2
-1
PIALibrary/Sources/Core/WebServices/InAppMessage.swift
PIALibrary/Sources/Core/WebServices/InAppMessage.swift
+1
-1
PIALibrary/Sources/Core/WebServices/WebServices.swift
PIALibrary/Sources/Core/WebServices/WebServices.swift
+1
-1
PIALibrary/Sources/Library/Account/DefaultAccountProvider.swift
...rary/Sources/Library/Account/DefaultAccountProvider.swift
+2
-2
PIALibrary/Sources/Library/WebServices/PIAWebServices.swift
PIALibrary/Sources/Library/WebServices/PIAWebServices.swift
+2
-2
PIALibrary/Sources/Mock/MockAccountProvider.swift
PIALibrary/Sources/Mock/MockAccountProvider.swift
+2
-2
PIALibrary/Sources/Mock/MockWebServices.swift
PIALibrary/Sources/Mock/MockWebServices.swift
+1
-1
PIALibrary/Sources/UI/iOS/Macros+UI.swift
PIALibrary/Sources/UI/iOS/Macros+UI.swift
+11
-3
PIALibrary/Sources/UI/iOS/ViewControllers/PIAWelcomeViewController.swift
...ces/UI/iOS/ViewControllers/PIAWelcomeViewController.swift
+1
-1
No files found.
PIALibrary/Sources/Core/Account/AccountProvider.swift
View file @
2040e188
...
...
@@ -147,9 +147,10 @@ public protocol AccountProvider: class {
/**
Returns the available messages from the API.
- Parameter version: App version.
- Parameter callback: Returns the message`InAppMessage` on success.
*/
func
inAppMessages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
func
inAppMessages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
#if os(iOS)
/**
...
...
PIALibrary/Sources/Core/WebServices/InAppMessage.swift
View file @
2040e188
...
...
@@ -78,7 +78,7 @@ extension InAppMessage {
self
.
settingAction
=
actions
self
.
settingLink
=
nil
self
.
settingView
=
nil
}
else
if
!
link
.
action
.
uri
.
isEmpty
{
}
else
if
let
uri
=
link
.
action
.
uri
,
!
uri
.
isEmpty
{
self
.
type
=
.
link
self
.
settingLink
=
link
.
action
.
uri
self
.
settingAction
=
nil
...
...
PIALibrary/Sources/Core/WebServices/WebServices.swift
View file @
2040e188
...
...
@@ -74,5 +74,5 @@ protocol WebServices: class {
// MARK: Messages
func
messages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
func
messages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
}
PIALibrary/Sources/Library/Account/DefaultAccountProvider.swift
View file @
2040e188
...
...
@@ -330,8 +330,8 @@ class DefaultAccountProvider: AccountProvider, ConfigurationAccess, DatabaseAcce
}
}
func
inAppMessages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
webServices
.
messages
{
(
message
,
error
)
in
func
inAppMessages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
webServices
.
messages
(
forAppVersion
:
version
)
{
(
message
,
error
)
in
callback
?(
message
,
error
)
}
}
...
...
PIALibrary/Sources/Library/WebServices/PIAWebServices.swift
View file @
2040e188
...
...
@@ -434,11 +434,11 @@ class PIAWebServices: WebServices, ConfigurationAccess {
}
// MARK: Messages
func
messages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
func
messages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
if
let
token
=
Client
.
providers
.
accountProvider
.
token
{
self
.
accountAPI
.
message
(
token
:
token
,
callback
:
{
(
message
,
error
)
in
self
.
accountAPI
.
message
(
token
:
token
,
appVersion
:
version
,
callback
:
{
(
message
,
error
)
in
if
let
error
=
error
{
callback
?(
nil
,
ClientError
.
malformedResponseData
)
...
...
PIALibrary/Sources/Mock/MockAccountProvider.swift
View file @
2040e188
...
...
@@ -310,8 +310,8 @@ public class MockAccountProvider: AccountProvider, WebServicesConsumer {
callback
?(
nil
)
}
public
func
inAppMessages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
delegate
.
inAppMessages
{
(
message
,
error
)
in
public
func
inAppMessages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
delegate
.
inAppMessages
(
forAppVersion
:
version
)
{
(
message
,
error
)
in
callback
?(
message
,
error
)
}
}
...
...
PIALibrary/Sources/Mock/MockWebServices.swift
View file @
2040e188
...
...
@@ -137,7 +137,7 @@ class MockWebServices: WebServices {
callback
?([
"mock-test"
],
nil
)
}
func
messages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
func
messages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
let
testLink
=
InAppMessage
(
withMessage
:
[
"en"
:
"This is a message"
],
id
:
"1"
,
link
:
[
"en"
:
"message"
],
type
:
.
link
,
level
:
.
api
,
actions
:
nil
,
view
:
nil
,
uri
:
"https://www.privateinternetaccess.com"
)
callback
?(
testLink
,
nil
)
...
...
PIALibrary/Sources/UI/iOS/Macros+UI.swift
View file @
2040e188
...
...
@@ -119,9 +119,6 @@ extension Macros {
/**
Returns a localized full version string.
- Parameter format: A localized format string with two `String` parameters:
- The first one is replaced with the x.y.z version
- The second one is replaced with the build number
- Returns: A localized full version string built upon the input `format`
*/
public
static
func
localizedVersionFullString
()
->
String
?
{
...
...
@@ -132,6 +129,17 @@ extension Macros {
let
buildNumber
=
info
[
kCFBundleVersionKey
as
String
]
as!
String
return
L10n
.
Ui
.
Global
.
Version
.
format
(
versionNumber
,
buildNumber
)
}
/**
Returns a localized version number string. Example "3.9.0"
*/
public
static
func
localizedVersionNumber
()
->
String
{
guard
let
info
=
Bundle
.
main
.
infoDictionary
else
{
return
""
}
let
versionNumber
=
info
[
"CFBundleShortVersionString"
]
as!
String
return
versionNumber
}
/**
Shortcut to create a `PopupDialog`.
...
...
PIALibrary/Sources/UI/iOS/ViewControllers/PIAWelcomeViewController.swift
View file @
2040e188
...
...
@@ -434,7 +434,7 @@ class EphemeralAccountProvider: AccountProvider, ProvidersAccess, InAppAccess {
callback
?(
nil
)
}
func
inAppMessages
(
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
func
inAppMessages
(
forAppVersion
version
:
String
,
_
callback
:
LibraryCallback
<
InAppMessage
>
?)
{
callback
?(
nil
,
nil
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment