A module for Appcelerator Titanium apps that adds location based notifications.
This module was developed for Titanium 3.1.3.GA. This plugins supports both IOS and Android.
Install our module through the Help => Install Mobile Module. The URLs are:
- IOS: http://www.plotprojects.com/downloads/com.plotprojects.ti-iphone-latest.zip
- Android: http://www.plotprojects.com/downloads/com.plotprojects.ti-android-latest.zip
The following snippet has to be added to one of your scripts used to initialize your application (usually app.js or alloy.js):
var plot = require('com.plotprojects.ti');
plot.initPlot({ publicToken:'REPLACE_ME' });
You can obtain the public token at: http://www.plotprojects.com/getourplugin/
The following snippet has to be added to tiapp.xml to the ti:app
element:
<ios>
<plist>
<dict>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
</dict>
</plist>
</ios>
plot.addEventListener("plotNotificationReceived", func)
Allows specifying your own handler when a notification is opened by the user. The function is passed a notification object, which has the fields "message", "data" and "id". When no listener is added, then the "data" field will be treated as URI and opened.
plot.initPlot(config)
Initializes Plot. You must call this method before calling other methods other than the notification handler Plot provides. The config parameter is an object and may have the following properties:
publicToken | Your public token (required) |
cooldownPeriod | The cooldown period between notifications in seconds. (default disabled) |
enableOnFirstRun | Whether Plot should be automatically enabled on the first run (default true) |
enableBackgroundModeWarning | Whether background warnings should be enabled. See documentation. Default true . (iOS only) |
plot.enable()
Enables Plot.
plot.disable()
Disables Plot.
plot.enabled
Returns whether plot is enabled (read-only).
plot.setCooldownPeriod(cooldownSeconds)
Updates the cooldown period.
plot.version
Returns the current version of the Plot plugin.
Website: http://www.plotprojects.com/ Technical support: https://groups.google.com/forum/#!forum/plot-users
The source files included in the repository are released under the Apache License, Version 2.0.