[Solved] Android – java Cloud Firestore : NullPointerException when converting data toObject [duplicate]

The UserSettings class has a constructor that looks like this: public UserSettings(ArrayList<User> mUser, ArrayList<UserAccountSettings> mSettings){ } This constructor doesn’t set the user and settings variables defined in this class and it is the constructor you use to create the return value of the getUserSettings method. return new UserSettings(mUser, mSettings ); // `mUser` and `mSettings` are … Read more

[Solved] i want to retrieve current logged user data from firestore but this show error [duplicate]

Change your onCreate method code to : protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_account); email = (TextView)findViewById(R.id.email_txt); mAuth = FirebaseAuth.getInstance(); UserId = mAuth.getCurrentUser().getUid(); passwordtxt = (TextView)findViewById(R.id.pass_txt); mFirestore = FirebaseFirestore.getInstance(); mFirestore.collection(“Hospitals”).document(UserId).get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() { @Override public void onSuccess(DocumentSnapshot documentSnapshot) { String user_name = documentSnapshot.getString(“email”); String password = documentSnapshot.getString(“password”); email.setText(user_name); passwordtxt.setText(password); } }); } 5 solved i want … Read more

[Solved] HOW TO ACCES ALL DOCUMENT FROM SUBCOLLECTION OF ALL DOCUMENT IN PYTHON [closed]

If I understand your post correctly you want to access a specific subcollection of all documents. If so, you are looking for a collection group query, which reads documents from all collections with a specific name. Accessing that in Python is (according to the documentation linked above) done with: museums = db.collection_group(u’landmarks’)\ .where(u’type’, u’==’, u’museum’) … Read more

[Solved] How to start building a cross platform app? [closed]

React Native is a great place to start. With today’s ecosystem lead by flutter and react, Angular has unfortunately fallen behind. Both, Cloud functions are Firebase’s solution to server instances, these create short-lived functions that do complex or secure tasks such as handle payments, delete/manage users, etc. While the bulk of your app and its … Read more

[Solved] How to get specific document data from firebase and return as a string

It works for me Widget build(BuildContext context) { return new StreamBuilder( stream: Firestore.instance.collection(‘COLLECTION_NAME’).document(‘TEST’).snapshots(), builder: (context, snapshot) { if (!snapshot.hasData) { return Center(child: CircularProgressIndicator()); } var userDocument = snapshot.data; return new Text(userDocument[“property_name”]); } ); } 1 solved How to get specific document data from firebase and return as a string

[Solved] If there is data in query or Path it show data in FirestoreRecyclerAdapter. but when there is no data at that path

I got Answer @Override public void onDataChanged() { if(dialog != null && dialog.isShowing()){ dialog.dismiss(); } if(getItemCount() == 0){ remoteListRV.setVisibility(View.GONE); msgTv.setVisibility(View.VISIBLE); msgTv.setText(“No “+ appType +” Available !!!!”); }else { remoteListRV.setVisibility(View.VISIBLE); msgTv.setVisibility(View.GONE); } } 0 solved If there is data in query or Path it show data in FirestoreRecyclerAdapter. but when there is no data at that … Read more

[Solved] iOS Error: Cannot convert value of type ‘UserModel’ to expected argument type ‘[String : Any]’

You have to convert your UserModel to [String : Any] type in order to save it on firebase. Try this: func convertUserModelToDictionary(user: UserModel) -> [String : Any] { let userData = [ “name” : user.name, // change these according to you model “email”: user.email, “user_id”: user.userId ] return userData } You can use this function … Read more

[Solved] How to add referral program in flutter using firebase [closed]

You need firebase_dynamic_links to implement a referral program, For more information visit official page How Create Dynamic Link? final DynamicLinkParameters parameters = DynamicLinkParameters( uriPrefix: ‘https://abc123.app.goo.gl’, link: Uri.parse(‘https://example.com/’), androidParameters: AndroidParameters( packageName: ‘com.example.android’, minimumVersion: 125, ), iosParameters: IosParameters( bundleId: ‘com.example.ios’, minimumVersion: ‘1.0.1’, appStoreId: ‘123456789’, ), googleAnalyticsParameters: GoogleAnalyticsParameters( campaign: ‘example-promo’, medium: ‘social’, source: ‘orkut’, ), itunesConnectAnalyticsParameters: ItunesConnectAnalyticsParameters( providerToken: … Read more

[Solved] Firebase: how to add timestamp to database in firestore – where react context api is used

To hopefully help you with server timestamp I have modified the simple react-firebase-hook app created as an answer for this question: https://stackoverflow.com/a/60504303/610053 I’ve updated my Firebase class with an extra method called serverTimestamp: class Firebase { constructor() { app.initializeApp(firebaseConfig); this.realtimedb = app.database(); this.firestore = app.firestore(); this.serverTimestamp = app.firestore.FieldValue.serverTimestamp; } } const FirebaseContext = React.createContext(null); const … Read more

[Solved] How integrate FireStore Health Check and Dashboard metrics with our internal Company systems

Here is the Official Documentation for Cloud Monitoring using which you can collect metrics, events, and metadata from Google Cloud Platform products that you can use to create dashboards, charts, and alerts. Please let me know if you have further questions. 2 solved How integrate FireStore Health Check and Dashboard metrics with our internal Company … Read more