123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //
- // ViewController.m
- // NatureDemo
- //
- // Created by SAGESSE on 2019/1/20.
- // Copyright © 2019 SAGESSE. All rights reserved.
- //
- #import "ViewController.h"
- #import <XenonSDK/XenonSDK-Export.h>
- #define GameSDK LieYanShaCheng
- @interface KL: UIView
- @end
- @implementation KL
- + (Class)layerClass {
- return CAGradientLayer.self;
- }
- @end
- @interface ViewController ()
- @end
- @implementation ViewController
- - (void)loadView {
- [super loadView];
- KL* view = [[KL alloc] initWithFrame:self.view.frame];
- CAGradientLayer* gr = (id)view.layer;
- gr.colors = @[(__bridge id)UIColor.orangeColor.CGColor,
- (__bridge id)UIColor.purpleColor.CGColor];
- view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- [self.view insertSubview:view atIndex:0];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
-
- [XenonSDK.sharedSDK initWithParameter:@"20194|1104|475316&iOScsyx_test_0001" complete:^(NSError * error) {
- [XenonSDK.sharedSDK loginWithComplete:^(id user, NSError * error) {
- NSLog(@"SDK初始化成功了");
- }];
- }];
-
- }
- - (IBAction)login:(id)sender {
- [XenonSDK.sharedSDK loginWithComplete:^(id user, NSError * error) {
- NSLog(@"SDK初始化d登录成功打印%@",user);
- }];
- }
- - (IBAction)logout:(id)sender {
- [XenonSDK.sharedSDK logoutWithComplete:^{
- NSLog(@"%s", __func__);
- }];
- }
- - (IBAction)pay:(id)sender {
-
- id ps = @{
- @"amount": @"6",
- @"productName": @"6元宝",
- @"productCode": @"6",
- @"roleName": @"roleName",
- @"orderId": NSUUID.UUID.UUIDString,
- @"serverId": @"serverId",
- @"extraInfo": @"extraInfo"
- };
- [XenonSDK.sharedSDK buy:ps complete:^(id order, NSError * error) {
- NSLog(@"%s %@/%@", __func__, error, order);
- }];
- }
- - (IBAction)userCenter:(id)sender {
- [XenonSDK.sharedSDK center];
- }
- @end
|