ball 项目提交

This commit is contained in:
2026-04-20 12:06:34 +08:00
parent 4331ebba60
commit 99145facbd
6052 changed files with 576445 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#import <Foundation/Foundation.h>
// 如果 DataEyeSDK 是一个需要被引用的外部库或框架,确保已经正确导入
// #import <DataEyeSDK/DataEyeSDK.h> // 或者使用正确的导入语句
@interface EventMark : NSObject
// 单例实例的类方法
+ (instancetype)sharedEventMark;
// 初始化 DataEyeSDK 的方法(在单例的 init 方法中自动调用,外部无需直接调用)
- (void)initDataEyeSDK;
// 追踪产品购买事件的方法
- (void)trackProduct:(NSString *)eventName dictionaryJson:(NSString *)dictionaryJson ;
@end
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: b8bf5df3187eb9945b7c7cdb6218b7c0
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:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+88
View File
@@ -0,0 +1,88 @@
#import "EventMark.h"
#import <DataEyeSDK.h>
@interface EventMark ()
@property (nonatomic, strong) DataEyeSDK *dataEyeInstance;
@end
@implementation EventMark
// 静态实例变量
static EventMark *sharedInstance = nil;
// 类方法,用于获取单例实例
+ (instancetype)sharedEventMark {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
// 初始化 DataEyeSDK 的方法
- (void)initDataEyeSDK {
NSLog(@"barry initDataEyeSDK-------");
DEConfig *config = [[DEConfig alloc] init];
config.appid = @"13182";
config.configureURL = @"https://laz.flowerlazypower.fun";
config.debugMode = DataEyeDebug;
DataEyeSDK * instance = [DataEyeSDK startWithConfig:config];
NSDictionary *superProperties = @{
@"channel": @"ta",
@"age": @1,
@"isSuccess": @YES,
@"birthday": [NSDate date],
@"object": @{
@"key":@"value"
},
@"object_arr":@[
@{
@"key":@"value"
}
],
@"arr": @[@"value"],
};
[instance setSuperProperties:superProperties];
[instance enableAutoTrack:DataEyeEventTypeAppInstall | DataEyeEventTypeAppStart | DataEyeEventTypeAppEnd];
// NSDictionary *eventProperties = @{@"new_head": @"100"};
// [instance track:@"product_buy" properties:eventProperties];
NSString *device = [instance getDeviceId];
// NSLog(@"barry initDataEyeSDK11-------%@",device);
// [self trackProduct: @"100"];
}
// 追踪产品购买事件的方法
//- (void)trackProduct:(NSString *) data_ {
//
// NSLog(@"barry trackProduct-------%@",data_);
// NSDictionary *eventProperties = data_;
// [self.dataEyeInstance track:@"test_event" properties:eventProperties];
//}
-(void)trackProduct:(NSString *)eventName dictionaryJson:(NSString *)dictionaryJson;
{
// NSLog(@"barry trackProduct eventName=== %@",eventName);
NSError *error;
NSData *data = [dictionaryJson dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSDictionary *eventProperties = dictionary;
[self.dataEyeInstance track:eventName properties:eventProperties];
// 处理接收到的字典
// NSLog(@"barry trackProduct dictionary=== %@", dictionary);
}
@end
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: d9939aac78bf83f48b379bf5f7b23d1f
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:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f428e5b82a4effb46b2630da2e9b0908
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,81 @@
fileFormatVersion: 2
guid: bf523cc64d194963aa7661e7d2944feb
labels:
- gvh
- gvh_version-13.2.0
- gvhp_exportpath-Plugins/iOS/Firebase/libFirebaseCppAnalytics.a
timeCreated: 1480838400
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux:
enabled: 0
settings:
CPU: None
Linux64:
enabled: 0
settings:
CPU: None
LinuxUniversal:
enabled: 0
settings:
CPU: None
OSXIntel:
enabled: 0
settings:
CPU: None
OSXIntel64:
enabled: 0
settings:
CPU: None
OSXUniversal:
enabled: 0
settings:
CPU: None
Web:
enabled: 0
settings: {}
WebStreamed:
enabled: 0
settings: {}
Win:
enabled: 0
settings:
CPU: None
Win64:
enabled: 0
settings:
CPU: None
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
iOS:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
tvOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,81 @@
fileFormatVersion: 2
guid: 601e8e1d2d2744929ede33676cbeccc0
labels:
- gvh
- gvh_version-13.2.0
- gvhp_exportpath-Plugins/iOS/Firebase/libFirebaseCppApp.a
timeCreated: 1480838400
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux:
enabled: 0
settings:
CPU: None
Linux64:
enabled: 0
settings:
CPU: None
LinuxUniversal:
enabled: 0
settings:
CPU: None
OSXIntel:
enabled: 0
settings:
CPU: None
OSXIntel64:
enabled: 0
settings:
CPU: None
OSXUniversal:
enabled: 0
settings:
CPU: None
Web:
enabled: 0
settings: {}
WebStreamed:
enabled: 0
settings: {}
Win:
enabled: 0
settings:
CPU: None
Win64:
enabled: 0
settings:
CPU: None
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
iOS:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
tvOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
+7
View File
@@ -0,0 +1,7 @@
#import <Foundation/Foundation.h>
@interface iOSBridgePlugin : NSObject
+ (void)openURL:(NSString *)url;
+ (void)ShezhiACT:(bool)act;
@end
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 8290c5c98e2884e778baa82e6dc1218d
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:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+125
View File
@@ -0,0 +1,125 @@
#import "iOSBridgePlugin.h"
#import <UIKit/UIKit.h>
#import <EventMark.h>
@implementation iOSBridgePlugin
+ (void)openURL:(NSString *)url1
{
// 使用UIApplication的openURL方法打开外部浏览器
NSURL *url = [NSURL URLWithString:url1];
if (url && [[UIApplication sharedApplication] canOpenURL:url]) {
// 使用iOS 10及以上版本推荐的方法
[[UIApplication sharedApplication] openURL:url
options:@{}
completionHandler:nil];
} else {
// URL无效或无法打开
NSLog(@"Invalid URL or cannot open URL: %@", url1);
}
}
+ (void)ShezhiACT:(bool)act
{
if(act){
UIWindow *keyWindow = nil;
for (UIWindowScene* windowScene in [UIApplication sharedApplication].connectedScenes) {
if (windowScene.activationState == UISceneActivationStateForegroundActive) {
keyWindow = windowScene.windows.firstObject;
break;
}
}
UIView *rootView = keyWindow.rootViewController.view;
for (UIView *subview in rootView.subviews) {
if ([NSStringFromClass([subview class]) isEqualToString:@"WKWebView"]) {
[self enableUserInteractionForView:subview];
}
}
}
else{
UIWindow *keyWindow = nil;
for (UIWindowScene* windowScene in [UIApplication sharedApplication].connectedScenes) {
if (windowScene.activationState == UISceneActivationStateForegroundActive) {
keyWindow = windowScene.windows.firstObject;
break;
}
}
UIView *rootView = keyWindow.rootViewController.view;
for (UIView *subview in rootView.subviews) {
if ([NSStringFromClass([subview class]) isEqualToString:@"WKWebView"]) {
[self disableUserInteractionForView:subview];
}
}
}
}
+ (void)enableUserInteractionForView:(UIView *)view {
view.userInteractionEnabled = YES;
for (UIView *subview in view.subviews) {
[self enableUserInteractionForView:subview];
for (UIGestureRecognizer *gesture in subview.gestureRecognizers) {
if ([gesture isKindOfClass:[UITapGestureRecognizer class]]) {
gesture.enabled = YES; // 禁用手势识别器
}
}
}
}
+ (void)disableUserInteractionForView:(UIView *)view {
view.userInteractionEnabled = NO;
for (UIView *subview in view.subviews) {
[self disableUserInteractionForView:subview]; // 递归禁用所有子视图的交互
for (UIGestureRecognizer *gesture in subview.gestureRecognizers) {
// 仅禁用非 UITapGestureRecognizer 类型的手势识别器
if ([gesture isKindOfClass:[UITapGestureRecognizer class]]) {
gesture.enabled = NO; // 禁用手势识别器
}
}
}
}
// 为了让Unity能够找到这个方法,我们需要提供一个C风格的函数入口点
extern "C"
{
void copyText(const char* text)
{
NSLog(@"copyText----: %s", text);
// 将C风格的字符串转换为NSString,并调用openURL方法
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = [NSString stringWithUTF8String:text];
}
void _openURL(const char* url)
{
// 将C风格的字符串转换为NSString,并调用openURL方法
[iOSBridgePlugin openURL:[NSString stringWithUTF8String:url]];
}
void _dataEyeEvent(const char* dictionaryJson, const char* eventName)
{
// NSLog(@"barry _dataEyeEvent Json== %s", dictionaryJson);
// NSLog(@"barry _dataEyeEvent eventName== %s", eventName);
// 将C风格的字符串转换为NSString
NSString *jsonString = [NSString stringWithUTF8String:dictionaryJson];
NSString *eventNameString = [NSString stringWithUTF8String:eventName];
// // NSLog(@"barry _dataEyeEvent Json== %@", jsonString);
// // NSLog(@"barry _dataEyeEvent eventName== %@", eventNameString);
// // 调用trackProduct方法并传递两个参数
[[EventMark sharedEventMark] trackProduct:eventNameString dictionaryJson:jsonString];
}
}
- (void)initDataEyeSDK
{
}
@end
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 76f4d074d8e774f87ab91846dabcde1d
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:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+23
View File
@@ -0,0 +1,23 @@
extern "C" {
#import "Tower.h"
#import "UnityAppController.h"
#import "iOSBridgePlugin.h"
NSString *stringFromChar(const char *input) {
return [NSString stringWithUTF8String: input];
}
void ShezhiACT(bool act){
[iOSBridgePlugin ShezhiACT:act];
}
void DakaiACT(){
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSLog(@"方法名: openWebview: %@", version);
GetAppController().myTower = [[Tower alloc] init];
[GetAppController().myTower i: GetAppController().rootView];
[GetAppController().myTower set:version];
[GetAppController().myTower getData];
[GetAppController().myTower get5ac];
}
}
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 39943910fcb56434382c48985fcd904b
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:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant: