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

Stream can be safely dispose #10

Open
bierquelle06 opened this issue Aug 22, 2023 · 0 comments
Open

Stream can be safely dispose #10

bierquelle06 opened this issue Aug 22, 2023 · 0 comments

Comments

@bierquelle06
Copy link
Member

bierquelle06 commented Aug 22, 2023

Depending on where the Stream object comes from, you need to be aware of whether the caller is responsible for disposing of the stream after creating the FirebasePushNotificationSender instance.

Solution: Clearly document in the constructor's documentation or method signature who is responsible for disposing of the stream. If the caller is responsible, provide guidance on when the stream can be safely disposed.

Can be help to this code block :

public FirebasePushNotificationSender(Stream stream)
{
using (stream)
{
var firebaseApp = FirebaseApp.Create(new AppOptions()
{
Credential = GoogleCredential.FromStream(stream)
});

this._firebaseMessaging = FirebaseMessaging.GetMessaging(firebaseApp);
}
}

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

1 participant