Skip to content

Commit

Permalink
456
Browse files Browse the repository at this point in the history
  • Loading branch information
pchonat committed Aug 14, 2020
1 parent 9521b7f commit 827093c
Show file tree
Hide file tree
Showing 24 changed files with 89 additions and 48 deletions.
1 change: 1 addition & 0 deletions TestProject/Assets/Plugins/IOS/AdjustHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ -(void)InitSDK:(id<cDelegate>)Delegate{
IOSBridgeHelper = Delegate;
//点击游戏图标,启动游戏后,触发该事件 //ad启动统计
[self commonEvent:@"4pvqgy"];
NSLog(@"--AppleHelper---InitSDK---");
}
-(void)Event:(const char*) jsonString{
NSString *evnetToken = [NSString stringWithUTF8String:jsonString];
Expand Down
9 changes: 1 addition & 8 deletions TestProject/Assets/Plugins/IOS/AppleHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ -(void)InitSDK:(id<cDelegate>) delegate{
forService = [NSBundle mainBundle].bundleIdentifier;
userIdentifier = @"nil";

NSLog(@"-ios---AppleHelper---InitSDK---bundleID-%@",forService);
if (@available(iOS 13.0, *)) {
[IOSBridgeHelper InitSDKCallBack:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"1", @"state",nil]];
}else{
//此处返回不能为0 因为0代表失败 之前逻辑为初始化失败会重新初始化
[IOSBridgeHelper InitSDKCallBack:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"2", @"state",nil]];
}

NSLog(@"--AppleHelper---InitSDK---");
}
//******************************************************
//****************Apple Sign In With Apple
Expand Down
2 changes: 1 addition & 1 deletion TestProject/Assets/Plugins/IOS/ElvaHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ -(void)InitSDK:(id)delegate{
// [ECServiceSdk setSDKLanguage:@"zh_TW"];
// [ECServiceSdk setSDKLanguage:@"zh_en"];
// [ECServiceSdk setSDKLanguage:@"zh_CN"];

NSLog(@"--ElvaHelper---InitSDK---");
}
#pragma mark --入口
-(void)show:(const char*) jsonString{
Expand Down
2 changes: 1 addition & 1 deletion TestProject/Assets/Plugins/IOS/GoogleHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
#import "cDelegate.h"

@interface GoogleHelper:UIViewController<UIApplicationDelegate,GIDSignInDelegate>
@interface GoogleHelper:UIViewController<GIDSignInDelegate>
//@property (nonatomic, weak) id<cDelegate> CbDelegate;
+(id)sharedInstance;
-(void)InitSDK:(id<cDelegate>)Delegate;
Expand Down
32 changes: 16 additions & 16 deletions TestProject/Assets/Plugins/IOS/GoogleHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ @implementation GoogleHelper{
+(GoogleHelper*)sharedInstance{
if (GoogleHelperIns == nil) {
if (self == [GoogleHelper class]) {
GoogleHelperIns = [[self alloc] init];
GoogleHelperIns = [GoogleHelper new];
}
}
return GoogleHelperIns;
}
-(void)InitSDK:(id<cDelegate>)delegate{
NSLog(@"---GoogleHelper Init---");
IOSBridgeHelper = delegate;
[GIDSignIn sharedInstance].clientID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"GoogleClientID"];
[GIDSignIn sharedInstance].clientID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"GoogleClientID"];
[GIDSignIn sharedInstance].delegate = self;
[GIDSignIn sharedInstance].shouldFetchBasicProfile = YES;
[GIDSignIn sharedInstance].presentingViewController = [[[UIApplication sharedApplication] delegate] window].rootViewController;
NSLog(@"---GoogleHelper InitSDK---");
}
- (void)Login {
NSLog(@"---GoogleHelper Login---");
Expand Down Expand Up @@ -72,18 +72,18 @@ - (void)signIn:(GIDSignIn *)signIn didDisconnectWithUser:(GIDGoogleUser *)user w
// Perform any operations when the user disconnects from app here.
// ...
}
//iOS 8 以上
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<NSString *, id> *)options {
return [[GIDSignIn sharedInstance] handleURL:url];
}
//iOS 8 以下
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [[GIDSignIn sharedInstance] handleURL:url];
}
////iOS 8 以上
//- (BOOL)application:(UIApplication *)app
// openURL:(NSURL *)url
// options:(NSDictionary<NSString *, id> *)options {
// return [[GIDSignIn sharedInstance] handleURL:url];
//}
////iOS 8 以下
//- (BOOL)application:(UIApplication *)application
// openURL:(NSURL *)url
// sourceApplication:(NSString *)sourceApplication
// annotation:(id)annotation {
// return [[GIDSignIn sharedInstance] handleURL:url];
//}

@end
36 changes: 30 additions & 6 deletions TestProject/Assets/Plugins/IOS/IOSBridgeHelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// NSString *environment = ADJEnvironmentProduction;
ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment];
[adjustConfig setAppSecret:1 info1:750848352 info2:1884995334 info3:181661496 info4:1073918938];
[adjustConfig setLogLevel:ADJLogLevelVerbose];
// [adjustConfig setLogLevel:ADJLogLevelSuppress];
// [adjustConfig setLogLevel:ADJLogLevelVerbose];
[adjustConfig setLogLevel:ADJLogLevelSuppress];
[adjustConfig setSendInBackground:YES];
[Adjust appDidLaunch:adjustConfig];

Expand All @@ -46,12 +46,31 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary*)options{
// return [[LineSDKLogin sharedInstance] handleOpenURL:url];
NSLog(@"-ios----IOSBridgeHelper---*********************---");
switch (CurLoginType) {
case tApple:
break;
case tGameCenter:
break;
case tFaceBook:
return [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
break;
case tGoogle:
return [[GIDSignIn sharedInstance] handleURL:url];
break;
}
return true;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[super applicationDidBecomeActive:application];
[FBSDKAppEvents activateApp];
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [[GIDSignIn sharedInstance] handleURL:url];
}
//- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// [super application:application openURL:url options:options];
//
Expand All @@ -74,11 +93,11 @@ typedef NS_ENUM(NSInteger, SDKLoginType)
tAccount,
tSDKToken,//其实就是星辉
tSuper,
Tourist,
tGoogle,
tApple,
tFaceBook,
tGameCenter,

};

#pragma mark --init
Expand All @@ -90,6 +109,7 @@ -(void)InitSDK{
[[LineHelper sharedInstance] InitSDK:self];
[[ElvaHelper sharedInstance] InitSDK:self];
[[AdjustHelper sharedInstance] InitSDK:self];
[self GetDeviceId];
}

#pragma mark -- 登录 jsonString 为登录方式 就是一个字符串
Expand Down Expand Up @@ -138,9 +158,13 @@ -(void)Logout: (const char *) jsonString{

#pragma mark -- 获取设备UUID
-(void)GetDeviceId{
NSString *UUID = [[Utils sharedInstance] GetUUID];;
NSLog(@"-ios----didFinishLaunchingWithOptions---UUID----%@",UUID);
[self SendMessageToUnity: eGetDeviceId DictData:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"1", @"state",UUID, @"UUID",nil]];
NSString *UUID = [[Utils sharedInstance] GetUUID];
BOOL IsHighLevel = [[Utils sharedInstance] IsHighLevel];
if (IsHighLevel) {
[self SendMessageToUnity: eGetDeviceId DictData:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"1", @"state",UUID, @"UUID",@"1", @"IsHighLevel",nil]];
}else{
[self SendMessageToUnity: eGetDeviceId DictData:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"1", @"state",UUID, @"UUID",@"0", @"IsHighLevel",nil]];
}
}
//cDelegate
-(void)InitSDKCallBack:(NSMutableDictionary *) dict{
Expand Down
15 changes: 13 additions & 2 deletions TestProject/Assets/Plugins/IOS/LineHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ -(void)InitSDK:(id<cDelegate>) delegate{
// //https://github.com/SoberTong/LineDemoIos/blob/master/LineDemoIos/ViewController.m
// [LineSDKLogin sharedInstance].delegate = self;
// apiClient = [[LineSDKAPI alloc] initWithConfiguration:[LineSDKConfiguration defaultConfig]];
NSLog(@"--ElvaHelper---InitSDK---");
}

-(void)Login{
Expand Down Expand Up @@ -72,7 +73,18 @@ - (void)logout{
// */
}
-(void)share:(const char*) jsonData{

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString * pictureUrl = @"https://image.baidu.com/search/detail?z=0&word=%E7%8F%8D%E7%8F%8DOo&hs=0&pn=2&spn=0&di=0&pi=533454875148338836&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&cs=3765407342%2C2815074957&os=1357259984%2C3887820448&simid=&adpicid=0&lpn=0&fm=&sme=&cg=&bdtype=-1&oriquery=&objurl=http%3A%2F%2Ft7.baidu.com%2Fit%2Fu%3D3616242789%2C1098670747%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D900%26h%3D1350&fromurl=&gsm=30000000003&catename=pcindexhot&islist=&querylist=";
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:pictureUrl]];
UIImage *image = [UIImage imageWithData:data];
[pasteboard setData:UIImageJPEGRepresentation(image, 0.9) forPasteboardType:@"public.jpeg"];
NSString *contentType =@"image";

NSString *contentKey = [pasteboard.name stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

NSString *urlString = [NSString stringWithFormat:@"line://msg/%@/%@",contentType, contentKey];
NSURL *url = [NSURL URLWithString:urlString];
[[UIApplication sharedApplication]openURL:url];
}
- (BOOL)shareMessage:(NSString *)message
{
Expand Down Expand Up @@ -102,7 +114,6 @@ - (BOOL)sharePicture:(NSString *)pictureUrl
NSString *contentType =@"image";

NSString *contentKey = [pasteboard.name stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
// NSString *contentKey = [pasteboard.name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

NSString *urlString = [NSString stringWithFormat:@"line://msg/%@/%@",contentType, contentKey];
NSURL *url = [NSURL URLWithString:urlString];
Expand Down
1 change: 1 addition & 0 deletions TestProject/Assets/Plugins/IOS/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
-(void)saveValueWithKey:(NSString *)key value:(NSString *)value;
-(void)deleteValueWithKey:(NSString *)key;
-(NSString *)GetUUID;
-(BOOL *)IsHighLevel;
@end
#endif /* Utils_h */
8 changes: 8 additions & 0 deletions TestProject/Assets/Plugins/IOS/Utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ -(NSString *)GetDisPalyName{
NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
return app_Name;
}
#pragma mark -判断系统是否高于iOS 13.0
-(BOOL *)IsHighLevel{
if (@available(iOS 13.0, *)) {
return YES;
}else{
return NO;
}
}
@end
3 changes: 3 additions & 0 deletions TestProject/Assets/Resources/Art/Atlas.spriteatlas
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ SpriteAtlas:
packables: []
totalSpriteSurfaceArea: 0
bindAsDefault: 1
storedHash:
serializedVersion: 2
Hash: 5f3d7782bfcfc65f2bf66d491ae42c6e
m_MasterAtlas: {fileID: 0}
m_PackedSprites: []
m_PackedSpriteNamesToIndex: []
Expand Down
2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/CountryFlag2.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/CountryFlag3.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/CountryFlag4.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/CountryFlag5.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/CountryFlag6.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/CountryFlag7.png.meta

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

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/男5.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/男主2.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/男主3.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/男主4.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/男主8.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/解锁人物框.png.meta

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

2 changes: 1 addition & 1 deletion TestProject/Assets/Resources/Art/试听声音.png.meta

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

0 comments on commit 827093c

Please sign in to comment.