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

Multiple instanses #37

Open
ortexx opened this issue Oct 9, 2020 · 5 comments
Open

Multiple instanses #37

ortexx opened this issue Oct 9, 2020 · 5 comments

Comments

@ortexx
Copy link

ortexx commented Oct 9, 2020

Android 10.

The case:

I build 2 apps with the library. I run one song in the first app and then another one in the second. So there are two notifications with the controls. When i click on any button(at least prev/next) both apps get the event message.

I see two solutions:

  1. Perfectly, if the library can distinguish the apps some way and send the message only for the necessary one.
  2. If it is too problematic, the library can at least send the application name with the event to let the programmer distinguish it in the code. const application= JSON.parse(action).application;
@ghenry22
Copy link
Owner

Good catch, I haven't tested that scenario, I will see if we can potentially random generate an APP ID for the notification channel so that it is unique.

The problem at the moment is that a fixed notification channel is used which is always the same.

@ghenry22
Copy link
Owner

I have a fix for this in the development branch at the moment, have implemented a UUID for the channel ID to prevent cross over.

@ortexx
Copy link
Author

ortexx commented May 12, 2021

Great news. Waiting for the release(npm)

@ghenry22
Copy link
Owner

weirdly I have tried with randomised channel id and notification id but they still overlap. I think because both instances are registering broadcast receivers to catch media key events. I'll try a few more things and see if I can find a way to filter this.

@ortexx
Copy link
Author

ortexx commented Aug 2, 2021

How about my second option in the first message? You can pass the application name from config.xml to the client side. And we can handle messages only for the necessary app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants