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

update fcm conversion branch and address PR feedback #205

Closed
wants to merge 35 commits into from

Conversation

ehaynes99
Copy link

This is a fork of:
https://github.com/banshiAnton/node-pushnotifications/tree/banshiAnton-fcm-method

That branch has an open PR here: #194 The original author has not responded in months, and this conversion is necessary before the removal of the legacy firebase API in June.

I don't take credit for any of the prior work. I simply merged the current master and addressed the outstanding PR feedback here: #194 (comment)

Copy link
Collaborator

@miqmago miqmago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ehaynes99 thanks a lot for the effort!
Really appreciate that you take @banshiAnton work and you move it one step forward.
Just a quick question about a file that seems private info in a file, is this correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is private info?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm not sure either. It was in the original fork, added in d331836

expect(firebaseMessage.android.priority).to.equal('high');
expect(firebaseMessage.android.notification).to.deep.include(messageData);

expect(firebaseMessage.apns.payload.aps.sound).to.equal(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be firebaseMessage.android.payload.aps.sound?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not according to the types: https://github.com/firebase/firebase-admin-node/blob/a37eb6cb5ad92d911d0b868f5beb8d11761bcc0a/src/messaging/messaging-api.ts#L20

the android?: AndroidConfig does not have a payload property, but apns?: ApnsConfig; does, which has a aps: Aps; that contains a sound?: string | CriticalSound; property.

messageData.sound
);

expect(firebaseMessage.apns.payload.aps.alert).to.deep.include({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be firebaseMessage.android.payload.aps.alert?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not according to the types: https://github.com/firebase/firebase-admin-node/blob/a37eb6cb5ad92d911d0b868f5beb8d11761bcc0a/src/messaging/messaging-api.ts#L20

the android?: AndroidConfig does not have a payload property, but apns?: ApnsConfig; does, which has a aps: Aps; that contains a alert?: string | ApsAlert; property.

@NicolasBonduel
Copy link

Could you add @alex-friedl as a reviewer?

@ehaynes99
Copy link
Author

Actually, sorry, I thought the original PR was in a better state, but we've found several issues. Also, this is really suspicious:

firebaseAdmin.INTERNAL.appStore.removeApp(appName);

I'm not comfortable submitting this anymore. I'm going to convert our app to use firebase-admin directly. I'll leave this branch around for a bit if anyone wants to fork it.

@ehaynes99 ehaynes99 closed this May 14, 2024
@Hossman333
Copy link

@jamesbluecrow or @NicolasBonduel Any clarification on the concern @ehaynes99 brought up? 🤔 👀

@jamesbluecrow
Copy link

@jamesbluecrow or @NicolasBonduel Any clarification on the concern @ehaynes99 brought up? 🤔 👀

Nope, I agree with @ehaynes99 (we work together).

We tested the PR and it didn't work as expected and we found a couple of bugs.

We decided to just move out of this library and use firebase-admin-sdk instead.

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

Successfully merging this pull request may close these issues.

None yet

6 participants