Currently angularfire2 allows you draw from cached data by importing AngularFirestoreModule.enablePersistence()in app.module file.
I'm wondering if it's possible (and how) to do this dynamically after the app has been initialized.
The reason i'm trying to do this, is currently enablePersistence only works on one tab in a browser, but works great for mobile. I would love to just disable it for the web and have it enabled for mobile.
Currently i'm using Ionic for development just in case that helpful.
From the reference documentation for enablePersistence():
Must be called before any other methods (other than settings()).
So you can enable persistence, as long as you haven't made any other Firestore calls.
Related
I have developed an app (my first app) that's currently on app- and playstore. I'm using Firebase/Firestore as a back-end/database. I'm about to start to work on the next version of the app, which will require me to modify my database for testing and such. However, I currently have about 100 regular users on the app and I wouldn't want them to experience any weird data changes on their app while I'm developing.
I'm simply not sure about the way it's done when you further develop an existing app. I was thinking of creating new collections in Firestore simply for testing and hook my app with them but I don't know if that's the best way to go.
How do I work on a new version of an app without my users seeing any changes in their data?
If your data model is (very) simple you could create some specific, temporary, collections as you describe, but this is quite an error-prone approach (risk of modifying existing data, wrong or missing security rules, etc..) and is not recommended.
One standard approach is simply to create another Firebase project which is totally isolated from the production project. You will need to change the Firebase configuration in your Flutter app. If you need existing production data in your test Firebase project you could use the export/import mechanism.
I´m creating an app with nativescript and i need push notifications, so i read about onesignal and it looks promissing, so i have created an account with them, follow the instructions for ios, then they sent you here where you are suppose to configure the nativescript SDK for your mobile app. Well, i´m not using typescript, so my first question is:
Where is the javascript version to configure the nativescript SDK,
does anyone knows?
My second question is related with the data that my app receives, which is throught a database, i have a webapp and everytime a user INSERTS in the database, a listview in the nativescript app is "fed"...but when this happens, i need the script from onesginal to send the push does anyone ever used it?
Thanks for your time
Regards
TypeScript makes it easy to maintain large scale JavaScript applications, NativeScript or Angular itself is written in TypeScript for same reason. So personally I would recommend getting started with TypeScript for better.
If you want to convert TypeScript into JavaScript, simply remove all typings from your code, replace import statements with require. At least this should work in NativeScript environment as it supports most of ES6 syntaxes. If you prefer ES5, simply use any online compiler to get JS version of same code, TypeScript Playground for instance.
Also NativeScript docs got examples for extending app delegate in JavaScript if you need further guidance on this.
I don't think the plugin provides any interface to handle notification data at the moment. If you are familiar with the native apis, you may directly access them from JavaScript to access the data sent from server. If possible, I would recommend migrating to Firebase which supports end to end integration with proper examples.
I have built an iphone app that writes data to firebase. That works fine. Now I want to display that data on a website. I am totally new to programming, and had to learn swift from scratch.
So my question is; is there a easy way to display the data on the webpage? It dont have to look good as long as the data is displayed. I'm not sure if I'm able to learn another codelanguage just yet ☺
To build a web site you'd use a combination of HTML (for the layout of the web site), CSS (for the actual look of the web site) and JavaScript (for the logic of the web site). JavaScript is indeed a different language, but a second language should be easier than your first one.
I recommend studying the Firebase Database documentation for JavaScript and taking the Firebase codelab for web. They are the best ways to get started with Firebase.
You may use the Firebase JS SDK
https://firebase.google.com/docs/database/web/start
use Nodejs to generate static HTML
or
use Express as the website framework, dynamically generate the pages
I currently have a side project React Native app running everything through Firebase. I want to add a social feed. I've been able to use getstream in client mode by turning off the debugger, but after a day without the debugger I've realized that's unacceptable. So my options are:
Put the getstream related code in Firebase Functions:
get: This really could be on any server
follow/unfollow - Trigger from database update
addActivity - Trigger from database update
Write my own social feed code using Firebase. I hate reinventing the wheel and I think getstream would make potential future features like notification/aggregated feeds easier.
I was able to use Firebase Functions to generate the secret feed tokens. If only I could use the Chrome Debugger with getstream. It seems like I'm not in a very unique position and this should be supported.
I am new to react-native, and I am going to develop an application by using third-party library called react-native-maps. Currently, everything just working find with online map as this third-party library is used google map. But my problem is went I move to offline mode it would be caused a problem for my application.
My question is there any possible way to make google maps downloaded/cached when the application is load with the specific bound area of a country?
Thank you in advance.
As far as I am aware there is not a way to use the react-native provided MapView to cache the map data. At this time the only offline react-native module that supports offline mapping is react-native-mapbox-gl. I have used it in one of my projects and it is fairly simple to get up and running. The biggest issue with this project is it is still very pre v1.0 in terms of bugs. For basic cases it gets the job done.
Another project I have found has a lot of great features and has a snapshot function that I think could be used to mimic an offline map. I have not tried this but I am evaluating it at this time. react-native-maps
It would function as such:
The app can set aside a cache of a maximum size.
As the app requests tiles, these are cached to local storage.
There is an interface on the map object that enables you to cache a particular tile in the map at a particular zoom level.
The app periodically scans the cache and deletes items in LRU order until it gets under the maximum cache size.
Let me know if the maintainers would accept a pull request like this and I can work on it.