We are using Unreal Engine 5.1 and nakama-unreal-2.7.0 client SDK, and we have implementation that is using UNakamaClient, UNakamaSession and UNakamaRealtimeClient classes.
On back-end we rpc that includes nk.NotificationSend(…) call (and notif. is persistent)
On client when NakamaClient->ListNotifications(…) is called, operation is successfully executed and list of all notifications.
We have tried to set notification listener after successful authentication:
NakamaRealtimeClient = NakamaClient->SetupRealtimeClient(NakamaSession, true, 7350, ENakamaRealtimeClientProtocol::Protobuf, 0.05f, "");
NakamaRealtimeClient->SetListenerNotificationsCallback();
TScriptDelegate NakamaNotificationDelegate;
NakamaNotificationDelegate.BindUFunction(this, GET_FUNCTION_NAME_CHECKED(ThisClass, HandleNakamaNotificationEvent));
NakamaRealtimeClient->NotificationReceived.Add(NakamaNotificationDelegate);
NakamaRealtimeClient->Connect(ConnectionSuccessDelegate, ConnectionErrorDelegate);
We receive in logs confirmation of websocket connection:
LogTemp: [NRtClient::NRtClient] Created
LogTemp: [NRtClient::connect] ...
LogTemp: Warning: Nakama Realtime Client Setup: Socket connected
We are implemented Nakama as:
class GAME_API UGameNakamaSubsystem : public UGameInstanceSubsystem
{
..
UPROPERTY()
UNakamaClient* NakamaClient;
UPROPERTY()
UNakamaSession* NakamaSession;
UPROPERTY()
UNakamaRealtimeClient* NakamaRealtimeClient;
..
}
We have Tick function:
bool UGameNakamaSubsystem::Tick(float DeltaSeconds)
{
// You must tick Nakama client to get server response and events
if (NakamaClient != nullptr)
{
NakamaClient->Tick(DeltaSeconds);
}
// You must tick Nakama real time client to get server response and events
if (NakamaRealtimeClient != nullptr)
{
NakamaRealtimeClient->Tick(DeltaSeconds);
}
return true;
}
But when rpc (with NotificationSend) is executed, on our client bound function HandleNakamaNotificationEvent DOES NOT GET triggered.