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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摎 Documentation: Wrong Logic For Android FCM x Messaging #803

Open
2 tasks done
ItzNotABug opened this issue Mar 16, 2024 · 0 comments
Open
2 tasks done

馃摎 Documentation: Wrong Logic For Android FCM x Messaging #803

ItzNotABug opened this issue Mar 16, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ItzNotABug
Copy link

馃挱 Description

The documentation here mentions using a FirebaseMessagingService for updating the push targets for messaging.

However it uses this logic -

class MessagingService : FirebaseMessagingService() {

    companion object {
        var account: Account? = null
    }

    override fun onNewToken(token: String) {
        // get token, save to sharedPreferences.
    
        // check if account is null
        if (account == null) {
            return
        }
    
        // update push target
    }
}
  1. The default value is null, then never initialised (as per the documentation)
  2. The check would always return true & the push target will not be updated

Note: The example repository properly manages this, however the usage of Account variable looks unrelated & incomplete on documentation.


Also, there is a mention of targetId which I do not think is something used by the SDK internally.
It is not saved in the SharedPreferences the first time the token is retrieved but only managed in the above mentioned Service. Also Its better to provide a small explanation about this as well.

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@ItzNotABug ItzNotABug added the documentation Improvements or additions to documentation label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant