With Joomla4iOS you have the ability to easily implement your existing Joomla infrastructure within your iOS Apps. The framework is free and you don’t need any other dependencies.
The Release System Module is implemented with the plg_jbackend_release plugin. It provides functions to implement a full Joomla Update Server and/or a generic Package Distribution System based on Joomla. It supports both free and paid packages, and it is seamlessly integrated with Joomla user's groups for authorization and license key generation. Here is the list of supported methods.
Sends an email to the user with the license key for the specified package group.
action=post module=release resource=keybyemail id=<package group> email=<user email>
<end-point>?action=post&module=release&resource=keybyemail&id=redj_ent&email=This email address is being protected from spambots. You need JavaScript enabled to view it.
<end-point>/post/release/keybyemail/redj_ent?email=This email address is being protected from spambots. You need JavaScript enabled to view it.
{ "status": "ok" }
email is the user's account email on Joomla.
Returns the license key for the specified package group.
action=post module=release resource=keybyauth id=<package group> username=<username> password=<password>
<end-point>?action=post&module=release&resource=keybyauth&id=redj_ent&username=user123&password=pass123
<end-point>/post/release/keybyauth/redj_ent?username=user123&password=pass123
{ "status": "ok", "email": "user email", "key": "license key" }
username and password are the credentials used for the user's account on Joomla.
Checks if a license key is valid for the specified package group.
action=post module=release resource=validate id=<package group> email=<user email> key=<license key>
<end-point>?action=post&module=release&resource=validate&id=redj_ent&email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323
<end-point>/post/release/validate/redj_ent?email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323
{ "status": "ok" }
Checks if a license key is valid for the specified package id.
action=post module=release resource=verify id=<package id> email=<user email> key=<license key>
<end-point>?action=post&module=release&resource=verify&id=redj_ent_190&email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323
<end-point>/post/release/verify/redj_ent_190?email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323
{ "status": "ok" }
This method is intended to verify a license key over a specific package id before to download it.
Download the package for the specified package id.
action=post module=release resource=download id=<package id> email=<user email> key=<license key>
<end-point>?action=post&module=release&resource=download&id=redj_ent_190&email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323
<end-point>/post/release/verify/redj_ent_190?email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323
The binary package (as application/octet-stream)
The following options are available for release system plugin:
Option | Description |
Folder | Packages distribution folder path relative to Joomla root folder (JPATH_ROOT). |
Package groups | List of package groups. Packages in the same group share the same license key. Format is 'package group;groups[;hash;package name]' where package group is an unique identifier (e.g. redj_enterprise), groups is a list of user groups allowed to download packages in this group separated by commas (e.g. 1,3,5), hash is an optional random string used as seed for the generation of group's license keys, and package name is the human readable name of the package (e.g. ReDJ Enterprise). |
Packages | List of packages to distribute. Format is 'package id;package path[;package group]' where package id is an unique identifier (e.g. redj_ent_190), package path is the path of the package file relative to the packages distribution folder (e.g. private/joomla/redj/ReDJ1.9.0.zip), and package group is the group identifier (optional, not required for free downloads). |
Since version 1.6 Joomla has an Update System that allows you to update installed extensions automatically. And since January 10th 2017 supporting this system is almost mandatory for each extension.
jBackend Release System is a jBackend module that provides all features to implement a full Joomla Update Server and/or a generic Package Distribution System based on Joomla. It works with both jBackend and jBackend Community.
It can be used to distribute free packages, and paid packages as well. For paid packages the download restrictions are based on license keys, that are automatically generated and securely distributed to licensed users, authorized thorugh Joomla user's groups. Technical documentation is available here. An article that describes how it works can be found here.
jBackend Release System is released under GPL 2.0 license.
The Community Builder Module is implemented with the plg_jbackend_comprofiler plugin. It provides functions related to Community Builder extension. Here is the list of supported methods.
action=get module=comprofiler resource=users limit=<L> (optional) offset=<O> (optional)
<end-point>?action=get&module=comprofiler&resource=users
<end-point>/get/comprofiler/users?limit=10&offset=2
{ "status": "ok", "total": <total>, "limit": <limit>, "offset": <offset>, "users": [ { "id": "<userid>", ... }, ... { "id": "<userid>", ... } ] }
limit is the number of entries to return.
offset is the cursor starting point (0 based, start on record 16 means offset = 15).
If limit is not specified, offset is ignored.
Properties limit and offset in the response are present only when specified in the request.
action=get module=comprofiler resource=profile id=<id>
<end-point>?action=get&module=comprofiler&resource=profile&id=482
<end-point>/get/comprofiler/profile/482
{ "status": "ok", ... }
action=put module=comprofiler resource=profile
{ "id": "<userid>", "name": "<name>", "username": "<username>", "email": "<email>", "password": "<password>", ... }
<end-point>?action=put&module=comprofiler&resource=profile
<end-point>/put/comprofiler/profile
{ "status": "ok" }
The id parameter in the request payload is mandatory to identify the user profile to update.
Other mandatory fields are username, email, and name.
It is possible to specify any supported field in the payload.
The Search Module is implemented with the plg_jbackend_search plugin. It provides functions related to Joomla search module. Here is the list of supported methods.
action=get module=search resource=site searchword=<term> searchphrase=<all> (optional) limitstart=<offset> (optional) limit=<limit> (optional) ordering=<orderby> (optional) areas[]=<area> (optional)
<end-point>?action=get&module=search&resource=site?searchword=joomla&searchphrase=all&limitstart=10&limit=10&ordering=newest&areas[]=content
<end-point>/get/search/site?searchword=<term>
{ "status": "ok", "total": <T>, "limit": <L>, "offset": <O>, "pages_current": <C>, "pages_total": <P>, "results": [ { "title": "<title>", "metadesc": "<metadesc>", "metakey": "<metakey>", "created": "<date created>", "language": "<language>", "catid": "<cid>", "text": "<text>", "section": "<section>", "slug": "<id:slug>", "catslug": "<id:slug>", "browsernav": "<browsernav>", "href": "<href>", "jcfields": "<jcfields>" }, ... ] }
searchphrase:
any, exact, all (default)
ordering:
newest (default), oldest, popular, alpha, category
areas:
an array of search areas (e.g. content)
Created date format is YYYY-MM-DD HH:MM:SS
Language can be "*" if any.
jBackend Community is the lite version of jBackend available for free, no subscription required. It provides all the basic features to integrate Joomla content with mobile apps, syndication networks, affiliate networks and any external system, and it is mainly intended to give a chance to test jBackend capabilities, to develop and test new modules, and to provide some basic REST API integration features to a Joomla site.
When the upgrade to the full jBackend version is required, it is possible to install the full jBackend package over the Community version. The two versions share the same data tables and settings, and the upgrade process will preserve the configuration and all existing data.
The Community version is completely free, but doesn't provide the full functionalities available for jBackend. Here's a comparison matrix between jBackend Community and jBackend:
Features | jBackend Community | jBackend |
---|---|---|
Extensible through plugins to increase API and support any Joomla extension | (2 plugins in the package) |
(3 plugins in the package, 7+ included with the subscription) |
Support for publishing of multiple endpoints, each with its specific settings | ||
Three endpoint access type (free access, user authenticated only, API Key required) | (free only) |
|
Tracing requests in the database for each endpoint | ||
Selection of jBackend plugins to enable for each endpoint | ||
API Key management interface | (not used) |
|
Request log management interface | ||
Each API Key can have a max daily requests limit and an expiration date | (not used) |
|
Each API Key can be targeted on separate endpoints | (not used) |
|
Access control is compliant with integrated ACL | (not used) |
|
Support for REST compliant requests | ||
JSON format for responses | ||
Support for session ID | (only cookies) |
|
Get the list of articles by tag id (content module) | ||
Support for push notifications on iOS (APNs) and Android (GCM) | ||
Custom payload for push notifications | ||
Scheduled sending of push notifications | ||
Push notifications can be create and scheduled via API call | ||
Push notifications can be targeted on selected users, groups or devices | ||
License | GPL 2.0 | GPL 2.0 |
Price | Free | 14 € (one year subscription) |
The basic extension package includes the jBackend component, that provides the general infrastructure for endpoints, and plugins support system. Also the following plugins are already included in the basic package:
Additional plugins are available only with a valid jBackend Subscription and can be downloaded from here and installed separately. More info about jBackend can be found here
jBackend Community is released under GPL 2.0 license.
The Kunena Module is implemented with the plg_jbackend_kunena plugin. It provides functions related to Kunena forum for Joomla (topics and categories). Here is the list of supported methods.
action=get module=kunena resource=categories parentid=<P> (optional) default to the root levels=<L> (optional) 0=all levels, default is 1 unpublished=<0|1> (optional) 0=Hide (default), 1=Show
<end-point>?action=get&module=kunena&resource=categories&parentid=<P>&levels=<L>
<end-point>/get/kunena/categories?parentid=<P>
{ "status": "ok", "categories": [ { "id": "<category id>", "name": "<category name>", "alias": "<category alias>", "description": "<category description>", "parent_id": "<parent category id>", "level": "<category level>", "numTopics": "<number of category topics>", "numPosts": "<number of category posts>", "hits": "<number of hits>" } ] }
action=get module=kunena resource=categories id=<N>
<end-point>?action=get&module=kunena&resource=categories&id=<N>
<end-point>/get/kunena/categories/<N>
{ "status": "ok", "id": "<category id>", "name": "<category name>", "alias": "<category alias>", "description": "<category description>", "parent_id": "<category parent id>", "level": "<category language>", "numTopics": "<number of category topics>", "numPosts": "<number of category posts>", "hits": "<number of hits>", "icon": "<category icon>", "icon_id": "<category icon id>", "locked": "<locked status>", "pub_access": "<public access>", "pub_recurse": "<public recurse>", "review": "<review>", "allow_anonymous": "<allow anonymous>", "post_anonymous": "<post anonymous>", "allow_polls": "<allow polls>", "topic_ordering": "<topic ordering>", "last_topic_id": "<last topic id>", "last_post_id": "<last post id>", "last_post_time": "<last post time>" }
action=get module=kunena resource=topics catid=<C> limit=<L> (optional) offset=<O> (optional) orderdir=<dir> (optional) asc, desc
<end-point>?action=get&module=kunena&resource=topics&catid=<C>
<end-point>/get/kunena/topics?catid=<C>
{ "status": "ok", "total": "<total items>", "limit": <pagination limit>, "offset": <pagination offset>, "topics": [ { "id": "<topic id>", "category_id": "<category id>", "subject": "<topic subject>", "locked": "<locked>", "hold": "<hold>", "posts": "<posts>", "hits": "<number of hits>", "attachments": "<attachments>", "first_post_id": "<first post id>", "first_post_time": "<first post time>", "first_post_userid": "<first post user id>", "first_post_message": "<first post message text>", "first_post_guest_name": "<first post guest name>", "last_post_id": "<last post id>", "last_post_time": "<last post time>", "last_post_userid": "<last post user id>", "last_post_message": "<last post message text>", "last_post_guest_name": "<last post guest name>" }, ... { } ] }
action=get module=kunena resource=topics id=<N>
<end-point>?action=get&module=kunena&resource=topics&id=<N>
<end-point>/get/kunena/topics/<N>
{ "status": "ok", "id": <topic id>, "category_id": "<category id>", "subject": "<subject>", "locked": "<locked>", "hold": "<hold>", "posts": "<posts>", "hits": "<number of hits>", "attachments": "<attachments>", "first_post_id": "<first post id>", "first_post_time": "<first post time>", "first_post_userid": "<first post user id>", "first_post_message": "<first post text message>", "first_post_guest_name": "<first post guest name>", "last_post_id": "<last post id>", "last_post_time": "<last post time>", "last_post_userid": "<last post user id>", "last_post_message": "<last post text message>", "last_post_guest_name": "<last post guest name>", "messages": [ { "id": "<message id>", "parent": "<parent id>", "thread": "<thread id>", "catid": "<category id>", "name": "<user name>", "userid": "<user id>", "email": "<email>", "subject": "<message subject>", "time": "<message time>", "ip": "<ip address>", "topic_emoticon": "<topic emoticon>", "locked": "<locked>", "hold": "<hold>", "hits": "<number of hits>", "message": "<message>", "replynum": <number of replies>, "thankyou": [ ... ] }, ... { ... } ] }
Since version 3, jBackend introduced support for push notifications for Android and iOS, providing all needed functions to manage multiple mobile apps, to register devices and to send scheduled push notifications. The following video shows how to use jBackend to create a new application, to call the push register service to register a device, and the schedule and trigger a push notification.
To access to configured notifications go to menu Components > jBackend > Notifications. A list of notifications will be shown:
Each notification has the following information:
Field: | Description: |
---|---|
Title | Notification title (used only on Android) |
Message | Notification message |
Payload | Payload of push notification for app (JSON format) |
App | App code |
Platform | OS platform |
Target | Target registered devices for the push notification (All, Selected users, Selected groups, Selected devices) |
Target Users | Users whose registered devices are target for the push notification |
Target Groups | Groups whose registered devices are target for the push notification |
Target Devices | Registerd devices target of the push notification |
Context | Application specific notification context. Not used yet (it will be used to filter recipients for push notifications) |
Scheduled time | Time scheduled to start sending out this notification on devices |
Status | Current sending status for this notification |
Last run | Last time this notification queue has been executed |
Last device ID | Device ID of the last notification sent in the last run |
The Status of a notification can be:
Status: | Description: |
---|---|
aborted (-2) | The notification is "logically" deleted (in this state the notification is always skipped) |
paused (-1) | The notification is suspended (in this state the notification is always skipped) |
scheduled (0) | The notification is ready to be sent (sending will start at the scheduled time) |
running (1) | The notification is currently being processed |
completed (2) | The notification has been sent to all devices (job completed) |
Using the buttons on the toolbar it is possible to change the status of selected notifications. It is also possible to "unlock" locked notifications. It could be useful, as example, when a notification is locked for too long, which could mean there was a problem on the scheduler and the resource was not released properly (see How notification sending works)
To start processing the pending notifications (with status scheduled and running) it is necessary to call a "trigger" function. The Push Module has a scheduler function that must be called on a regular basis (e.g. from a crontab) to trigger the sending of scheduled push notifications.
Each time the scheduler function is called, it select all pending notifications ordered by the scheduler time ascending (first the notification scheduled before). To be "pending" a notification must have a scheduled time less then current time, must be in status scheduled or running, and must be no locked (locked means the notification is currently in charge of another scheduler). If the pending list is not empty, the scheduler starts to process notifications once a time, until the total number of push notifications sent to devices reach the Batch size (max configured for the scheduler).
For the notification currently being processed, the scheduler first locks it, then start to send the notifications to all matching devices (sorted by device ID, so all devices will be checked only once, including new devices added while the notification is running) until the Batch size is reached or the devices are finished. In the first case the notification is unlocked and the scheduler ends. In the second case the notification state is set to completed, it is unlocked and the scheduler starts to process the next notification (if one) with the same rules.
With this processing logic it is possible to schedule and execute concurrent schedulers to increase volume of push notifications sent.
It is possible to send a custom payload with each push notification. The payload must be a valid JSON, example:
{ "alert": { "alertId": "1404999843555", "alertStatus": false } }
Or:
{ "id": "25" }
How to get the JSON payload in the mobile app depends on the framework used. The following is an example using Ionic Framework with this Cordova Push notification plugin:
https://github.com/phonegap-build/PushPlugin
In the jBackend push plugin the payload hasthe following structure:
$payload = array( 'title' => $notification['title'], 'message' => $notification['message'], 'icon' => 'icon', 'data' => $notification['payload'] );
On the mobile app the push callback has the following code:
window.onNotificationGCM = function(e) { switch (e.event) { case 'registered': if (e.regid.length > 0) { $rootScope.$emit('push.registered', { 'token': e.regid }); } break; case 'message': // Notification in foreground if (e.foreground) { $log.debug('push notification in foreground'); } else { $log.debug('push notification in background'); } $log.debug('push message payload ' + JSON.stringify(e.payload)); $rootScope.$emit('push.received', { 'payload': e.payload.data }); // e.payload.data is { "id": "25" } break; case 'error': $log.debug('push GCM error ' + e.msg); break; default: $log.debug('push GCM unknown event'); break; } };
In the jBackend push plugin the payload hasthe following structure:
$body = array( 'aps' => array( 'alert' => array( 'title' => $notification['title'], 'body' => $notification['message'] ), 'sound' => 'default' ), 'data' => $notification['payload'] );
On the mobile app the push callback has the following code:
window.onNotificationAPN = function(e) { if (e.alert) { $log.debug('push APN alert ' + e.alert); } if (e.sound) { $log.debug('push APN sound'); } if (e.badge) { $log.debug('push APN badge ' + e.badge); pushNotification.setApplicationIconBadgeNumber(successBadgeHandler, errorBadgeHandler, e.badge); } $log.debug('push APN full event ' + JSON.stringify(e)); $rootScope.$emit('push.received', JSON.parse(e.data)); // e.data is { "id": "25" } };