I have a android and IOS shopping app to which I need to send push notifications whenever a new promotion is stored in the db. We have mongodb as our database and we setup uniqush as our push notification server. Now, I need advise on building a robust integration system that polls the offers document collection in the db and sends it to Uniqush over http. What technologies/frameworks should I use and is there any open-source ready-made system?
I have tried simple implementation of Meteor Livequery but it is not suitable to handle more than 100K users that use this app.
We are running on CentOS distribution
Any suggestions are welcome.
Thanks
There isn't a system ready for that, but there's a variety of languages out there with libs for mongodb and some with clients for uniqush. I worked on a simple ruby wrapper for uniqush. Mongoid is the most popular MongoDB client for ruby.
You can build a system that relies on chronjobs pulling the newest documents from mongo every few minutes, or you can use Resque to enqueue a job to run on the background to generate and request push notifications to the uniqush-push server every time a offer is created.
Resque would be a my preferred option as it's pretty standard and straightforward.
Now, you may find ruby being too slow for your user base, then you can try to use golang, which is the same language as uniqush-push--though this is completely irrelevant, which is a really fast language and have all required libs to connect to mongo and you can create a client for uniqush-push fairly simply with the net/http standard lib.
You can try to integrate 3rd party libraries like MixPanel, Parse
They all support push notifications and also Android\iOS easy integrates with them.
They can handle that amount of notifications, and always you can send not
all at once, but maybe few as a batch.
Related
I am learning android. In a video course I came across parse sdk. I am still confused about why should I use parse in my android application. Is there any other alternative for it?
Parse is an open source framework to build and host your back-end.
But I'm not sure if you should use it any-more because parse is shutting down soon..
So I will suggest to raise question in Q/A of your video course, what's the alternative they can provide for learning purpose
With the increased use of mobile devices, it is common for applications to offer features such as backup storage, data sync, data sharing etc. Building stand alone applications that only function and save their data on the device they are installed on is at times not feasible. A backend is usually needed where data can be saved and manipulated for the app to provide the service it was intended for.
Building this requires time, a different skill set and other resources (e.g. servers, push notification services, etc). Fortunately, there are several platforms that provide ready-made customizable backends that you can integrate with your apps. These are known as ‘Backend as a Service’, or BaaS in short.
Parse is one of the more popular Backend as a Service platforms. The service offers three products in one package: Parse Core, Parse Push and Parse Analytics.
Parse Core generally handles the saving of data and social media integration.
Parse Push is used to send push notifications. It enables the developer to customize, schedule and send push notifications to either all registered users or a select group of users.
Parse Analytics enables you to track your app’s data. You can track usage data such as installations, active users, user retention, push notification open rate etc.
You can get more information from here https://parse.com/docs/android/guide
You can still use Parse if you like. Parse Server has been made open-source and there are now more options for hosting a parse based application than ever (https://www.back4app.com/ and https://www.sashido.io/ are two examples, there are many more or you can host your own). Parse.com is shutting down but it seems like Parse Server is going strong. The open source parse server does not include all the features that parse.com had but if you are starting to learn based on one of these new options that will not matter to you.
I am trying to create an android application in which an user will pretty save some data in database-like user data, photos and also be able to retrieve.
But I am clueless how to set up a server, connect to some database etc.
Can somebody help me point to right resources for end-to-end installation of server, database, and its interaction with the android application
Just set up a basic server that works over HTTP, and use HTTP libraries for android to make requests and handle results in the device. There are plenty of technologies with which you could make the server, just google building REST API with PHP/.net/java (whichever language you are comfortable with).
If you are mobile app developer and want to create server-client app then better use any back-end service rather than implementing new by own. Some most advanced and simple to use services are Parse and Firebase , BaasBox also there are many more.
And the plus point is this services free of cost until you have very large users.
I am currently using Windows Azure with Android and need to sync data between sets of users using PUSH notifications.
For example: User A uploads data to Azure which is stored in the SQL DB. That then needs to be pushed down to a specific set of devices and stored locally in SQLite.
What is the best design pattern for this? Should I be pushing the data with the PUSH notification or be using PUSH as a prompt for the app to then connect with azure and download the data.
Thanks for any help.
I'd think you would want to send a notification to the device that prompts the user to launch the app, and then the app fetches the data. I don't know how Android push services work, but I'd assume there is a fairly limited amount of data you can send in a single notification.
The best way to accomplish this is to use Windows Azure Mobile Services and the unoffical Android SDK.
The unofficial Android SDK can be found at: https://github.com/goldshtn/wams-android
The benefit of using Mobile Services in this case is that it's super easy to writer server-side scripts on INSERT. After you connect your project to a Mobile Service, you'd then head to the 'Data' tab, select the appropriate table, and then head to 'Script.' Pick INSERT from the dropdown, then write a function that sends a push notification to the designated subset of users. You'll need to write this in JavaScript.
There's some code you can work from included with the unofficial SDK, but if you check out https://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-dotnet/#update-scripts you can get a sense for the steps you'd follow for an app on any platform (though the tutorials will only walk through Windows Phone 8, Windows Store, and iOS at the moment).
I'm doing a chat application accessible via native apps on the iPhone and Android. I've spent some time researching how it would be done, but I sill don't have quite a good grasp of it yet. For example, I've seen and followed the tutorial on mobile tuts here (http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/)
However, let's say that I want my chat apps to be able to go beyond the login/check & send messages, how would I do that?
For example, one feature I would like to add is to be able to search the userbase for criteria such as:
users online now
users who meet certain critera (location, age, etc)
If, for example, I am using ejabberd or Openfire as my xmpp server, how do I add these new custom APIs that would be accessible from iPhone/Android?
I'm just making a rough example here, but maybe it would be nice to be able to do something like this:
-(NSArray*) findUsersInCity:(NSString *)cityName
How would I be able to make the xmpp server pass me back a list of those users who match the cityname criteria?
Thank you in advance!!
There are several different ways to extend an XMPP server:
XMPP Component
Components exist separately to the XMPP server. You can write them in pretty much any language and they connect to the XMPP server following a protocol (http://xmpp.org/extensions/xep-0114.html). A component registers to handle a subdomain of a server and any messages/IQ's addressed to that component are passed straight from the XMPP server to your code, for you to process and respond. For instance, a message could be addressed to user#search.domain.com/resource instead of user#domain.com/resource.
The benefit of a Component is that it should work with any XMPP server (that supports components anyway, which are most of the main ones). Should you change from Openfire to ejabberd for instance, you shouldn't have to do any work. The downside is that they can't access data within the server itself. Fine if you want to provide access to external data (say your own database) but might not be sufficient.
Plugin/Module
These are server-specific and must be written in the same language as the server. Openfire has plugins, ejabberd has modules. These can integrate with the XMPP server and give you far more options. Switching XMPP servers would require starting development from scratch however. If you want to make a plugin for Openfire, have a look at the Plugin Guide and the Openfire API: API Docs. The API is extensive and you can get at most of the data available to the server.
Modify Source Code
Not a good option but possibly worth mentioning - you could download the source code for Openfire, make your modifications and re-build it. I would only do this if you were certain the API can't give you what you need.
I'm planning on constructing a large application. It will have a browser based interface along with a mobile application interface (iOS, Android, blackberry).
I would like to be able to push data from the server onto these interfaces, and there will be a lot of data being sent from the mobile apps back to the server. So my question is what kind of server am I looking to build.
I'm a PHP developer mainly, though I can write in Java and have dabbled in others. I'm fine with learning a new language. My thoughts as a PHP developer is that I could just build a PHP application and use it's API to power the other interfaces.
However there will be a lot of data moving around and I don't feel like PHP would be the best base for this really. So I'm exploring alternatives. Any thoughts on where to start with this?
you can use a framework like Rhomobile's Rhodes that generates your browser based clients and they also offer a server component: http://rhomobile.com/products/rhosync/
Common practice would be to separate out the backend functionality between different servers.
Server 1: serve up your static content
Server 2: serve up your dynamically generated content (things based on queries that require IO such as DB interaction
Server 3: dedicated realtime infrastructure for the realtime push functionality
Server 1 & 2 could probably be the same server for now but I'd recommend having a dedicated realtime server. Communication between servers is normally done with some sort of message queue although web service calls are also an option.
My area of interest is realtime push so here's a bit more information on that. If you want to stick with PHP there's the phpwebsocket project. If you want to look at Java then there's [WaterSpout}(http://www.spoutserver.com/), jwebsocket and Jetty which has been around for a while and is (or was the last time I checked) used by the Twitter Streaming API.
There are more options for the realtime component of your solution on this Realtime technologies guide which I'm maintaining.