Skip to content

Commit

Permalink
Update Argyle 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gingyle committed Oct 2, 2019
1 parent aee08fd commit 08c47d1
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 45 deletions.
Binary file modified .DS_Store
Binary file not shown.
14 changes: 12 additions & 2 deletions ArgyleExample/ArgyleExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
8514C1CA2313E9B300E558F0 /* Sources */,
8514C1CB2313E9B300E558F0 /* Frameworks */,
8514C1CC2313E9B300E558F0 /* Resources */,
345174E0563224BC2F19C384 /* [CP] Embed Pods Frameworks */,
7C646CE623582C76AB02D3AA /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -157,7 +157,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
345174E0563224BC2F19C384 /* [CP] Embed Pods Frameworks */ = {
7C646CE623582C76AB02D3AA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -352,6 +352,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ArgyleExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -370,6 +375,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = ArgyleExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
13 changes: 6 additions & 7 deletions ArgyleExample/ArgyleExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -23,15 +21,15 @@
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="New worker"/>
<connections>
<action selector="argyleNewWorker:" destination="BYZ-38-t0r" eventType="touchUpInside" id="e0U-sh-NXd"/>
<action selector="argyleNewUser:" destination="BYZ-38-t0r" eventType="touchUpInside" id="bVU-n8-xlG"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FEz-sp-V2g">
<rect key="frame" x="141" y="458" width="132" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="Existing worker"/>
<connections>
<action selector="argyleExistingWorker:" destination="BYZ-38-t0r" eventType="touchUpInside" id="MjR-MJ-6tY"/>
<action selector="argyleExistingUser:" destination="BYZ-38-t0r" eventType="touchUpInside" id="CM9-9c-dJV"/>
</connections>
</button>
</subviews>
Expand All @@ -47,6 +45,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="132" y="94"/>
</scene>
</scenes>
</document>
37 changes: 19 additions & 18 deletions ArgyleExample/ArgyleExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,34 @@ import Argyle

class ViewController: UIViewController {

let EXISTING_WORKER_TOKEN_KEY = "EXISTING_EORKER_TOKEN_KEY"
let EXISTING_USER_TOKEN_KEY = "EXISTING_USER_TOKEN_KEY"

override func viewDidLoad() {
super.viewDidLoad()
_ = Argyle.shared
.loginWith(pluginKey: "646dc138-5942-4eb6-a9ca-dd01b6d57ae9", apiHost: "https://api-sandbox.develop.argyle.io/v1")
.loginWith(pluginKey: "6d77b75b-116f-466c-b5fe-08094bb419d3", apiHost: "https://api-sandbox.develop.argyle.io/v1")
// .dataPartners(["amazon_flex", "uber"])
.resultListener(self)
}

@IBAction func argyleNewWorker(_ sender: Any) {
self.present(Argyle.shared.updateToken("").controller, animated: true, completion: nil)
@IBAction func argyleNewUser(_ sender: Any) {
let argyle = Argyle.shared.updateToken("").controller
argyle.modalPresentationStyle = .fullScreen
self.present(argyle, animated: true, completion: nil)
}

@IBAction func argyleExistingWorker(_ sender: Any) {
if let token = UserDefaults.standard.value(forKey: EXISTING_WORKER_TOKEN_KEY) as? String {
_ = Argyle.shared.updateToken(token)
self.present(Argyle.shared.controller, animated: true, completion: nil)
@IBAction func argyleExistingUser(_ sender: Any) {
if let token = UserDefaults.standard.value(forKey: EXISTING_USER_TOKEN_KEY) as? String {
let argyle = Argyle.shared.updateToken(token).controller
argyle.modalPresentationStyle = .fullScreen
self.present(argyle, animated: true, completion: nil)
} else {
showNoExistingToken()
}
}

func showNoExistingToken() {
let alert = UIAlertController(title: "Error!", message: "No stored worker token found.", preferredStyle: .alert)
let alert = UIAlertController(title: "Error!", message: "No stored user token found.", preferredStyle: .alert)

alert.addAction(UIAlertAction(title: "OK", style: .cancel , handler:{ (UIAlertAction)in

Expand All @@ -54,17 +57,17 @@ class ViewController: UIViewController {

extension ViewController: ArgyleResultListener {

func onAccountConnected(accountId: String, workerId: String) {
print("APP: onAccountConnected(accountId: \(accountId), workerId: \(workerId))")
func onAccountConnected(accountId: String, userId: String) {
print("APP: onAccountConnected(accountId: \(accountId), userId: \(userId))")
}

func onAccountRemoved(accountId: String, workerId: String) {
print("APP: onAccountRemoved(accountId: \(accountId), workerId: \(workerId))")
func onAccountRemoved(accountId: String, userId: String) {
print("APP: onAccountRemoved(accountId: \(accountId), userId: \(userId))")
}

func onWorkerCreated(token: String, workerId: String) {
print("APP: onWorkerCreated((token: \(token), workerId: \(workerId))")
UserDefaults.standard.set(token, forKey: EXISTING_WORKER_TOKEN_KEY)
func onUserCreated(token: String, userId: String) {
print("APP: onWorkerCreated((token: \(token), userId: \(userId))")
UserDefaults.standard.set(token, forKey: EXISTING_USER_TOKEN_KEY)
}

func onError(error: ArgyleErrorType) {
Expand All @@ -76,5 +79,3 @@ extension ViewController: ArgyleResultListener {
}

}


4 changes: 2 additions & 2 deletions ArgyleExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Argyle (1.1.3)
- Argyle (1.1.4)

DEPENDENCIES:
- Argyle
Expand All @@ -9,7 +9,7 @@ SPEC REPOS:
- Argyle

SPEC CHECKSUMS:
Argyle: 0b95ddbf06f257d094e0ae45ea66642050bebf07
Argyle: fde9e859e37871130407b35dcebce706622b7577

PODFILE CHECKSUM: 62fcb9df821642eb8f4da5f4ccda9d9a6f73330d

Expand Down
Binary file modified ArgyleExample/Pods/Argyle/Argyle.framework/Argyle
Binary file not shown.
Binary file modified ArgyleExample/Pods/Argyle/Argyle.framework/Assets.car
Binary file not shown.
27 changes: 21 additions & 6 deletions ArgyleExample/Pods/Argyle/Argyle.framework/Headers/Argyle-Swift.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ArgyleExample/Pods/Argyle/Argyle.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions ArgyleExample/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ArgyleExample/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,40 @@ pod 'Argyle'
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Argyle into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "argyle-systems/Argyle_iOS" == 1.1.3
github "argyle-systems/Argyle_iOS" == 1.1.4
```

## Getting started


### 1. Configurate the SDK Configuration

Login to SDK using your `pluginKey`, along with the `apiHost`, and `workerToken` (optional).
Login to SDK using your `pluginKey`, along with the `apiHost`, and `userToken` (optional).

Provide `ArgyleResultListener` delegate to handle SDK callbacks.

Swift

``` swift
_ = Argyle.shared
.loginWith(pluginKey: yourPluginKey, apiHost: apiHost, workerToken: token)
.loginWith(pluginKey: yourPluginKey, apiHost: apiHost, userToken: token)
.resultListener(self)
```

Argyle SDK callbacks:

``` swift
func onAccountConnected(accountId: String, workerId: String)
func onAccountConnected(accountId: String, userId: String)
```
A callback function invoked when user connects a new account. The function will be passed an object containing `accountId` and `userId`.

``` swift
func onAccountRemoved(accountId: String, workerId: String)
func onAccountRemoved(accountId: String, userId: String)
```
A callback function invoked when user removes a connected account. The function will be passed an object containing `accountId` and `userId`.

``` swift
func onWorkerCreated(token: String, workerId: String)
func onUserCreated(token: String, userId: String)
```
A callback function invoked when a new user is created. The function will be passed an object containing `userId` and `userToken`. User is created on the first attempt of a new user to connect an account.

Expand Down

0 comments on commit 08c47d1

Please sign in to comment.