Posts

Showing posts with the label firebase

Why am I getting AbstractDynamicObject$CustomMessageMissingMethodException error?

41 3 I have just started a new project and am trying to connect to Firebase. As soon as I try to build my project I got the error : Could not parse the Android application Module's Gradle Config, so I looked in my build which told me that jCenter() was deprecated and that I should remove it. When I removed it, everything worked fine. However, when I tried to connect to Firebase I got the error: AbstractDynamicObject$CustomMessageMissingMethodException. What may be causing this? Full stack trace: Caused by: java.lang.RuntimeException: com.android.build.gradle.internal.crash.ExternalApiUsageException: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method setVariantDir() for arguments [debug] on task ...

Firebase for react and react native

I'm planning to write a cross platform app using react native using Firebase for backend. I did some research and found the library called React-Native-Firebase. But this library seems to use native part of firebase(android and ios), and my concern is: If I use React-Native-Firebase to do backend jobs, will I need to write those logics AGAIN using normal Firebase(web version) for building web app with react? I thought this way because using firebase seems basically like calling Firebase API's in react native or react code.

Error when running Firebase 3.0 with React Native

Just loaded firebase 3.0 with react-native and getting the error [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Can't find variable: document Is react-native supported yet? React-native code: var firebase = require('firebase') // Initialize Firebase var config = { apiKey: '<apiKey>', authDomain: '<app>.firebaseapp.com', databaseURL: 'https://<app>.firebaseio.com', storageBucket: 'firebase-<app>.appspot.com' }; firebase.config(config) Firebase JS SDK 3.1 just got released and is now compatible with React Native! See release notes. The newest version of firebase uses the document variables that are used in web applications and the RCTWebSocket or RCTView doesn't work the same way. (I'm not 100% sure about all the details). Anyway, you can just install an older version of firebase and it will work for you. Assuming you have npm...

Firebase Analytics for React Native

Has anyone successfully run Firebase Analytics in React Native? There is a react-native-firebase-analytics but it's installation documentation and support is poor. Also it does not install the plugin correctly. If you have been working on FB Analytics in React Native project, please share your tips. Thanks. Are you using firebase sdk for web with react native? Analytics, offline capabilities etc, won't work with the apps if you use firebase sdk for web, check react-native-firebase which acts as a native bridge and enables all the functionalities of firebase for mobile. It has great documentation! refer : Firebase + React Native: Offline authentication Edit: I was able to get offline capabilities with in the app using redux-persist independent of the firebase sdk. Agreed with what you have said. I made that work by linking manually and run command adb shell setprop debug.firebase.analytics.app "package_name" in react-native cli for enabl...

Firebase Invites for React Native

We are currently using Firestack on a React Native project which is great, however we also need the features available via Firebase's "Invites" capability. Is anyone aware of a React Native module (eg on github) for Firebase Invites, iOS and Android ? Or alternatively - is there another service/API that can provide similar app invite management for mobile (ideally w/ React Native support but we can always bridge if needed) ? Many thanks. Firebase invites is based on Firebase dynamic links: Firebase Invites React-Native-Firebase is a great open source library to use Firebase with react native. React-Native-Firebase The library supports Dynamic Links so with a little work you can use it to enable the Firebase Invites feature. React-Native-Firebase (Dynamic Links)

React Native package conflict: native-base x react-native-firebase

Today I created an (empty) Android app using the "react-native-firebase" and "native-base" packages. It works in debug mode, but in release mode crash occurs. Steps to reproduce the problem: Create a new app react-native init BaseTest cd BaseTest Install the "native-base" npm install native-base --save react-native link Install the "react-native-firebase" https://rnfirebase.io/docs/v3.1.*/installation/initial-setup https://rnfirebase.io/docs/v3.1.*/installation/android Generating Signed APK https://facebook.github.io/react-native/docs/signed-apk-android.html Build release and install cd android gradlew assembleRelease adb install app-release.apk I could not find the error. Does anyone have any ideas?

flutter get user email

i want to get my flutter login form user id into a text box.i used firebase to make authentication. i wrote a method to get user email. _getUserEmail(){ FutureBuilder<FirebaseUser>( future: FirebaseAuth.instance.currentUser(), builder: (BuildContext context, AsyncSnapshot<FirebaseUser> snapshot) { if (snapshot.connectionState == ConnectionState.done) { return new Text(snapshot.data.email); } else { return new Text('Loading...'); } }, ); } i want to get this user email into my flutter textbox view initial value. This is my flutter textbox. ListTile( leading: Icon(Icons.info), title: TextFormField( decoration: InputDecoration( labelText: 'Enter Your name' ), initialValue: _getUserEmail(), onSaved: (val) => item.name = val, validator: (val) => val == "" ? val : null, ), ),...

flutter firebase database initState issue

My app has a object Company that has an attribute shopList. The shoplist will get data from firebase database in void initState() . Company(name: 'Storm', about: 'xxxxxxxxxxxx', backdropPhoto: 'assets/hk.jpg', shopList: [], location: 'HK', logo: 'assets/logo.png', president: 'Grand Production House'); The shoplist is supposed to have 5 different shops, but I don't know why it will have 5 shops with the same data. Code: class CompanyDetailsPage extends StatefulWidget { CompanyDetailsPage( {@required AnimationController controller, this.context}) : animation = new CompanyDetsIntroAnimation(controller); final BuildContext context; final CompanyDetsIntroAnimation animation; @override _CompanyDetailsPageState createState() => _CompanyDetailsPageState(); } class _CompanyDetailsPageState extends State<CompanyDetailsPage> { Shop shopItems; Company storm = Company( ...

Dismissing AlertDialog in Flutter

I have simple Flutter app with list of items that are loaded from Firebase database (Cloud Firestore). As you can see - there is button for adding items and each item can be deleted or edited. When I press edit button for selected item, AlertDialog with TextField appears, in this TextField user can see current item name and edit it. I have problems only with dismissing dialog after editing. new IconButton( icon: new Icon(Icons.edit, color: Colors.white), onPressed: (){ showItemUpdateDialog(context, document); } ) ....... void showItemUpdateDialog(BuildContext context, DocumentSnapshot item) { String itemName = ""; var textContoller = new TextEditingController(); textContoller.text = item['name']; var dialog = new AlertDialog( title: new Text("item name"), content: new TextField( controller: textContoller, onChanged: (value) {newName = value;}, ), actions: <Widget>[ new FlatButton( ...

Flutter firebase handling exceptions

I am trying to catch the exceptions thrown by Firebase (from failed login) to flutter but I am having zero luck. .catcherror seems to print out the error but an exception is still crashing my code. I have found similar issues in other posts but no answers seem to help me, it's making my code unusable, thank you so much. try { signIn(typedemail, typedpassword).catchError((e) { print(e); print(e.message.toString()+"rrrrr"); print(e.code); print(e.details); }); } on PlatformException catch (e) { print("on worked");//this doesnt work } finally{ print("finally"); } And I get this if I disable breaking on exceptions D/FirebaseApp(11795): Notified 0 auth state listeners. I/flutter (11795): PlatformException(exception, The email address is badly formatted., null) I/flutter (11795): The email address is badly formatted.rrrrr I/flutter (11795): exception I/flutter (11795): null

cloud_furestore and firebase_auth compatiblity issue in Flutter

I am developing a Flutter app. My app works fine with cloud_firestore and firebase_auth packages when I use them separately. However, when I include both of them together in my pubspecs.yaml file, the build fails and the following message is shown: Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.4/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /home/saber/Code/mobile_dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.18/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses unchecked or unsafe operati...

Flutter Map error

I want to build an App using Flutter and Firebase (Firestore version cloud_firestore: ^0.6.3). When loading a Collection from Firestore using StreamBuilder to display it in a ListView I get an error saying: The following assertion was thrown building StreamBuilder(dirty, state: I/flutter (26287): _StreamBuilderBaseState>#d5638): I/flutter (26287): type '_InternalLinkedHashMap' is not a subtype of type 'Map' I/flutter (26287): where I/flutter (26287): _InternalLinkedHashMap is from dart:collection I/flutter (26287): Map is from dart:core I/flutter (26287): String is from dart:core I/flutter (26287): And I can't get my head around because even when removing the lines the use the DocumentSnapshots it throws the error. This is how I want to acces the filed in the Snapshots. Creator.fromDoc(DocumentSnapshot doc) { this.creatorId = doc['creatorId']; this.name = doc['name']; } Or Creator.fromMap(doc.data); Creator.fromMap(Map<String, dy...