Skip to content

m1ga/ti.appwrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

24 Commits

Repository files navigation

Titanium module for Appwrite

screenshot

Titanium Android module usingAppwrite's Android SDK

What is Appwrite:

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Android SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go tohttps://appwrite.io/docs

Installation

  • create and run an Appwrite docker machine:https://appwrite.io/docs/installation
  • downloadti.appwritemodule
  • add<module>ti.appwrite</module>to yourtiapp.xml
  • add the following section to your<application>section:
<application>
<activityandroid:name="io.appwrite.views.CallbackActivity"android:exported="true">
<intent-filterandroid:label="android_web_auth">
<actionandroid:name="android.intent.action.VIEW"/>
<categoryandroid:name="android.intent.category.DEFAULT"/>
<categoryandroid:name="android.intent.category.BROWSABLE"/>
<dataandroid:scheme="appwrite-callback-[PROJECT_ID]"/>
</intent-filter>
</activity>
</application>

Appwrite setup

Start the docker machine and create a new project. Make sure to add anAndroid platformwith your package name. UnderSettingsyou will find theProject ID.

Titanium setup

varappwrite=require("ti.appwrite");
appwrite.create({
endpoint:SERVER_URL,
project:PROJECT_ID,
selfSigned:true,
channels:["files","account"]
});

Full example:app.js
Full tutorial at:from zero to app: Appwrite + Titanium: A step by step guide

Methods

  • create()

  • checkConnection()

  • createAccount()

  • deleteAccount()

  • createSession()

  • getAccount()

  • getDocuments()

  • getDocument()

  • deleteDocument()

  • createDocument({})

  • subscribe([])

  • unsubscribe([])

  • createFile({file, read[], write[]})

  • listFiles();

  • getFile(id)

  • getPreview({id:string, width?:int, height?:int, quality?:int})

  • downloadFile(id)

  • deleteFile(id);

Events

  • account
  • error: action, message, code, response
  • realtimeEvent
  • database: e.documents for list
  • storage: e.blob for file download, e.files for file list
  • connection: status (true/false)

Author

Buy Me A Coke donate button