first commit
This commit is contained in:
commit
f7ba6aa346
58
.gitignore
vendored
Normal file
58
.gitignore
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# ignore common tempfiles
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Folder view configuration files
|
||||||
|
.DS_Store
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Thumbnail cache files
|
||||||
|
._*
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Files that might appear on external disks
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
# Xcode ingores
|
||||||
|
build/
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata/
|
||||||
|
*.xccheckout
|
||||||
|
profile
|
||||||
|
*.moved-aside
|
||||||
|
DerivedData
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
|
||||||
|
# Carthage ignores
|
||||||
|
# binaries
|
||||||
|
**/Carthage/Build/
|
||||||
|
# external sources
|
||||||
|
**/Carthage/Checkouts/
|
||||||
|
# XCFramework binaries
|
||||||
|
**/XCFramework/
|
||||||
|
|
||||||
|
# gradle ignores
|
||||||
|
.gradle/
|
||||||
|
# eclipse related
|
||||||
|
.settings/
|
||||||
|
.project
|
||||||
|
|
||||||
|
# local ignores
|
||||||
|
repo/
|
||||||
|
|
||||||
|
# SPM ignores
|
||||||
|
**/Package.resolved
|
||||||
|
|
||||||
|
|
||||||
|
# Ignore credentials
|
||||||
|
**/Credentials.swift
|
||||||
|
|
||||||
|
# end of file
|
1
LICENSE.txt
Normal file
1
LICENSE.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Copyright (C) 2013 - 2024 WebID Solutions GmbH | www.webid-solutions.de. All Rights Reserved
|
54
README.md
Normal file
54
README.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# MetaPlugin Demo iOS
|
||||||
|
|
||||||
|
This project is a small example for how to implement the WebID Meta-Plugin.
|
||||||
|
The code of the used project is described with several comments on how to implement.
|
||||||
|
|
||||||
|
## Tutorial
|
||||||
|
|
||||||
|
Generate `Credentials.swift` file
|
||||||
|
```bash
|
||||||
|
./init.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
To start the plugin inside this demo project, open the Credentials.swift file.
|
||||||
|
You will find a class.</br>
|
||||||
|
You should have been supplied with a username and an api-key for your environment.
|
||||||
|
Replace the placeholders in the Credentials class.</br>
|
||||||
|
|
||||||
|
|
||||||
|
In order to run a video-ident process, you will need to create it first outside of the app.
|
||||||
|
From the process creation request to the server, you should have received an action-id, consisting of 9 numbers.
|
||||||
|
Insert this number in the Credentials class, by replacing the placeholder string with the action-id as a string.</br>
|
||||||
|
|
||||||
|
After that, start the demo app on an iOS device.</br>
|
||||||
|
Press the main button on the Main screen to start the plugin during runtime.
|
||||||
|
|
||||||
|
|
||||||
|
## Fastened Tutorial
|
||||||
|
|
||||||
|
<ol>
|
||||||
|
<li>Replace placeholder strings in Credentials.swift</li>
|
||||||
|
<li>Create process via mobile api</li>
|
||||||
|
<li>Replace placeholder string of action-id with action-id from process-creation response</li>
|
||||||
|
<li>Start plugin</li>
|
||||||
|
<li>Click main button of the Main Screen to start the plugin</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
|
||||||
|
## Theming (Optional)
|
||||||
|
|
||||||
|
The implemented version of the plugin in this project supports customized theming.</br>
|
||||||
|
To implement or experiment with different themes, navigate to the file CustomizedPluginTheme.swift and change the return value of the getLightVersion method.</br>
|
||||||
|
E.G.
|
||||||
|
|
||||||
|
```
|
||||||
|
internal static func getLightVersion() -> WebidAppTheme {
|
||||||
|
WebidAppTheme(
|
||||||
|
Background: UIColor.blue,
|
||||||
|
PrimaryColor: UI.Color.cyan
|
||||||
|
)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Consult the theming guide to see what items can be manipulated.</br>
|
||||||
|
To change the Dark mode theming, change the getDarkVersion() method as well.
|
49
init.sh
Executable file
49
init.sh
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
#set -euxo pipefail
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
#
|
||||||
|
# EXIT CODES
|
||||||
|
############
|
||||||
|
DEFAULT_REQ_TOOL_EXIT_CODE=1
|
||||||
|
DEFAULT_ARG_ERROR_EXIT_CODE=2
|
||||||
|
DEFAULT_MAIN_ERROR_EXIT_CODE=10
|
||||||
|
|
||||||
|
# Define the file path
|
||||||
|
FILE_PATH="${BASH_SOURCE%/*}/MetaPluginDemo/Credentials.swift"
|
||||||
|
|
||||||
|
# remove filename
|
||||||
|
TARGET_DIRECTORY="${FILE_PATH%/*}"
|
||||||
|
|
||||||
|
mkdir -p "$TARGET_DIRECTORY"
|
||||||
|
|
||||||
|
# Check if the file does not exist
|
||||||
|
if [[ ! -f $FILE_PATH ]]; then
|
||||||
|
# The file does not exist, create it with the specified content using a here document
|
||||||
|
cat << 'EOF' > "$FILE_PATH"
|
||||||
|
/*
|
||||||
|
* Created by WebID Solutions GmbH | www.webid-solutions.de.
|
||||||
|
* See the file "LICENSE" for the full license governing this code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
class Credentials {
|
||||||
|
|
||||||
|
static let demoUsernameTest: String = "your demo user name for test"
|
||||||
|
static let demoApiKeyTest: String = "your demo api key for test"
|
||||||
|
|
||||||
|
static let demoUsernameProduction: String = "your demo user name for production"
|
||||||
|
static let demoApiKeyProduction: String = "your demo api key for production"
|
||||||
|
|
||||||
|
static let actionId: String = "your action-id here"
|
||||||
|
|
||||||
|
static let environment : EWebIDEnv.WebIDEnv = EWebIDEnv.TEST
|
||||||
|
}
|
||||||
|
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
echo "The file already exists."
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user