1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- // 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": [NSString stringWithUTF8String:productId],
- @"product_price" :[NSString stringWithUTF8String:productPrice],
- @"product_name" :[NSString stringWithUTF8String:productName],
- @"role_id" : [NSString stringWithUTF8String:roleId],
- @"role_name" : [NSString stringWithUTF8String:roleName],
- @"role_level" : [NSString stringWithUTF8String:roleLevel],
- @"server_id" : [NSString stringWithUTF8String:serverId],
- @"server_name": [NSString stringWithUTF8String:serverName],
- @"role_vip" : [NSString stringWithUTF8String:roleVip],
- @"party_name" : [NSString stringWithUTF8String:partyName],
- @"role_balence" : [NSString stringWithUTF8String:roleBalence],
- @"cp_order_id" : [NSString stringWithUTF8String:cpOrderId],
- @"product_count" : [NSString stringWithUTF8String:productCount],
- @"product_desc" : [NSString stringWithUTF8String:productDesc],
- @"exchange_rate" : [NSString stringWithUTF8String:exchangeRate],
- @"currency_name" : [NSString stringWithUTF8String:currencyName],
- @"ext" : [NSString stringWithUTF8String: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" : [NSString stringWithUTF8String:type],
- @"server_id" : [NSString stringWithUTF8String:serverId],
- @"server_name" : [NSString stringWithUTF8String:serverName],
- @"role_id" : [NSString stringWithUTF8String:roleId],
- @"role_name" : [NSString stringWithUTF8String:roleName],
- @"role_level" : [NSString stringWithUTF8String:roleLevel],
- @"role_vip" : [NSString stringWithUTF8String:roleVip],
- @"party_name" : [NSString stringWithUTF8String:partyName],
- @"role_balence" : [NSString stringWithUTF8String:roleBalence]
- };
- [[SDKManager sharedInstance] RoleInfoWithJson:roleInfo];
- }
- void __ImportSdkJumpUrl() {
- [[SDKManager sharedInstance] SdkJumpUrl];
- }
- }
|