Skip to content

Commit

Permalink
Merge pull request #27 from AppsFlyerSDK/dev/RD-81880/revenue-paramet…
Browse files Browse the repository at this point in the history
…er-locale

RD-81880 Can't parse revenue parameter due to localized string
  • Loading branch information
andr-ggn authored Apr 19, 2022
2 parents aecba99 + d7e0508 commit 5453a0a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,18 @@ void UAppsFlyerSDKBlueprint::logEvent(FString eventName, TMap <FString, FString>
// Transform `af_revenue` value to NSNumber in case if value of NSString type
id revenueString = dictionary[@"af_revenue"];
if (revenueString && [revenueString isKindOfClass:[NSString class]]) {
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
formatter.numberStyle = NSNumberFormatterDecimalStyle;
formatter.locale = locale;
NSNumber *revenueNumber = [formatter numberFromString:revenueString];
dictionary[@"af_revenue"] = revenueNumber;
}

[[AppsFlyerLib shared] logEvent:eventName.GetNSString() withValues:dictionary];
});
#endif
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("logEvent raised"));
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, TEXT("logEvent raised"));
}

FString UAppsFlyerSDKBlueprint::getAppsFlyerUID() {
Expand Down
2 changes: 1 addition & 1 deletion Demo/Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ appleAppID=1427570452
bIsDebug=True
bDisableSKAdNetwork=False
currencyCode=GBP
bEnableAutoStart=False
bEnableAutoStart=True

[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
PackageName=com.appsflyer.ue4template
Expand Down
Binary file modified Demo/Content/ThirdPersonCPP/Maps/ThirdPersonExampleMap.umap
Binary file not shown.
Binary file modified Demo/Content/ThirdPersonCPP/TriggerBox_Blueprint.uasset
Binary file not shown.
Binary file modified Demo/Content/ThirdPersonCPP/TriggerSphere_Blueprint.uasset
Binary file not shown.

0 comments on commit 5453a0a

Please sign in to comment.