Skip to content

ByteBrewIO/ByteBrewUnrealSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

ByteBrewUnrealSDK

ByteBrew Unreal Engine SDK

Getting Started

  1. Download the repository as a zip.
  2. Extract the ByteBrewSDK folder and copy it to your project's Plugins folder.
  3. Restart your Unreal project to rebuild the plugin.
  4. Go to Edit > Plugins and make sure Other > ByteBrewSDK is enabled.

Extra steps for enabling push notifications on iOS

If your Unreal Engine is built from the Github source:

  1. Open project settings (Edit > Project Settings)
  2. Under Platforms > iOS, under the "Online" section, enable "Enable Remote Notifications Support".

If your Unreal Engine is NOT built from the Github source:

  1. Close the Unreal editor if it's open.
  2. Open your DefaultEngine.ini config file located at project_root/Config/DefaultEngine.ini
  3. Find the section with the heading [/Script/IOSRuntimeSettings.IOSRuntimeSettings]
  4. Add this line: bEnableRemoteNotificationsSupport=True

How to Use

Additional steps for C++ calls

  1. Open your project's Build.cs file located at project_root/Source/Project_Name/Project_Name.Build.cs.
  2. Add "ByteBrewSDK" to PublicDependencyModuleNames. It should look something like this:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ByteBrewSDK" });
  1. 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" });
  1. Add #include "ByteBrewSDKInterface.h" to the top of your C++ header file.
  2. 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:

image

Here's a list of available blueprint functions and implementation examples:

image

image

image

image

image

image

image

image

image

image

image

image

image

About

ByteBrew Unreal Engine SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published