
#import "CustomAppController.h"
#import <XYSDK/XYSDK.h>
#import "TYConfig.h"

IMPL_APP_CONTROLLER_SUBCLASS(CustomAppController)

@implementation CustomAppController

-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    [super application:application didFinishLaunchingWithOptions:launchOptions];
    [self initXYSDK:application didFinishLaunchingWithOptions:launchOptions];

    return YES;
}

- (void)initXYSDK:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{

    [[GASDK getGAlog:SDK_PROJECTID] initWithGameId:SDK_GAMEID clientId:SDK_CLIENTID withCommonParams:@{} serverUrl:GA_INTERNATIONAL];

    XYSDKInitConfig * config = [[XYSDKInitConfig alloc] init];
    config.appId = [SDK_APPID intValue];
    config.cloudId = SDK_CLOUDID;
    config.clientId = SDK_CLIENTID;
    config.serverUrl = SDK_LOGIN_SERVER_URL;
    config.gameId = SDK_GAMEID;
    config.openTerminalLog = XYSDK_DEBUG;
    config.googleClientid = GOOGLE_CLIENTID;

    config.launchOptions = launchOptions;
    config.launchApplication = application;
    [XYApi initWithConfig:config];
    [XYApi application:application didFinishLaunchingWithOptions:launchOptions];
}

@end
