Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

createId(), messaging.messages and messaging.tokenChanges in v7 #3062

Unanswered
metalllus asked this question in Q&A
Discussion options

Hi, I was wondering what are the equivalents to these methods in Angularfire v.7

  1. Firestore - createId() method which should create an id for a document to be created in Firestore
  2. Messaging - tokenChanges() method which should return an observable emitting the token every time there is a change
  3. Messaging - message() method which should return an observable emitting the push notifications from FCM.

I am migrating to v7 from v6 and I was not able to find equivalents for the methods above. Any help finding the new equivalents would be greatly appreciated.

You must be logged in to vote

Replies: 1 comment

Comment options

From what I can tell, the createId function is no longer available. However, looking at its source code, it seems like a pretty simple utility function that you can define yourself like so:

import { collection, doc } from '@angular/fire/firestore';
createId(): string {
 return doc(collection(FIRESTORE_INSTANCE, '_')).id;
}
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /