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

[Deploy] Android Messages #164

Open
michaelsouellette opened this Issue Jun 18, 2018 · 20 comments

Comments

Projects
None yet
10 participants
@michaelsouellette
Copy link

michaelsouellette commented Jun 18, 2018

Service

Android Messages

Link to your repository

https://github.com/michaelsouellette/recipe-androidMessages

Additional Information

Franz plugin for the new Android Messages interface

@efraimbart

This comment has been minimized.

Copy link

efraimbart commented Jun 19, 2018

Code to enable the counter:

  const getMessages = function getMessages() {
    const elements = document.querySelectorAll('.yrs5ff:first-child');
    let count = 0;

    for (let i = 0; i < elements.length; i += 1) {
      if (elements[i].querySelectorAll('.Ht7Nrb').length === 0) {
        count += 1;
      }
    }

    // set Franz badge
    Franz.setBadge(count);
  };
@efraimbart

This comment has been minimized.

Copy link

efraimbart commented Jun 20, 2018

I just realized that this was was originally not working because it was based off WhatsApp and not updated fully, in that case you should probably also remove the remaining WhatsApp css stuff as it's not applicable here.

@askalburgi

This comment has been minimized.

Copy link

askalburgi commented Jun 21, 2018

When will this go live? I've been trying to hack it to work with my Franz but haven't been successful. When will it appear in the "Add Services" search?

@michaelsouellette

This comment has been minimized.

Copy link
Author

michaelsouellette commented Jun 21, 2018

@askalburgi Can't comment on go live since it kind of depends on the main developer(s). However, you can pull this repo down and put it in the dev directory location for Franz and you should be able to use it as is. Make sure to check out the plugins repo for directions on how to do that. It has been working for me.

@michaelsouellette

This comment has been minimized.

Copy link
Author

michaelsouellette commented Jun 21, 2018

@efraimbart Yeah I was pretty hasty in creating this, I will take a look at removing this extra bit of code.

@michaelsouellette

This comment has been minimized.

Copy link
Author

michaelsouellette commented Jun 21, 2018

@efraimbart I removed the css it appears nothing is really needed for this plugin

@michaelsouellette

This comment has been minimized.

Copy link
Author

michaelsouellette commented Jun 26, 2018

If anyone has suggested improvements to this plugin feel free to open a pull request.

@bgschiller

This comment has been minimized.

Copy link

bgschiller commented Jul 4, 2018

This is working great for me. I don't see anything to improve. 👍

@NobleMule

This comment has been minimized.

Copy link

NobleMule commented Jul 10, 2018

I just tried knocking up an android messages recipe myself. Was going to proudly try to deploy it... and then saw this.

Anyway, not sure if it's 100% correct because I don't get tons of messages to be able to verify this but I think the presence of the .yrs5ff class is enough to signify a new message so maybe you could simplify your getMessages function by doing something like this:

Franz.setBadge(document.querySelectorAll('.yrs5ff:first-child').length);

I've removed the loop in mine (although I did my query selector in a slightly less efficient way so this is untested) and it appears to work...

@NobleMule

This comment has been minimized.

Copy link

NobleMule commented Jul 10, 2018

Also, if you have no CSS, this can be omitted entirely:

  // inject franz.css stylesheet
  Franz.injectCSS(path.join(__dirname, 'service.css'));
@efraimbart

This comment has been minimized.

Copy link

efraimbart commented Jul 10, 2018

@NobleMule the for loop is to eliminate muted conversations, similar to WhatsApp.
I've also created a pull request to entirely remove the CSS.

@NobleMule

This comment has been minimized.

Copy link

NobleMule commented Jul 10, 2018

@efraimbart Ah, makes sense. Very nice 😄

@michaelsouellette

This comment has been minimized.

Copy link
Author

michaelsouellette commented Jul 10, 2018

@efraimbart I merged your pull request, thanks!

@mikezielonka

This comment has been minimized.

Copy link

mikezielonka commented Jul 18, 2018

Is this close to being deployed into a new version of the beta? 😇

@thatchrismiller

This comment has been minimized.

Copy link

thatchrismiller commented Jul 28, 2018

Really hoping to see this soon. It's the only thing keeping me from rocking Franz right now.

@efraimbart

This comment has been minimized.

Copy link

efraimbart commented Jul 29, 2018

@thatchrismiller It's quite easily to manually add this plugin to your Franz setup.

@bpwned

This comment has been minimized.

Copy link

bpwned commented Aug 13, 2018

@efraimbart Do you have instructions to manually add this handy? I'm having trouble finding them and I'd really like to try this.

@michaelsouellette

This comment has been minimized.

Copy link
Author

michaelsouellette commented Aug 13, 2018

@FilipMalczak

This comment has been minimized.

Copy link

FilipMalczak commented Aug 27, 2018

Duplicated by #192 and #170 . I personally like #192 approach best.

@jaminroe

This comment has been minimized.

Copy link

jaminroe commented Oct 28, 2018

What's the progress on this? Where's the PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.