diff --git a/Editor.meta b/Editor.meta deleted file mode 100644 index 6b5494f..0000000 --- a/Editor.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 66c985194a5444c2a336b60bdb132f74 -timeCreated: 1617120951 \ No newline at end of file diff --git a/Editor/TapLoginIOSProcessor.cs b/Editor/TapLoginIOSProcessor.cs deleted file mode 100644 index 25e1d30..0000000 --- a/Editor/TapLoginIOSProcessor.cs +++ /dev/null @@ -1,24 +0,0 @@ -using TapTap.Common.Editor; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEngine; - -namespace TapTap.Login.Editor -{ - public static class TapLoginIOSProcessor - { - [PostProcessBuild(102)] - public static void OnPostprocessBuild(BuildTarget buildTarget, string path) - { - if (buildTarget != BuildTarget.iOS) return; - - var unityAppControllerPath = path + "/Classes/UnityAppController.mm"; - var unityAppController = new TapFileHelper(unityAppControllerPath); - unityAppController.WriteBelow(@"#import ", @"#import "); - unityAppController.WriteBelow( - @"id sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey], annotation = options[UIApplicationOpenURLOptionsAnnotationKey];", - @"if(url){[TapLoginHelper handleTapTapOpenURL:url];}"); - Debug.Log("TapLogin Change AppControler File!"); - } - } -} \ No newline at end of file diff --git a/Editor/TapLoginIOSProcessor.cs.meta b/Editor/TapLoginIOSProcessor.cs.meta deleted file mode 100644 index 5b770de..0000000 --- a/Editor/TapLoginIOSProcessor.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 50ded018333a4dc8ba19e7806c5bc693 -timeCreated: 1617120951 \ No newline at end of file diff --git a/Editor/TapTap.Login.Editor.asmdef b/Editor/TapTap.Login.Editor.asmdef deleted file mode 100644 index 8d5ef25..0000000 --- a/Editor/TapTap.Login.Editor.asmdef +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "TapTap.Login.Editor", - "references": [ - "TapTap.Common.Editor" - ], - "optionalUnityReferences": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [] -} \ No newline at end of file diff --git a/Editor/TapTap.Login.Editor.asmdef.meta b/Editor/TapTap.Login.Editor.asmdef.meta deleted file mode 100644 index b4da319..0000000 --- a/Editor/TapTap.Login.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a9157d20880b14db485aa407a4532958 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Plugins/iOS/TapLoginDelegate.h b/Plugins/iOS/TapLoginDelegate.h new file mode 100644 index 0000000..78d854e --- /dev/null +++ b/Plugins/iOS/TapLoginDelegate.h @@ -0,0 +1,16 @@ +// +// TapDelegate.h +// Unity-iPhone +// +// Created by xe on 2021/7/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TapLoginDelegate : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Plugins/iOS/TapLoginDelegate.h.meta b/Plugins/iOS/TapLoginDelegate.h.meta new file mode 100644 index 0000000..d08f132 --- /dev/null +++ b/Plugins/iOS/TapLoginDelegate.h.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 1520c63afb87b41f282b202f5313765e +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/iOS/TapLoginDelegate.mm b/Plugins/iOS/TapLoginDelegate.mm new file mode 100644 index 0000000..dff776a --- /dev/null +++ b/Plugins/iOS/TapLoginDelegate.mm @@ -0,0 +1,33 @@ +// +// TapDelegate.m +// Unity-iPhone +// +// Created by xe on 2021/7/14. +// + +#import +#import +#import +#include "AppDelegateListener.h" +#include "LifeCycleListener.h" +#import "TapLoginDelegate.h" +#import + +@implementation TapLoginDelegate + ++(void) load{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken,^{ + + NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; + [nc addObserverForName:kUnityOnOpenURL object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) { + if ([note.userInfo isKindOfClass: [NSMutableDictionary class]]) { + NSURL* url = [note.userInfo objectForKey:@"url"]; + [TapLoginHelper handleTapTapOpenURL:url]; + } + }]; + + }); +} + +@end diff --git a/Plugins/iOS/TapLoginDelegate.mm.meta b/Plugins/iOS/TapLoginDelegate.mm.meta new file mode 100644 index 0000000..d760293 --- /dev/null +++ b/Plugins/iOS/TapLoginDelegate.mm.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: 199b104d5cf2740eca32b1d48f6f59fc +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: