Get the code
by Anthony Amanse | Published April 12, 2019
Mobile development can be quite simple. However, when you begin developing the back end, your work can become rather challenging. Building the back end results in additional time in your development cycle, and creating scalability and resiliency provides yet another challenge. To alleviate some of these difficulties, this code pattern explores using a serverless back end for your mobile app.
A serverless approach allows you to run your code or functions based on events. As developers, you won’t need to provision or manage servers. You can spend more time developing your mobile app. The back end can be as simple as pushing your code into the serverless platform.
This code pattern demonstrates using push notifications with a serverless back end. It is easy to create functions that you can schedule to run at specific times. This approach is useful, especially when you want to automatically send push notifications to your users. Automating your notifications to be sent at specific times gives you the ability to really engage your users and send messages at just the right time.
This pattern demonstrates a weather alert application that can notify users of the weather for the next day. It uses IBM Cloud Functions as the backcend and the push notification service, with the weather data coming from the Weather Company Data service. The application allows users to select their cities, which types of weather they want to get notified about, and when they want to receive the notifications.
With this code pattern, you can try leveraging mobile push notifications with a serverless approach. See how you might be able to apply it to your own mobile apps.
This application demonstrates how to use IBM Cloud Functions (based on Apache OpenWhisk) as a serverless, mobile back end and as a way to send push notifications to application users. The example use case shows how actions work with the mobile app, and it runs actions that send notifications at a specific time using a cron job configuration.
The serverless functions are used as the mobile application’s back end. The mobile application is a simple weather alert app that pushes notifications for the weather on the next day. The serverless functions uses weather data and processes which data is sent and which subscribers receive the data. An action is invoked from the mobile app to create both a push notification tag and create a cron trigger. The cron trigger is used to schedule the actions and the time of day to run them.
In this code pattern, you learn the following skills:
The following components and services are used in this code pattern:
Find detailed technical steps for this code pattern in the README.md file in the GitHub repository.
Get the Code »
Back to top