How to check if Firebase updated remotely? - angularjs

I have an app that uses AngularJS and Firebase (with AngularFire API), but I'm getting some problems with the $bindTo service. Sometimes users are loosing data because there is no good connection in my city, our internet is too slow. I was thinking to create an icon in my app that shows the user if its data was updated successfully or not.
How I was thinking to do it?
- Watch the object
- On data changed, the icon becomes red
- When data is saved on Firebase, returns an event that change the icon color to green
How can I do it? Is there a better way to deal with it?

Check out https://www.firebase.com/docs/web/guide/offline-capabilities.html
This gives example of how to check out connection status and event handlers to deal with such situations .

Related

Google Analytics Goal Funnel Count has number differences with Production Data

I have this funnel visualization problem in Google Analytics. I have set up the funnel using the virtual pageview like so:
So basically what it tracks is that in activity page, when user clicks a button, it will show up a modal for registration and hits the /activity/virtual/open-volunteer-modal. After they fill out the forms, they click Register, and it will hits the /activity/virtual/submit-volunteer-modal.
Everything was fine, until I saw some difference in GA and Production values.
In GA, there are 3000 users that filled out the forms and submit their data. I was totally happy seeing this, but:
In Production DB, I only got 1906 users submitting their data.
I checked the code, and there is nothing wrong with it. It basically send a virtual page view when the value has been validated, so my question is how is this possible and is there any way to fix this? Or is it just intended behavior?
After further investigation, I found that some of the buttons that has open-volunteer-modal event is redirecting to submit-volunteer-modal. Hence, the submit-volunteer-modal value was bigger than the open.
Should have sipped some coffee first before working.

How to have a screen intermittently render in React Native (with Expo)

I'm building a React Native (with Expo) app and have a survey form screen that I want to have appear intermittently for the user to fill out. Let's call it SurveyScreen. I'm doing this by setting a setInterval to poll the backend server hourly for scheduling data to see if the user is due to fill out a survey. This will probably be done in the main App.js in componentDidMount
The above seems straightforward to me. What I'm not clear on is once the polling api determines that the user is due for a survey, how to have the app display SurveyScreen no matter what page the user is on in the app.
One point of clarification is should SurveyScreen appear immediately after receiving a green light api response or should the screen appear after the next user action, e.g. navigation to another page, tap a button, etc? I think either way would be fine at this point. Would love to know both ways if possible.
Any ideas? Thanks.
Update the state.
Example: you subscribe to api => event fires => you update state => survey pops up
You can use portal to easily position survey on top of everything.

Xamarin forms - Periodic list view data refresh

We are building Xamarin forms app to run on iOS, Android and Windows 10. We are data binding view model to UI which has List View control. We want the data to be refreshed from rest service, every 3-5 seconds when user is viewing the app. We don't want the data to refresh when app is in background, but refresh the data as soon as app is foreground. I tried using Xamarin.Forms.Device.StartTimer and await Task.Delay, but this does not seem to be working very well, sometimes the data does not refresh when not in interactive debug mode especially with Xamarin.Forms.Device.StartTimer , I am not sure what is going wrong as I am not able to do logging on device. On using await Task.Delay, sometimes the Task gets cancelled. In app onresume event, code makes rest service call which fails with connection refused error.
So I wanted to know which is the best way to handle data refresh, any ideas?
Thanks in advance
At last to do periodic refresh, i used Task.Delay and a boolean variable to known whether refresh needs to be performed or not. If user navigates away from the page, i set the boolean variable to false to stop the refresh.

Geoloqi Geofencing Logic Flow

All,
I have been looking high and low for a solution and at this point I am baffled. I am not looking for code here. I am just looking for the proper logic flow to alert users of my app that an event is taking place nearby using Geoloqi.
My platforms:
Geoloqi: Geofencing
Appcelerator Cloud Services: User, Event and Message Management
Language: javascript
Mobile: iPhone and Android
What I am trying to do:
1) I want users of my app to be able to create an event, then create a trigger based on that event.
2) I want users of my app who are near the event to be automatically alerted that the event is happening.
What I have so far:
1) Create an Appcelerator Event - Works fine
2) Create a Geoloqi Layer including the Appcelerator EventID - Works fine
3) Create a Geoloqi Trigger for the above layer - Works fine
I can see everything getting to the Geoloqi debugger. I just don't see the alert going out. I saw a post that the anonymous user needs to subscribe to the layer in order for the trigger to send to my users inside the trigger geofence. I just don't understand how to do that. I have tried several code permutations around the user/create_anon method with a key using either the anonymous username or the user access token to subscribe to the layer with no luck. I have tried using the access token returned on init as the parameter to subscribe with no luck.
I am wondering, however, if I can get the same effect by using a place instead of the layer, and avoiding the subscription issue. I somehow doubt this as the place has to reside in a default layer.
Color me confused. I already went through hell and back just getting the push certs set up for Apple, so any and all help is greatly appreciated.
Thanks,
Bruce
Bruce,
I'd recommend hitting the geoloqi developer IRC channel. You can get to it from one of the developer pages on their website. The geoloqi guys are usually online and they've been very helpful to me in the past.
If you do get it working, I'd love to hear the solution/flow for it! Hope that helps!
Tyler
OK, so here is what I am doing. Not sure yet if it is the answer, but I think it will work.
Create a default layer with no boundaries and a key that is the same each time the app runs. This will ensure the same layer is used based on Geoloqi's anti-dupe logic.
Create an anon user using the logged in user's email address since I am using Appcelerator to handle the user management. If I understand this correctly, this will also ensure the same anon-user is used if the user logs in again later. The anon user is automatically subscribed to the default layer.
When the user wants to create an event, the app creates an event on Appcelerator, creates a layer with a radius of x, a trigger on that layer, and sends a broadcast message to all users in the default layer using the trigger centerpoint and radius to limit the message to the immediate area.
If the user wants to cancel the event, the app sends a broadcast message to the default
layer in the same way the layer was created, then deletes the Appcelerator event and the layer.
I have all the code hooked in except the anonymous user. I can see the triggers being set and the messages being created on the Geoloqi Debugger, but I don't always get them. I'll be hooking in the anonymous user next week, so we shall see.

Populating data in Silverlight App before its sent to he browser

I have a Silverlight App which gets its data from a database. My Silverlight app (running in the browser) retrieves the data through a web service. Pretty standard setup.
But there is some data which has to be there all the time or the App is in an invalid state - think data to fill drop downs etc. So I need this data to be "pre-loaded" into the App before it's sent down to the client so that it's never in an invalid state. Today I load this data via a web service call when my first page is initialized which can some times take a few seconds - during that time my App is in an invalid state.
Is there a way to populate data (from a backend database) in my Silverlight App before it's sent to the browser?
It is valid for an app to start and not be ready to use for a while, so long as the user cannot interact with it (or see the broken bits:))
Better to ensure your app has a splash screen/login page etc that displays until such time as the required resources are loaded. Once loaded you can set an app state to then show the main screen.
I had the same problem with a website that loaded the menu items via a service (as the text was data driven). Wound up running a progress spinner over the top (with a full-screen background).
I don't think you can. The application runtime occurs on the client's machine. I would suggest putting up a loading dialog while you bring those items down from the database.
What HiTech Magic said. Best practice for this is to use a splash screen or login page. You can also have your buttons (and interaction) disabled by default, and after the data is loaded, enable the UI. I would go with the spash screen though..

Resources