Skip to content

Can't unsubscribe from events? #1319

Closed
Closed
@yogev2255

Description

@yogev2255

[REQUIRED] Please fill in the following fields:
Unity editor version: 2021.3.15f1
Firebase Unity SDK version: 10.3.0
Source you installed the SDK: .unitypackage __ (.unitypackage or Unity Package Manager)
Problematic Firebase Component: database
(Auth, Database, etc.)
Other Firebase Components in use: non_ (Auth, Database, etc.)
Additional SDKs you are using: GooglePlay_ (Facebook, AdMob, etc.)
Platform you are using the Unity editor on: _windows (Mac, Windows, or Linux)
Platform you are targeting: android (iOS, Android, and/or desktop)
Scripting Runtime: IL2CPP
(Mono, and/or IL2CPP)
[REQUIRED] Please describe the issue here:

Hello,

I use firebase real-time database and I am subscribing to events on start and a few other places and is working fine

but when I am trying to unsubscribe from them
in OnDisable the user still receives updates from firebase why?
I get this on 2 different scripts

I tested with
[ContextMenu("disable")] void RemoveEvents() { db.Child("Users").Child(GameManager.instance.pinCode.ToString()).ChildAdded -= AddPlayerToList; db.Child("Users").Child(GameManager.instance.pinCode.ToString()).ChildRemoved -= RemovePlayerList; db.Child("Servers").Child(GameManager.instance.pinCode.ToString()).ChildChanged -= OnServerChagne; Application.quitting -= UserQuitTheGame; StopAllCoroutines(); Debug.Log("disable lobby"); }
but I still receive events

Metadata

Metadata

Assignees

No one assigned

    Labels

    newNew issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions