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

Can i change topic from the UI button?? #7

Closed
holymokee opened this issue Nov 18, 2016 · 4 comments
Closed

Can i change topic from the UI button?? #7

holymokee opened this issue Nov 18, 2016 · 4 comments

Comments

@holymokee
Copy link

holymokee commented Nov 18, 2016

when i use "android firebase sdk", i can change topic from the UI button..

void buttonLangKor()
{
FirebaseMessaging.getInstance().unsubscribeFromTopic("LangKor");
FirebaseMessaging.getInstance().unsubscribeFromTopic("LangEng");

FirebaseMessaging.getInstance().subscribeToTopic("LangKor");
}

void buttonLangEng()
{
FirebaseMessaging.getInstance().unsubscribeFromTopic("LangKor");
FirebaseMessaging.getInstance().unsubscribeFromTopic("LangEng");

FirebaseMessaging.getInstance().subscribeToTopic("LangEng");
}

But, when i use "unity firebase sdk", i can't change topic from the UI button..
Instead, i can change topic when the app start time..

void Start()
{
....
InitializeFirebase()
...
}

void InitializeFirebase()
{
Firebase.Messaging.FirebaseMessaging.Unsubscribe("LangKor");
Firebase.Messaging.FirebaseMessaging.Unsubscribe("LangEng");

    Firebase.Messaging.FirebaseMessaging.Subscribe("LangKor");
    ....

}

I want to change the topic every time i press the button in the app.

i would appreciate your advice. please help me~~

@stewartmiles
Copy link
Contributor

To clarify, you're saying that topic unsubscription / subscription does not work after the messaging API has been initialized?

If so, which platform have you reproduced the problem on? Is this Android, iOS or both?

@stewartmiles
Copy link
Contributor

This is a bug in the C SDK (used by the Unity SDK) on Android.

See https://groups.google.com/d/msg/firebase-talk/Cdvbr_WUNXU/cjRcn42IAgAJ for the details.

Unfortunately, there is no workaround for the moment. I'm putting together a patch now which will be available in our next release.

@holymokee
Copy link
Author

Thank you for answer.

@stewartmiles
Copy link
Contributor

I'm pleased to announce that we released:

  • Firebase C SDK 2.1.0 (release notes here, download here)
  • Firebase Unity SDK 1.1.0 (release notes here, download here)

I believe this should resolve your issue. If not, please let us know and we'll take a look.

We've updated the Messaging sample with a topic field and subscribe / unsubscribe buttons for you to check out as well.

Cheers,
Stewart

@firebase firebase locked and limited conversation to collaborators Oct 27, 2019
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

2 participants