Skip to content

Commit

Permalink
Merge pull request #4 from wildlink/deviceIdUInt64
Browse files Browse the repository at this point in the history
DeviceID is a UInt64
  • Loading branch information
kylekurz authored Nov 26, 2019
2 parents 8627d1d + 863a1dc commit 23f51ca
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Alamofire (4.8.2)
- Wildlink (1.0.5):
- Wildlink (1.0.6):
- Alamofire (~> 4.8.2)
- Wildlink/Tests (1.0.5):
- Wildlink/Tests (1.0.6):
- Alamofire (~> 4.8.2)

DEPENDENCIES:
- Wildlink (from `../`)
- Wildlink/Tests (from `../`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
trunk:
- Alamofire

EXTERNAL SOURCES:
Expand All @@ -19,8 +19,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
Wildlink: 068f19c459aa8d5780c684ab08de1a2bf091ee35
Wildlink: 1698c8bde239ea342722aa7633b851354e3f530f

PODFILE CHECKSUM: ebc74e7f624558182cd7f10e0ae346ced9843b6a

COCOAPODS: 1.7.4
COCOAPODS: 1.8.4
2 changes: 1 addition & 1 deletion Example/Wildlink/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extension AppDelegate : WildlinkDelegate {
defaults.set(deviceToken, forKey: "wildlinkDeviceToken")
}

func didReceive(deviceId: String) {
func didReceive(deviceId: UInt64) {
let defaults = UserDefaults.standard
defaults.set(deviceId, forKey: "wildlinkDeviceId")
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ platform:ios, '10.0'


target 'Wildlink_Example' do
pod 'Wildlink', '~> 1.0.5'
pod 'Wildlink', '~> 1.0.6'
end
```

Expand Down Expand Up @@ -100,7 +100,7 @@ extension AppDelegate : WildlinkDelegate {
defaults.set(deviceToken, forKey: "wildlinkDeviceToken")
}

func didReceive(deviceId: String) {
func didReceive(deviceId: UInt64) {
let defaults = UserDefaults.standard
defaults.set(deviceId, forKey: "wildlinkDeviceId")
}
Expand Down
2 changes: 1 addition & 1 deletion Wildlink.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Wildlink'
s.version = '1.0.5'
s.version = '1.0.6'
s.summary = 'You can use this CocoaPod to interact with the Wildlink API'

s.homepage = 'https://wildlink.me'
Expand Down
10 changes: 5 additions & 5 deletions Wildlink/Classes/Wildlink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protocol JSONSerializable {
public protocol WildlinkDelegate : class {
func didReceive(deviceToken: String)
func didReceive(deviceKey: String)
func didReceive(deviceId: String)
func didReceive(deviceId: UInt64)
}

// List of possible Error cases from the Wildlink SDK.
Expand Down Expand Up @@ -54,7 +54,7 @@ public enum WildlinkSortOrder: String {
public class Wildlink: RequestAdapter, RequestRetrier {

//private variables/methods
private typealias RefreshCompletion = (_ succeeded: Bool, _ deviceToken: String?, _ deviceKey: String?, _ deviceId: String?) -> Void
private typealias RefreshCompletion = (_ succeeded: Bool, _ deviceToken: String?, _ deviceKey: String?, _ deviceId: UInt64?) -> Void

private let sessionManager: SessionManager = {
let configuration = URLSessionConfiguration.default
Expand All @@ -67,7 +67,7 @@ public class Wildlink: RequestAdapter, RequestRetrier {
private var baseUrl: URL
private var deviceToken = ""
private var deviceKey: String?
private var deviceId: String?
private var deviceId: UInt64?
private var senderToken = ""
static var apiKey = ""
static var appID = ""
Expand Down Expand Up @@ -454,7 +454,7 @@ public class Wildlink: RequestAdapter, RequestRetrier {
if let json = value as? [String: Any],
let deviceToken = json["DeviceToken"] as? String {
let deviceKey = json["DeviceKey"] as? String
let deviceId = json["DeviceID"] as? String
let deviceId = json["DeviceID"] as? UInt64
completion(true, deviceToken, deviceKey, deviceId)
} else {
Logger.error("Failed to refresh device token: \(String(describing: response.result))")
Expand Down Expand Up @@ -497,7 +497,7 @@ public class Wildlink: RequestAdapter, RequestRetrier {
// Helper function to store an updated device identifier in memory and tell the delegate about it (if set)
//
// - parameter id: The new device ID
func update(id: String) {
func update(id: UInt64) {
self.deviceId = id
Wildlink.shared.delegate?.didReceive(deviceId: id)
}
Expand Down

0 comments on commit 23f51ca

Please sign in to comment.