// SDKManagerExt.mm #import "SDKManager.h" // Define C-style functions to expose Objective-C methods extern "C" { void __ImportInitWithDigitMap(const char *gameId, const char *adId, bool shouldLog) { NSString *gameIdStr = [NSString stringWithUTF8String:gameId]; NSString *adIdStr = [NSString stringWithUTF8String:adId]; [[SDKManager sharedInstance] InitWithDigitMap:gameIdStr ring:adIdStr shouldLog:shouldLog]; } void __ImportLogin() { [[SDKManager sharedInstance] Login]; } void __ImportLogout() { [[SDKManager sharedInstance] Logout]; } void __ImportPaymentWithJson(const char *cpOrderId, const char *productPrice, const char *productId, const char *productName, const char *productDesc, const char *productCount, const char *exchangeRate, const char *currencyName, const char *serverId, const char *serverName, const char *roleId, const char *roleName, const char *roleLevel, const char *roleVip, const char *partyName, const char *roleBalence, const char *ext) { NSDictionary *bayInfo = @{ @"product_id": productId ?: @"", @"product_price" :productPrice ?: @"", @"product_name" :productName ?: @"", @"role_id" : roleId ?: @"", @"role_name" : roleName ?: @"", @"role_level" : roleLevel ?: @"", @"server_id" : serverId ?: @"", @"server_name": serverName ?: @"", @"role_vip" : roleVip ?: @"", @"party_name" : partyName ?: @"", @"role_balence" : roleBalence ?: @"", @"cp_order_id" : cpOrderId ?: @"", @"product_count" : productCount ?: @"", @"product_desc" : productDesc ?: @"", @"exchange_rate" : exchangeRate ?: @"", @"currency_name" : currencyName ?: @"", @"ext" : ext ?: @"", }; [[SDKManager sharedInstance] PaymentWithJson:bayInfo]; } void __ImportRoleInfoWithJson(const char *type, const char *serverId, const char *serverName, const char *roleId, const char *roleName, const char *roleLevel, const char *roleVip, const char *partyName, const char *roleBalence) { NSDictionary *roleInfo = @{ @"type" : type ?: @"", @"server_id" : serverId ?: @"", @"server_name" :serverName ?: @"", @"role_id" : roleId ?: @"", @"role_name" : roleName ?: @"", @"role_level" : roleLevel ?: @"", @"role_vip" : roleVip ?: @"", @"party_name" :partyName ?: @"", @"role_balence" : roleBalence ?: @"" }; [[SDKManager sharedInstance] RoleInfoWithJson:roleInfo]; } }