C++

How to integrate Pushwoosh SDK into your Unreal Engine project

Supports iOS, Android

Download Plugin Download Sample Plugin API Docs

To integrate Pushwoosh into your Unreal Engine project:

1. Download Pushwoosh Plugin and put it in your Plugins folder.

2. Enable Pushwoosh module in YourProjectName.uproject:

"Plugins": [
  {
    "Name": "Pushwoosh",
    "Enabled": true
  }
],

3. Configure your project in Firebase Console.

4. Locate the google-services.json file to the Config folder in your project directory.

google-services.json

You should've gotten the google-services.json file while creating the app in Firebase console. If you haven't, please consult this thread (section Get a config file for your Android app).

5. Add Pushwoosh module to the dependency list of you project:

PrivateDependencyModuleNames.AddRange(new string[] { "Pushwoosh" });

6. Recompile your project.

7. Specify Pushwoosh Application Id and FCM Project Number in Project Settings...-> Plugins -> Pushwoosh

8. Initialize Pushwoosh plugin and register for push notifications:

if (FPushwooshModule::IsAvailable())
{
		FPushwooshModule& pushwoosh = FPushwooshModule::Get();
		pushwoosh.Initialize();
		pushwoosh.RegisterForPushNotifications();
}

9. (Optional) set push registration and push notification listeners before initializing plugin:

void YourComponent::InitPushwooshListeners()
{
	FPushwooshModule::PushRegistrationSucceeded.AddUObject(this, &YourComponent::PushRegistrationSucceeded_Handler);
	FPushwooshModule::PushRegistrationError.AddUObject(this, &YourComponent::PushRegistrationError_Handler);
	FPushwooshModule::PushAccepted.AddUObject(this, &YourComponent::PushAccepted_Handler);
}

void YourComponent::PushRegistrationSucceeded_Handler(FString token)
{
	// TODO: handle successful registration
}

void YourComponent::PushRegistrationError_Handler(FString error)
{
	// TODO: handle push registration error
}

void YourComponent::PushAccepted_Handler(FString data)
{
	// TODO: handle push open
}

9. For iOS add Push Notifications Capability to your project. This can be done by adding following key-value pair in Intermediate/ProjectFilesIOS/build/${YourProject}.build/${Configuration}-iphoneos/${YourProject}.build/${YourProject}.app.xcent:

<key>aps-environment</key>
<string>development</string>

10. For Android make sure Unreal Engine and Pushwoosh Plugin does not have conflicting libraries.

Share your feedback with us

Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.

Last updated