Skip to content

Commit

Permalink
Merge pull request #100 from HAECHI-LABS/borre/remove-wallet-connect-v1
Browse files Browse the repository at this point in the history
chore: Remove wallet connect v1
  • Loading branch information
raspLarry authored Aug 17, 2023
2 parents 04f4132 + ccb3d04 commit 3d16fbe
Show file tree
Hide file tree
Showing 114 changed files with 14,814 additions and 6,371 deletions.
Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
89 changes: 0 additions & 89 deletions Assets/haechi.face.unity.sdk/Plugins/iOS/OverrideAppDelegate.m

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions Assets/haechi.face.unity.sdk/Plugins/iOS/WebAuthenticate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,4 @@
void launch_face_webview(const char *url, const char *redirectUri, const char *objectName) {
[WebAuthenticate launch:[NSString stringWithUTF8String:url] :[NSString stringWithUTF8String:redirectUri] :[NSString stringWithUTF8String:objectName]];
}

void expand_background_time(const char *objectName) {
[WebAuthenticate expand_background_time :[NSString stringWithUTF8String:objectName]];
}

void normalize_background_time() {
[WebAuthenticate normalize_background_time];
}

void pause_unity() {
[WebAuthenticate pause];
}
}
60 changes: 0 additions & 60 deletions Assets/haechi.face.unity.sdk/Plugins/iOS/WebAuthenticate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import UIKit

@objc public class WebAuthenticate: NSObject {
private var unity: UnityFramework? = UnityFramework.getInstance();
private var bgTaskIdentifier: UIBackgroundTaskIdentifier = .invalid
private var foregroundNotificationObserver: Any?
private var backgroundNotificationObserver: Any?

public static let instance = WebAuthenticate();
public static var authSession: ASWebAuthenticationSession? = nil;

Expand All @@ -30,65 +26,9 @@ import UIKit
WebAuthenticate.authSession?.start();
}

@objc public func add_observers(_ objectName: String) {
self.backgroundNotificationObserver = NotificationCenter.default.addObserver(
forName: UIApplication.didEnterBackgroundNotification,
object: nil,
queue: OperationQueue.main
) { [weak self] _ in
self?.requestBackgroundExecutionTime();
}

self.foregroundNotificationObserver = NotificationCenter.default.addObserver(
forName: UIApplication.didBecomeActiveNotification,
object: nil,
queue: OperationQueue.main
) { [weak self] _ in
self?.endBackgroundExecutionTime()
}
}

@objc public func remove_observers() {
if let observer = self.foregroundNotificationObserver {
NotificationCenter.default.removeObserver(observer)
}
if let observer = self.backgroundNotificationObserver {
NotificationCenter.default.removeObserver(observer)
}
}

@objc func requestBackgroundExecutionTime() {
if bgTaskIdentifier != .invalid {
endBackgroundExecutionTime()
}

bgTaskIdentifier = UIApplication.shared.beginBackgroundTask() {
[weak self] in
self?.endBackgroundExecutionTime()
}
}

@objc func endBackgroundExecutionTime() {
guard bgTaskIdentifier != .invalid else { return }
UIApplication.shared.endBackgroundTask(bgTaskIdentifier)
bgTaskIdentifier = .invalid
}

@objc public static func launch(_ url: String,_ redirectUri: String,_ objectName: String) {
instance.call(url, redirectUri, objectName);
}

@objc public static func expand_background_time(_ objectName: String) {
instance.add_observers(objectName);
}

@objc public static func normalize_background_time() {
instance.remove_observers();
}

@objc public static func pause() {
instance.unity?.pause(true);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public class FaceLoginResponse
[JsonProperty("faceUserId")]
public string faceUserId;

/// <value>
/// User verification JWT Token.
/// </value>
[JsonProperty("userVerificationToken")]
public string userVerificationToken;

/// <value>
/// User's wallet info such as unique id, address etc.
/// </value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;
using WalletConnectSharp.Core.Models.Pairing;
using WalletConnectSharp.Sign.Models;
using WalletConnectSharpV1.Core.Models;

namespace haechi.face.unity.sdk.Runtime.Client.WalletConnect
{
Expand All @@ -20,15 +20,6 @@ public class DappMetadata
[JsonProperty("icons")]
public string[] Icons { get; set; }

// TODO: Add 'deprecated' explicitly after 28th, June, 2023.
public DappMetadata(ClientMeta clientMeta)
{
this.Name = clientMeta.Name;
this.Description = clientMeta.Description;
this.Url = clientMeta.URL;
this.Icons = clientMeta.Icons;
}

public DappMetadata(Metadata metadata)
{
this.Name = metadata.Name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using Newtonsoft.Json;
using WalletConnectSharpV1.Core.Models;

namespace haechi.face.unity.sdk.Runtime.Client.WalletConnect
{
Expand All @@ -14,16 +13,13 @@ public class DappSession
[JsonProperty("dapp_url")]
public string DappUrl { get; private set; }

[JsonProperty("saved_session")]
public SavedSession SavedSession { get; private set; }

[JsonConstructor]
public DappSession() {}
public DappSession(string dappName, string dappUrl, SavedSession savedSession)
public DappSession(string dappName, string dappUrl)
{
this.DappName = dappName;
this.DappUrl = dappUrl;
this.SavedSession = savedSession;
}
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3d16fbe

Please sign in to comment.