Skip to content

ParsePush token not registered immediately #1071

@Azaratur

Description

@Azaratur

Documentation says that onNewToken is called upon the first app start, but that's not true.
It's called only when a new token is needed, so if you add ParsePush on an application that already implemented firebase cloud messaging, this method will not be called so ParseFCM.register(token); in ParseFirebaseMessagingService it's not called too.

To fix this we can simply add this on application onCreate:
FirebaseMessaging.getInstance().getToken().addOnCompleteListener(task -> { if (!task.isSuccessful()) { return; } String token = task.getResult(); ParseFCM.register(token); });

Can be this implemented some where in Parse Push library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions