Latest 1.0.3
License MIT
Platforms ios 8.0
Dependencies ZetaPushSwift, Gloss



To run the example project, clone the repo, and run pod install from the Example directory first.


ZetaPushSwiftServices must be run with ZetaPushSwift pod.


ZetaPushSwiftServices is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ZetaPushSwiftServices"


This repository gives you the auto-generated code to use ZetaPush services. A ZetaPush service as listed in the reference site is a technical service available on ZetaPush’ Cloud. This service can be used in your Swift code.

For each service, we provide:

  • a Publish class with every ZetaPush services verb available as a method
  • a Listener class that you MUST override with every ZetaPush services output available as a method to override
  • every structures needed to call or to receive data from ZetaPush

Please refer to the ZetaPushSwift repository to learn the basics of ZetaPush connection with Swift. We will enhance the basic connection example to use ZetaPushSwiftServices

import UIKit
import ZetaPushSwift
// Import the new Pod
import ZetaPushSwiftServices

// Override the StackListener class
class MyStackListener: StackListener{
    // Override the on_list function
    public override func on_list(_ data: StackListResponse) {
        print("MyStackListener onList", data)
    // Override the on_push function
    public override func on_push(_ data: StackItemAdd) {
        // Here, we will receive all call result to the push verb for my Stack service
        print("MyStackListener onPush", data)

class ViewController: UIViewController {

    let zetaPushWeakClient:ZetaPushWeakClient = ZetaPushWeakClient(sandboxId: "YOUR_SANDBOX_ID", weakDeploymentId: "YOUR_WEAK_DEPLOYMENT_ID")

    // declare your service publisher: here, we use a StackPublisher for the Stack Service (
    var stackPublisher: StackPublisher?

    // declare my service listener
    var stackListener: MyStackListener?
    override func viewDidLoad() {

        zetaPushWeakClient.onSuccessfulHandshake = onSuccessfulHandshake

        // Create the StackPublisher 
        stackPublisher = StackPublisher(zetaPushWeakClient, deploymentId:"YOUR_STACK_SERVICE_DEPLOYMENT_ID")

        // Create the StackListener
        stackListener = MyStackListener(zetaPushWeakClient, deploymentId:"YOUR_STACK_SERVICE_DEPLOYMENT_ID")

        // Connect to ZetaPush

    func onSuccessfulHandshake(_ client:ClientHelper){
        // The connection to ZetaPush is a success
        print("ViewController SuccessfulHandshake")

    @IBAction func OnMyFirstTestDown(_ sender: Any) {

        // Create a stackItemAdd object
        let dataStack = ["message":"Hello World"]
        let stackItemAdd = StackItemAdd(json: ["stack": "myGreatStackName", "data": dataStack])

        // Call the push method to call the "push" verb of the stack Service
        stackPublisher?.push(parameter: stackItemAdd!)

That’ all! It really easy to call ZetaPush services with predifined Publishers and Listeners


Morvan Mikael, [email protected]


ZetaPushSwiftServices is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "ZetaPushSwiftServices",
    "version": "1.0.3",
    "summary": "ZetaPushSwiftServices is an auto-generated code of ZetaPush services",
    "description": "ZetaPushSwiftServices is an auto-generated code of ZetaPush services.nIt contains all structures needed to call ZetaPush services and for received responsesnEvery services can be called by a ServiceNamePublisher classnOne must inherit from the ServiceNameListener class and overide the desired method",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Morvan Mikael": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.3"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source_files": "ZetaPushSwiftServices/Classes/**/*",
    "dependencies": {
        "ZetaPushSwift": [
            "~> 1.0"
        "Gloss": [
            "~> 1.2"
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This