What is the best way to set up a system that checks for events daily and sends messages via email, Twitter, SMS, and possibly Facebook? Keep in mind, that I do not have access to a web server with root access (Using Rackspace Cloud). Would PHP have a solution for this? Would there be any drawbacks to using Google App Engine and Python?
If you are using Google App Engine with Python you could use "Cron" to schedule a task to automatically run each day.
GAE also allows you to send emails, just a little tip: make sure that you 'invite' the email address used to send mail to the application as an administrator so that you can programatically send emails etc.
Related
I am new to swift and was wondering how could I send commands from a server to my iOS application ? For example imagine a website where I can click a button and that button would then trigger a pop up to all users of my app. Is this possible and if so can someone lead me in the right direction?
Much appreciated
Yes, you can
Silent Push Notification: Send a Silent Push Notification and handle in your app. But you need user permissions to receive Notifications. Add "content-available" : 1 to your notification content.
Using Sockets: There are many options to create connection b/w device and server. example: https://socket.io/
It depends what you are trying to do, you might want to look at apple push notifications and see how they work. From there I would suggest looking into sending notifications to the apple server (that would send the push notifications to the app). I hope this sends you in the right path good luck!
I just assume that you have an application that a number of users are using and you have a web application that can show all mobile users.
For the most of cases, whenever a user is using the application, you let the application send a request with your user's information to your server and your server records the user information in the database.
When your website wants to show all the users' information, it just fetches all the information from the database instead of sending sort of commands to all applications to get information in real-time.
Of course, there is a more complex way to send commands to all running applications to get the results. However, it requires both server-side and client-side (ios application) implement functions sending commands in real-time using Socket or MQTT etc. This is more complex and it requires iOS application running in front or background at the same time.
I assume that using HTTP to record every mobile user is more suitable for your case.
I am currently using pubnub chat in one of the my application. And now I want to add functionalities like on each and every chat message I want to send mail,same as upwork website is doing.
For the same I have contacted pubnub support but they are not providing any such feature, So I need to send mails from my end, mostly by calling ajax and send mail from php.
But the major issue here is as its chat feature may I need to send number of mails (mass mail) in very short time. So my server doesn't supports it.
So how to implement mass mailing.
Check Out PubNub BLOCKS
PubNub BLOCKS is a set of customizable microservices that give
developers a simple way to add code and deploy features for realtime
apps. PubNub BLOCKS execute business logic directly on the data
streaming through PubNub’s network without splitting it off to an
intermediary server controlled by the customer. This revolutionary
approach streamlines app development, reduces endpoint-to-endpoint
latency, and allows apps to better leverage the enormous scalability
of PubNub’s Data Stream Network.
Sending email (or a Tweet, SMS, etc) with every published message, or only messages with an attribute such as email=true, is something that will be implemented as a BLOCK that you will be able to use out-of-the-box. Custom BLOCKS can be implemented to do whatever else you need to do for every message or certain messages without your server(s) getting invovled.
With cakePHP I would suggest saving the E-Mails to be sent in a queue with a short Ajax call. This can be done with a json view. Then you can create a cron that calls the CakePHP Shell to send the mails with the standard CakePHP Mailer.
If the Mails are time-critical or you don't have access to the server (cron) you can also send the mails directly on the ajax call. The advantage of the cron is that the call (from the browser) is short and that the mails (depending on the server) might need more time to be sent.
Here is an answer that might help you implementing it.
I need to send push notifications to my app from my server and i am thinking to use urban airship and i am using PHP at back end. As much i got from urban's documentation ,my server need to send message to urban's server and urban's server will forward it to devices
Now ,i want to automate the process of sending of message from my server to urban's server. Actually, at my server, i am executing a script that go through database and fetch list of users to whom message need to send. so please guide me regarding automating sending process.
Yeah, you can use UrbanAirship (UA) for that. They provide a REST API (http://docs.urbanairship.com/connect/index.html) you can use to send to your audience (UA slang for your users).
So you basically just have to
use UA SDK in your apps. Basically, they will take off when you start your app, register with Google / Apple for push notifications and give you back a token that you have to store in your database
Handle any event where you want to send push notifications in your script
get call the data for the users from your database, i.e. the device type (android / ios / windows phone) and the token you received from UA for that user
send the data to UA in the way they want it (http://docs.urbanairship.com/connect/connect_send.html) and your good to go
If you want to run your script periodically I would propose just using a CronJob (https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job) that runs every X minutes / hours / days
I need to make chat application for android. I thought of using PHP script to implement the chat application. Basic idea is to send message form android client to PHP script and making use of PHP script send the messages to the MySQL database. These messages will be broadcasting to other people. But the problem is auto broadcasting messages to other people. Is there a way to do this using android and php?
You can do the following
Make a persistent tcp connection between your device and the PHP server
When a message is broadcast send it over the tcp connection of each device
On the device process this notification and you are good to go.
If you want to use Java on the server side I have your project already finished and ready to ship ;) (just kidding)
But if you are interested check out the Device-To-Device messaging framework of OpenMobster Mobile Cloud platform. The project is free and open source. Here is a link to the Device-To-Device Framework: http://code.google.com/p/openmobster/wiki/D2DPushFramework
and http://code.google.com/p/openmobster/wiki/PushFramework
The above three steps are already taken care of by the framework. The developer just has to focus on the App itself
Good Luck!!!!
Yes there is several ways to do this
you can just post to the server and from the server send push notifications to the mobiles
You can make the mobile keep checking for updates if it exists
You will require to finish these steps ( at least ):
setup a PHP web server
register for Android Push Notification (you probably need that)
create database schema
write your own codes to allow users to submit & retrieve chat messages
security !!!
You'd probably want to use Google's C2DM, though it's not free.
Your php server would get a message from a phone, do it's processing, then make a HTTPS request to Google's C2DM service, which sends the messages to the destination android device.
http://code.google.com/android/c2dm/#push-process
Don't use C2DM, its a deprecated. Please go through the GCM(Global Cloud Messaging),
please follow this link,
http://developer.android.com/google/gcm
Have you heard of Firebase? Firebase. Making a chat app with Firebase is like eating pizza.
Using php I'm trying to figure out the most efficient way to design my web app to incorporate 3rd party API's. The user of the app does not need to see the response from the api call.
So for instance a user will click to send maybe 1000 emails. Those emails will go via someone like SendGrid or Amazon SES. The user does not need to wait until those emails have been processed. Essentially I want those processed in the background with the user returned to the web app.
Should I be thinking of using a queuing service like SES
I have at least three api's I am incorporating.
Thanks
The most probable way is running some background processes and sending them messages via some queuing solutions like RabbitMq (see also the SlideShare presentation for details). You may also consider using Gearman for distributed computing: make GearmanClient::doBackground() calls from API wrappers, run Gearman job servers as middle points and run workers that actually will make calls to your APIs. See some presentations for further details.