Skip to content

Commit be59fb5

Browse files
Add DeleteMessages and InitPubnubWithConfig functionalities. Add PubSub samples. (#49)
add(persistence): add function DeleteMessages Add function DeleteMessages which can be used to delete messages from the history. add(config): add function InitPubnubWithConfig Add function InitPubnubWithConfig which can be used to initialize PubnubSubsystem with custom config, separate from Project Settings. add(sample): add PubSub samples fix(compile): fix compilation warnings
1 parent 93eef62 commit be59fb5

28 files changed

+1128
-68
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,3 @@ jobs:
5252
token: ${{ secrets.GH_TOKEN }}
5353
jira-api-key: ${{ secrets.JIRA_API_KEY }}
5454
last-service: true
55-
- name: Upload test reports
56-
uses: ./.github/.release/actions/actions/test-reports/upload
57-
with:
58-
token: ${{ secrets.GH_TOKEN }}
59-
acceptance-tests-workflow: Tests

.pubnub.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
name: unreal-engine
22
schema: 1
3-
version: 0.3.1
3+
version: v0.3.2
44
scm: github.com/pubnub/unreal-engine
55
changelog:
6+
- date: 2025-06-10
7+
version: v0.3.2
8+
changes:
9+
- type: feature
10+
text: "Add function DeleteMessages which can be used to delete messages from the history."
11+
- type: feature
12+
text: "Add function InitPubnubWithConfig which can be used to initialize PubnubSubsystem with custom config, separate from Project Settings."
13+
- type: improvement
14+
text: "Add PubSub samples"
15+
- type: improvement
16+
text: "Fix compilation warnings"
617
- date: 2025-05-27
718
version: v0.3.1
819
changes:
@@ -119,27 +130,27 @@ sdks:
119130
runtime-version:
120131
- Unreal Engine 5
121132
minimum-os-version:
122-
- Ubuntu 12.04
123-
maximum-os-version:
124133
- Ubuntu 20.04 LTS
134+
maximum-os-version:
135+
- Ubuntu 24.04 LTS
125136
target-architecture:
126137
- x86-64
127138
macOS:
128139
runtime-version:
129140
- Unreal Engine 5
130141
minimum-os-version:
131-
- macOS 10.12
142+
- macOS 12.5
132143
maximum-os-version:
133-
- macOS 11.0.1
144+
- macOS 15.5
134145
target-architecture:
135146
- x86-64
136147
Windows:
137148
runtime-version:
138149
- Unreal Engine 5
139150
minimum-os-version:
140-
- Windows Vista Ultimate
141-
maximum-os-version:
142151
- Windows 10 Home
152+
maximum-os-version:
153+
- Windows 11 Pro
143154
target-architecture:
144155
- x86-64
145156
-
@@ -166,27 +177,27 @@ sdks:
166177
runtime-version:
167178
- Unreal Engine 5
168179
minimum-os-version:
169-
- Ubuntu 12.04
170-
maximum-os-version:
171180
- Ubuntu 20.04 LTS
181+
maximum-os-version:
182+
- Ubuntu 24.04 LTS
172183
target-architecture:
173184
- x86-64
174185
macOS:
175186
runtime-version:
176187
- Unreal Engine 5
177188
minimum-os-version:
178-
- macOS 10.12
189+
- macOS 12.5
179190
maximum-os-version:
180-
- macOS 11.0.1
191+
- macOS 15.5
181192
target-architecture:
182193
- x86-64
183194
Windows:
184195
runtime-version:
185196
- Unreal Engine 5
186197
minimum-os-version:
187-
- Windows Vista Ultimate
188-
maximum-os-version:
189198
- Windows 10 Home
199+
maximum-os-version:
200+
- Windows 11 Pro
190201
target-architecture:
191202
- x86-64
192203
features:

PubnubLibrary.uplugin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"FileVersion": 3,
3-
"Version": 8,
4-
"VersionName": "0.3.1",
3+
"Version": 9,
4+
"VersionName": "0.3.2",
55
"FriendlyName": "Pubnub Unreal SDK",
66
"Description": "Quickly add interactive features to your game that scale without building your backend infrastructure.",
77
"Category": "Code",

Source/PubnubLibrary/Private/FunctionLibraries/PubnubJsonUtilities.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33

44
#include "FunctionLibraries/PubnubJsonUtilities.h"
5-
#include "Json.h"
5+
#include "Dom/JsonObject.h"
6+
#include "Dom/JsonValue.h"
7+
#include "Policies/CondensedJsonPrintPolicy.h"
8+
#include "Serialization/JsonReader.h"
9+
#include "Serialization/JsonWriter.h"
10+
#include "Serialization/JsonSerializer.h"
611

712
FString UPubnubJsonUtilities::JsonObjectToString(TSharedPtr<FJsonObject> JsonObject)
813
{
@@ -594,3 +599,21 @@ FPubnubChannelData UPubnubJsonUtilities::GetChannelDataFromJson(FString Response
594599
return ChannelData;
595600
}
596601

602+
FPubnubOperationResult UPubnubJsonUtilities::GetOperationResultFromJson(FString ResponseJson)
603+
{
604+
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject);
605+
606+
if(!StringToJsonObject(ResponseJson, JsonObject))
607+
{
608+
return FPubnubOperationResult();
609+
}
610+
611+
FPubnubOperationResult OperationResult;
612+
613+
JsonObject->TryGetNumberField(ANSI_TO_TCHAR("status"), OperationResult.Status);
614+
JsonObject->TryGetBoolField(ANSI_TO_TCHAR("error"), OperationResult.Error);
615+
JsonObject->TryGetStringField(ANSI_TO_TCHAR("error_message"), OperationResult.ErrorMessage);
616+
617+
return OperationResult;
618+
}
619+

Source/PubnubLibrary/Private/FunctionLibraries/PubnubUtilities.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@
22

33

44
#include "FunctionLibraries/PubnubUtilities.h"
5+
#include "Config/PubnubSettings.h"
56
#include "Runtime/Launch/Resources/Version.h"
6-
#include "Json.h"
7+
8+
9+
FPubnubConfig UPubnubUtilities::PubnubConfigFromPluginSettings(UPubnubSettings* PubnubSettings)
10+
{
11+
FPubnubConfig Config;
12+
Config.PublishKey = PubnubSettings->PublishKey;
13+
Config.SubscribeKey = PubnubSettings->SubscribeKey;
14+
Config.SecretKey = PubnubSettings->SecretKey;
15+
Config.SetSecretKeyAutomatically = PubnubSettings->SetSecretKeyAutomatically;
16+
17+
return Config;
18+
}
719

820
FString UPubnubUtilities::AddQuotesToString(const FString InString, bool SkipIfHasQuotes)
921
{

Source/PubnubLibrary/Private/PubnubLibrary.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2024 PubNub Inc. All Rights Reserved.
22

33
#include "PubnubLibrary.h"
4-
#include "Core.h"
54
#include "Kismet/KismetSystemLibrary.h"
65

76
#define LOCTEXT_NAMESPACE "FPubnubLibraryModule"

0 commit comments

Comments
 (0)