Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribing/Unsubscribing to topics doesn't work on Android #1294

Closed
AOEGame opened this issue Jul 15, 2022 · 8 comments
Closed

Subscribing/Unsubscribing to topics doesn't work on Android #1294

AOEGame opened this issue Jul 15, 2022 · 8 comments

Comments

@AOEGame
Copy link

AOEGame commented Jul 15, 2022

[READ] For Firebase Unity SDK issues, please report to Firebase Unity open-source

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Unity editor version: _2020.3.17f
  • Firebase Unity SDK version: 9.1.0
  • Source you installed the SDK: __unitypackage
  • Problematic Firebase Component: Messaging
  • Other Firebase Components in use: Analytics
  • Additional SDKs you are using: Analytics,Crashlytics
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting:Android
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

        Firebase.Messaging.FirebaseMessaging.UnsubscribeAsync(topic).ContinueWith(task =>
        {
            Debug.Log("FirebaseMessaging.UnsubscribeAsync:"   topic   " status:"   task.Status);
           
        });

I can not get the debug.log.
also test: awit Firebase.Messaging.FirebaseMessaging.UnsubscribeAsync

android version: 9

Relevant Code:

Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Verbose;
Firebase.Messaging.FirebaseMessaging.TokenRegistrationOnInitEnabled = true;
Firebase.Analytics.FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);

            Firebase.Messaging.FirebaseMessaging.TokenReceived  = OnTokenReceived;
            Firebase.Messaging.FirebaseMessaging.MessageReceived  = OnMessageReceived;
            string topic = "Lan_en";

        Firebase.Messaging.FirebaseMessaging.UnsubscribeAsync(topic).ContinueWith(task =>
        {
            Debug.Log("FirebaseMessaging.UnsubscribeAsync:"   topic   " status:"   task.Status);
           
        });
@AOEGame AOEGame added the new New issue. label Jul 15, 2022
@AOEGame
Copy link
Author

AOEGame commented Jul 18, 2022

anyone?

@paulinon
Copy link
Contributor

Hi @AOEGame,

Thanks for reporting this issue. While I try to replicate this, could you verify if the behavior persists using version 9.2.0 of the SDK? Are you getting any error messages after performing this operation?

@paulinon paulinon added needs-info Need information for the developer labels Jul 18, 2022
@AOEGame
Copy link
Author

AOEGame commented Jul 19, 2022

Hi @AOEGame,

Thanks for reporting this issue. While I try to replicate this, could you verify if the behavior persists using version 9.2.0 of the SDK? Are you getting any error messages after performing this operation?

After a lot of testing, I found out that the first launch then subscribe topic is successful. After restart our game then subscribe topic, the subscribeAsync task can not finish.

no error message.

the subscribeAsync task does not have any completion information.

Had set LogLevel:
Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug;

but no error message in android studio logcat!

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jul 19, 2022
@AOEGame
Copy link
Author

AOEGame commented Jul 19, 2022

Hi @AOEGame,

Thanks for reporting this issue. While I try to replicate this, could you verify if the behavior persists using version 9.2.0 of the SDK? Are you getting any error messages after performing this operation?

9.2.0 has the same problem.

first launch then subscribe topic is successful. kill app then restart, subscribeAsync task can not finish.

@AOEGame
Copy link
Author

AOEGame commented Jul 19, 2022

@AOEGame
Copy link
Author

AOEGame commented Jul 19, 2022

please help me!

@AOEGame
Copy link
Author

AOEGame commented Jul 19, 2022

@paulinon any update?

@paulinon
Copy link
Contributor

paulinon commented Jul 19, 2022

Hi @AOEGame,

I was able to replicate this behavior on my end, and it appears to be related to this bug where OnTokenReceived is called only on fresh app installs. The team is still working on the fix, and while you can refer to the aformentioned thread for updates, you may delete the token and get a new one as a workaround.

@paulinon paulinon closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2022
@firebase firebase locked and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants