ByteBrew Unreal Engine SDK
- Download the repository as a zip.
- Extract the ByteBrewSDK folder and copy it to your project's Plugins folder.
- Restart your Unreal project to rebuild the plugin.
- Go to Edit > Plugins and make sure Other > ByteBrewSDK is enabled.
- Open project settings (Edit > Project Settings)
- Under Platforms > iOS, under the "Online" section, enable "Enable Remote Notifications Support".
- Close the Unreal editor if it's open.
- Open your DefaultEngine.ini config file located at project_root/Config/DefaultEngine.ini
- Find the section with the heading
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
- Add this line:
bEnableRemoteNotificationsSupport=True
- Open your project's Build.cs file located at project_root/Source/Project_Name/Project_Name.Build.cs.
- Add "ByteBrewSDK" to PublicDependencyModuleNames. It should look something like this:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ByteBrewSDK" });
- Add "Settings" and "Launch" to PrivateIncludePathModuleNames. If it's not there, just add it below PublicDependencyModuleNames and/or PrivateDependencyModuleNames.
PrivateIncludePathModuleNames.AddRange(new string[] { "Settings", "Launch" });
- Add
#include "ByteBrewSDKInterface.h"
to the top of your C++ header file. - Call functions from the .cpp file:
// Called when the game starts
void UByteBrewSDKCallsTest::BeginPlay()
{
Super::BeginPlay();
// ...
FString engineVersion = TEXT("unreal");
FString buildVersion = TEXT("1.0");
#if PLATFORM_IOS
FString gameKey = TEXT("ios_game_key");
FString secretKey = TEXT("ios_secret_key");
UByteBrewSDKInterface::InitializeByteBrew(gameKey, secretKey, engineVersion, buildVersion);
#elif PLATFORM_ANDROID
FString gameKey = TEXT("android_game_key");
FString secretKey = TEXT("android_secret_key");
UByteBrewSDKInterface::InitializeByteBrew(gameKey, secretKey, engineVersion, buildVersion);
#endif
bool bIsInitialized = UByteBrewSDKInterface::IsByteBrewInitialized();
UByteBrewSDKInterface::StartPushNotifications();
FString eventName = TEXT("test_event");
UByteBrewSDKInterface::NewCustomEvent(eventName);
UByteBrewSDKInterface::NewCustomEventWithStringValue(eventName, TEXT("string_value"));
UByteBrewSDKInterface::NewCustomEventWithFloatValue(eventName, 123.45f);
UByteBrewSDKInterface::SetCustomData(TEXT("key"), TEXT("value"));
UByteBrewSDKInterface::SetCustomDataFloat(TEXT("key_float"), 123.45f);
UByteBrewSDKInterface::SetCustomDataInt(TEXT("key_int"), 42);
UByteBrewSDKInterface::SetCustomDataBool(TEXT("key_bool"), true);
UByteBrewSDKInterface::NewProgressionEvent(EByteBrewProgressionType::Started, TEXT("environment"), TEXT("stage"));
UByteBrewSDKInterface::NewProgressionEventWithStringValue(EByteBrewProgressionType::Completed, TEXT("environment"), TEXT("stage"), TEXT("string_value"));
UByteBrewSDKInterface::NewProgressionEventWithFloatValue(EByteBrewProgressionType::Failed, TEXT("environment"), TEXT("stage"), 123.45f);
UByteBrewSDKInterface::TrackAdEvent(EByteBrewAdType::Interstitial, TEXT("ad_location"));
UByteBrewSDKInterface::TrackAdEventWithAdID(EByteBrewAdType::Reward, TEXT("ad_location"), TEXT("ad_id"));
UByteBrewSDKInterface::TrackAdEventWithAdIDAndProvider(EByteBrewAdType::Banner, TEXT("ad_location"), TEXT("ad_id"), TEXT("ad_provider"));
UByteBrewSDKInterface::TrackAdEventWithRevenue(EByteBrewAdType::Reward, TEXT("ad_provider"), TEXT("ad_unit_name"), 1.2345f);
UByteBrewSDKInterface::TrackAdEventWithAdLocationRevenue(EByteBrewAdType::Reward, TEXT("ad_provider"), TEXT("ad_unit_name"), TEXT("ad_location"), 1.2345f);
UByteBrewSDKInterface::TrackInAppPurchaseEvent(TEXT("store"), TEXT("currency"), 19.99f, TEXT("item_id"), TEXT("category"));
#if PLATFORM_IOS
UByteBrewSDKInterface::TrackAppleInAppPurchaseEvent(TEXT("store"), TEXT("currency"), 19.99f, TEXT("item_id"), TEXT("category"), TEXT("receipt"));
UByteBrewSDKInterface::ValidateAppleInAppPurchaseEvent(TEXT("store"), TEXT("currency"), 19.99f, TEXT("item_id"), TEXT("category"), TEXT("receipt"));
#elif PLATFORM_ANDROID
UByteBrewSDKInterface::TrackGoogleInAppPurchaseEvent(TEXT("store"), TEXT("currency"), 19.99f, TEXT("item_id"), TEXT("category"), TEXT("receipt"), TEXT("signature"));
UByteBrewSDKInterface::ValidateGoogleInAppPurchaseEvent(TEXT("store"), TEXT("currency"), 19.99f, TEXT("item_id"), TEXT("category"), TEXT("receipt"), TEXT("signature"));
#endif
bool bHasRemoteConfigsBeenSet = UByteBrewSDKInterface::HasRemoteConfigsBeenSet();
FString remoteConfigValue = UByteBrewSDKInterface::RetrieveRemoteConfigValue(TEXT("key"), TEXT("default_value"));
UByteBrewSDKInterface::RestartTracking();
UByteBrewSDKInterface::StopTracking();
FString userID = UByteBrewSDKInterface::GetUserID();
UByteBrewSDKInterface::LoadRemoteConfigs();
}
You should also now be able to access the ByteBrew category when creating blueprints.
You can Initialize ByteBrew like so:
Here's a list of available blueprint functions and implementation examples: