fix:1、接入合作方的sdk。2、支付逻辑接入sdk中的接口
This commit is contained in:
@@ -22,6 +22,11 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
VisionOS: VisionOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
|
||||
@@ -34,14 +34,22 @@ static const char* stringFromdictionary(NSDictionary* dictionary) {
|
||||
|
||||
static NSDictionary* dictionaryFromNSError(NSError* error) {
|
||||
if(error){
|
||||
NSInteger code = [error code];
|
||||
NSString *localizedDescription = [error localizedDescription];
|
||||
|
||||
NSDictionary *errorDictionary = @{
|
||||
@"code" : @(code) ?: @(-1),
|
||||
@"localizedDescription" : localizedDescription,
|
||||
};
|
||||
return errorDictionary;
|
||||
NSMutableDictionary *errorDictionary = [NSMutableDictionary dictionary];
|
||||
errorDictionary[@"code"] = @(error.code);
|
||||
errorDictionary[@"localizedDescription"] = error.localizedDescription ?: @"";
|
||||
|
||||
// Include userInfo fields for enhanced error reporting (iOS SDK 6.17.8+)
|
||||
if (error.userInfo[@"error_code"]) {
|
||||
errorDictionary[@"error_code"] = error.userInfo[@"error_code"];
|
||||
}
|
||||
if (error.userInfo[@"error_message"]) {
|
||||
errorDictionary[@"error_message"] = error.userInfo[@"error_message"];
|
||||
}
|
||||
if (error.userInfo[@"invalid_fields"]) {
|
||||
errorDictionary[@"invalid_fields"] = error.userInfo[@"invalid_fields"];
|
||||
}
|
||||
|
||||
return errorDictionary;
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
||||
@@ -33,7 +33,7 @@ extern "C" {
|
||||
|
||||
const void _startSDK(bool shouldCallback, const char* objectName) {
|
||||
[[AppsFlyerLib shared] setPluginInfoWith: AFSDKPluginUnity
|
||||
pluginVersion:@"6.17.1"
|
||||
pluginVersion:@"6.17.91"
|
||||
additionalParams:nil];
|
||||
startRequestObjectName = stringFromChar(objectName);
|
||||
AppsFlyeriOSWarpper.didCallStart = YES;
|
||||
@@ -288,21 +288,19 @@ extern "C" {
|
||||
}];
|
||||
}
|
||||
|
||||
const void _validateAndSendInAppPurchaseV2 (const char* product, const char* price, const char* currency, const char* transactionId, const char* extraEventValues, const char* objectName) {
|
||||
const void _validateAndSendInAppPurchaseV2 (const char* product, const char* transactionId, int purchaseType, const char* purchaseAdditionalDetails, const char* objectName) {
|
||||
|
||||
validateAndLogObjectName = stringFromChar(objectName);
|
||||
AFSDKPurchaseDetails *details = [[AFSDKPurchaseDetails alloc] initWithProductId:stringFromChar(product) price:stringFromChar(price) currency:stringFromChar(currency) transactionId:stringFromChar(transactionId)];
|
||||
AFSDKPurchaseDetails *details = [[AFSDKPurchaseDetails alloc] initWithProductId:stringFromChar(product) transactionId:stringFromChar(transactionId) purchaseType:(AFSDKPurchaseType)purchaseType];
|
||||
|
||||
[[AppsFlyerLib shared]
|
||||
validateAndLogInAppPurchase:details
|
||||
extraEventValues:dictionaryFromJson(extraEventValues)
|
||||
completionHandler:^(AFSDKValidateAndLogResult * _Nullable result) {
|
||||
if (result.status == AFSDKValidateAndLogStatusSuccess) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_CALLBACK, stringFromdictionary(result.result));
|
||||
} else if (result.status == AFSDKValidateAndLogStatusFailure) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_CALLBACK, stringFromdictionary(result.errorData));
|
||||
purchaseAdditionalDetails:dictionaryFromJson(purchaseAdditionalDetails)
|
||||
completion:^(NSDictionary * _Nullable response, NSError * _Nullable error) {
|
||||
if (error) {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_ERROR_CALLBACK, stringFromdictionary(dictionaryFromNSError(error)));
|
||||
} else {
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_ERROR_CALLBACK, stringFromdictionary(dictionaryFromNSError(result.error)));
|
||||
unityCallBack(validateAndLogObjectName, VALIDATE_AND_LOG_V2_CALLBACK, stringFromdictionary(response));
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user