Skip to content

Stream can be safely dispose #10

Open

Description

@aykut-aktas

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);
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions