Ionic - What about the real time and the database? - ionic-framework

I want to code a web app which can runs on IOS, Android, Mobile browser, Desktop browser.
I tried for 6 hours Meteor but I had a lot of problems ... so I just switched to Ionic.
In 2 hours I created a simple app with a Geolocation system + Google maps and I runned it with my Iphone with Ionic View, that was a good start.
Now I need to persist my datas with a real database (please don't reply firebase) and add a real time system.
What are they the right tools and the right structure to reach that goal ?

If you want firebase-like capabilities, I would recomend rethinkdb: https://www.rethinkdb.com/
Otherwise, you can try mongodb: https://www.mongodb.org/
The structure is up to you to define according to your data.

Related

Reaching Ionic specific page from URL

Is it possible to reach a specific page in an Ionic3 app , from an external source , like another website , or a python script.
I would like to know if I can transfer data to the app, but without having the app asking for the data
such functionality is typically called “deep links” for apps. Its not easy to build such experience with apps due to platform differences (ios vs android). There are solutions that abstract differences and provide good overall implementation path: branch.io.
Branch features native plugins for Ionic 3+.
You can google guides for actual implementation.

Difference between Ionic Storage and Native Storage?

I'm Actually using Ionic Storage. and I heard About The Ionic Native Storage
I Don't Know the Exact Difference Between Them. Which One Is Preferred to use?
They have basically the same purpose and both work with key/value to store items, but i think Ionic Storage is better and i'll tell why.
The Native Storage need and will only work with the plugin instaled, so if there's no plugin or if it's a webapp the user can't use the storage. It's intended to be used because iOS may remove stored data when running out of memory.
The Ionic Storage works in a diferent way, you can save your values in the IndexedDB, wich is a type of storage for the browser, but if you install te SQLite plugin it'll automatically priorize to save your data in SQLite so there's no loss when iOS is out of memory.
So when using with SQLite, if in a browser running as a webapp the user can still save data, because since there's no plugin in the web it'll use the IndexedDB, and if there's no IndexedDB then it'll use localStorage.
And you don't need to learn SQLite to save with the plugin, the Ionic Storage will do all the work for you, you just need to use the key/value as the same way you would use for the Native Script or the localStorage.
Which one is preferred? It's all up to you, but i see more advantages in Ionic Storage.
Check out the Ionic Storage Docs.
Hope this helps.
the principal difference is this:
Native Storage is a Cordova Plugin, so only work in devices. Its a little faster than Ionic Storage on devices, because uses the native functions of the device to store Key/Value data.
Ionic Storage is a not a Cordova Plugin, is a javascript library, and can be used both in Devices and Navigators.
There are no big difference between them, i prefeer Ionic Storage because i can realize faster tests on browser during development.
Nowadays I work with ionic 4 and I have experienced unpleasant latency of the #ionic/storage module, but after I switched to the native storage I got a better performance. and by the way you still can use it while testing with the browser using the ionic cordova run browser command not the ionic serve command.
So what I am trying to say that native plugins always win in the matter of performance.
Best Wishes

How to receive a push notification when you are near a specific place using a map?

I'm new to Ionic, and I'd like to know if you can give me some guidance. I am using Ionic 1. I have seen tutorials, and they use Google or one signal. But they are always basic tutorials and I have many doubts. I hope to do this for both iOS and Android.
My application has some coordinates in the database, I get them with a web service. I would like that when I'm near a place I get a push notification. I am currently using the Google Maps plugin cordova-plugin-googlemaps and the geolocation plugin cordova-plugin-geolocation.
I would like you to give me advice or if you have had the experience of doing something like this.
I also want to know if doing this has any cost.
I am using Ionic 1 and the database is built in MySQL using PHP. I think the push notification is generated from the back-end?
When I tap on the notification, can it contain an iconor redirect to a specific place in my app?
In conclusion:
What is the best alternative? I was thinking of some plugin that detects in the background when my location changes and when this happens (does the cordova-plugin-geolocation do it?) verify if I'm close to a certain place and send a local notification. For example, and when I tap on this notification I can get the id of that place and redirect to a place in my app.
I think you should try geofence
repo link
example links:
https://github.com/cowbell/ionic-geofence built with Ionic framework
https://github.com/tsubik/ionic2-geofence built with Ionic 2 framework

Meteor Cordova, How do I query the database?

I am trying out ios apps built using Cordova and Meteor. Normally when I build a Meteor App, I can see the database's fields and structures by making a mongo query in the browser console, or opening genghisapp to see the entire database. But now I'm testing out the mobile apps by plugging in my iphone and running the test app there. How can I see the structure of my data and documents on there?
Even if you're running meteor on the iPhone, you're app should still be available at localhost:3000 (unless you're doing something fancy with the --mobile-server) and be connected to the same database your iPhone is using. You could run your browser console queries in the browser and it will update/reflect whats going on in the mobile app. I used this when debugging my latest project and it works as well as using the browser console while testing out a web app.
I'll have to take a look and see if this same thing can be done with genghisapp but if you're open to alternatives check out this package
https://github.com/gterrono/houston/
it's a simple auto-magical admin dashboard that might be a good substitute for genghisapp and I know the houston package will work when you're running meteor on you phone.

Best Platform for building iPhone app?

Im looking into writing a fairly simple iPhone app and need some advice on the choice of platform. I have the following constraints:
App Requirements:
The app should be able to receive strings via a wifi network, process these and then display either a message, or show a preset photo from the library, or change the background color (or any combination of these).
Once started the app will be running continuously on the device, and be a display only client (ie no user interaction on the device itself) - just processing instructions as received over wifi.
Speed: once the strings are sent to the device, the app has to respond quickly (either display image, change color or show preset text as soon as possible.)
My Current Situation:
No previous iOS development experience.
I need to do this within the next 2 months.
I am very comfortable with: HTML, JS, CSS, Python & PHP.
I am familiar with other languages e.g. C++ but have not touched these in a long while.
Question: Choice of Platform:
I know that the best choice would be to use the native iPhone SDK, but given my time constraints and knowledge of existing tech, could tools such as Appcelerator Titanium or PhoneGap be proficient for this kind of application?
Note: At this stage I do not foresee the app being listed on the app store, its meant for personal use only, although this may change in the future.
If it would be an option to load the images from a remote server instead of the local photo library and you being already familiar with HTML/JS/CSS/PHP, why not just make an Web-App that is running full-screen?
You can use your existing knowledge and you're saving money (no $99 license fee)
You might want to try TapLynx - it's possible to create a native app without any code.
I think you can do everything you want to do with Titanium. It even supports Sockets should you need to go to that raw of a level. Native iOS development is painful and hideous.
Appcelerator is glorious and fun :]