Skip to content

Instantly share code, notes, and snippets.

How to create geo in backand.
1. Create a new query.
Give it a name and save.
2. In text enter table creation script
Example:
CREATE TABLE `nodes` (
`id` int(11) PRIMARY KEY,
`geom` geometry NOT NULL,

###Basic Auth To use Admin's permission in the server side action or imperonsate to other user use basic auth Authorization header:

###Back& server side Action In the action change the headers code to be this line:

headers:{'Authorization':'basic ' + btoa (username + ':'+ password) }

Use this code snippet of Android in order to access Back&, make a GET call that returns string which you can transform into JSON:

StringBuilder stringBuilder = new StringBuilder();
try {
    String authorization = "<< AnonymousToken >>";

    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
 conn.setRequestMethod("GET");

Android code with authentication to use with Back&:

com.backand.backandandroidsample;

import android.util.Base64;
import android.util.Log;

import java.io.InputStream;
import java.io.InputStreamReader;

In order to have socket works for Backand in Angular 1.x (without Backand's SDK) do the follow:

Add this line to index.html:

  <script src="https://api.backand.com:4000/socket.io/socket.io.js"></script>

Use this service 'SocketService' for the main socket functionality:

Get Access Token

HttpRequest:

<?php

$request = new HttpRequest();
$request->setUrl('https://api.backand.com/token');
$request->setMethod(HTTP_METH_POST);

Check access_token is valid

HttpRequest

<?php

$request = new HttpRequest();
$request->setUrl('https://api.backand.com/1/objects/action/users/1');
$request->setMethod(HTTP_METH_GET);

Get Access Token

PHP cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
@itayher
itayher / ioniccreator.md
Last active October 20, 2017 06:28
How to add Backand to Ionic Creator

In order to enable Backand in Ionic Creator follow these steps:

Add Config File

Under 'Other JS' add new file name bkndconfig.js, with this code (override the entrire code in the page):

angular.module('app.config', [])
// remember to add "app.config" to your angular modules in Code Settings

.config(function(BackandProvider) {

Creating your own Facebook Messenger Bot with Backand

Facebook recently opened up their Messenger platform to enable bots to converse with users through Facebook Apps and on Facebook Pages. In support of this, the Facebook Messenger team created a comprehensive set of documentation describing the functionality on offer. While they offer a lot of functionality and platform-level integration for free, you still need to create a publicly-accessible application that Facebook can communicate with in order to communicate with your end users.

In this tutorial, we'll walk through creating your own messenger bot with a back-end ready to go, powered by Backand and live - all in 10 minutes.