[M] login & logout & payment
- login by token - save account info - logout remove accout info - iOS SKU list parser - iOS Pay
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <XYSDK/XYSDK.h>
|
||||
#import <GASDK/GAConstants.h>
|
||||
#import <GASDK/GASDK.h>
|
||||
#import "TYConfig.h"
|
||||
|
||||
#define TOKEN_ERROR @"-8"
|
||||
extern "C" {
|
||||
@@ -118,6 +121,23 @@ extern "C" {
|
||||
}];
|
||||
}
|
||||
|
||||
void UnityLogoutGoogle()
|
||||
{
|
||||
NSLog(@"TYSdkInterface UnityLogOut Google");
|
||||
[XYApi XYLogoutChannelWithType:XYLoginWithGoogle];
|
||||
}
|
||||
void UnityLogoutFacebook()
|
||||
{
|
||||
NSLog(@"TYSdkInterface UnityLogOut Facebook");
|
||||
[XYApi XYLogoutChannelWithType:XYLoginWithFB];
|
||||
}
|
||||
|
||||
void UnityLogoutGuest()
|
||||
{
|
||||
NSLog(@"TYSdkInterface UnityLogOutGuset");
|
||||
[XYApi XYLogoutChannelWithType:XYLoginWithGuest];
|
||||
}
|
||||
|
||||
//支付
|
||||
void UnityKnow(const char* userId,const char* productId,const char* productPrice,const char* productName,const char* productCount,const char* orderid,const char* appinfo)
|
||||
{
|
||||
@@ -171,16 +191,30 @@ extern "C" {
|
||||
//打点
|
||||
void SetGaUserInfo(const char* userId)
|
||||
{
|
||||
|
||||
NSString *userid = [[NSString alloc] initWithCString:userId encoding:NSUTF8StringEncoding];
|
||||
[[GASDK getGAlog:SDK_PROJECTID] setUserId:userid];
|
||||
}
|
||||
|
||||
void SetGaCommonInfo(const char* SetGaCommonInfo)
|
||||
{
|
||||
|
||||
NSString * jsonString = [NSString stringWithFormat:@"%s", SetGaCommonInfo];
|
||||
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSError* err;
|
||||
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err];
|
||||
if(!err){
|
||||
[[GASDK getGAlog:SDK_PROJECTID] initWithGameId:SDK_GAMEID clientId:SDK_CLIENTID withCommonParams:dic serverUrl:GA_INTERNATIONAL];
|
||||
}
|
||||
}
|
||||
|
||||
void GAReportParams(int type, const char* eventstr, const char* paramstr)
|
||||
{
|
||||
NSString * jsonString = [NSString stringWithFormat:@"%s", paramstr];
|
||||
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSError* err;
|
||||
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err];
|
||||
if(!err){
|
||||
[[GASDK getGAlog:SDK_PROJECTID] initWithGameId:SDK_GAMEID clientId:SDK_CLIENTID withCommonParams:dic serverUrl:GA_INTERNATIONAL];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user