Skip to content

seletz/JasonetteAzureMobilePlugin

Repository files navigation

JasonetteAzureMobilePlugin

[CI Status](https://travis-ci.org/Stefan Eletzhofer/JasonetteAzureMobilePlugin) Version License Platform

What is it?

This is an example plug-in for Jasonette. This plug-in implements actions related to Azure Mobile which can be invoked using Jason.

Tables

Query and insert records from Azure Mobile Tables

Push

Register device token with Azure APNS

Usage

To use this plug-in in Jasonette, you need to add this pod and recompile:

$ cd Jasonette-iOS
$ cd app
$ pod install JasonetteAzureMobilePlugin

Configuration

You need to add a azure dictionary to your settings.plist. This dictionary must contain a key app_url which must point to your Azure Mobile App, e.g. somethinbg like https://mycoolapp.azurewebsites.net.

Once you did that, you can invoke the plug-in using something like this:

 "$jason": {
    "head": {
      "title": "Jasonette Azure Mobile Demo",
      "actions": {
        "$foreground": {
          "type": "$reload"
        },
        "$load": {
          "type": "$notification.register"
        },
        "$notification.registered": {
          "type": "@AzurePush.registerDeviceToken",
          "options": {
            "device_token": "{{$jason.device_token}}"
          }
        },
        "$notification.remote": {
          "type": "$util.banner",
          "options": {
            "title": "Message",
            "description": "{{JSON.stringify($jason)}}"
          }
        },
        "$pull": {
          "type": "@AzureTables.query",
          "options": {
            "table": "articles",
            "query": "deleted == NO"
          }
        }
      },
      "templates": {
        "body": {
          "header": {
            "title": "Jasonette Azure Mobile Demo",
            "type": "$reload",
            "success": {
              "type": "$util.toast",
              "options": {
                "text": "reload"
              }
            }
          },
          "sections": [
            {
              "items": {
                "{{#each $get.items}}": {
                  "type": "label",
                  "text": "{{title}}",
                  "style": {
                    "color": "#000000",
                    "size": "14",
                    "font": "HelveticaNeue-Bold",
                    "padding": "10",
                    "width": "300",
                    "height": "100"
                  }
                }
              }
            }
          ]
        }
      }
    },
    "body": {
      "header": {
        "title": "Jasonette Azure Mobile Demo"
      },
      "sections": {
        "items": [
          {
            "type": "label",
            "text": "???"
          }
        ]
      }
    }
  }
}

Installation

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

pod "JasonetteAzureMobilePlugin"

Author

Stefan Eletzhofer, se@nexiles.de

License

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

About

A Azure Mobile plug-in for Jasonette.

Resources

License

Stars

Watchers

Forks

Packages

No packages published