Members
(static) getDatabaseDirectoryName
Get the private documents directory
Methods
(static) buildQuery(obj, prepend) → {String}
Generate URL-encoded query string.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | Object key-value to parse. |
prepend |
String | The prepended char |
Returns:
- Type
- String
(static) bytesForHumans(bytes) → {String}
Get a human representation of bytes
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Number |
Returns:
- Type
- String
(static) compareVersions(a, b) → {Number}
Compare two app versions
Parameters:
Name | Type | Description |
---|---|---|
a |
String | |
b |
String |
Returns:
- Type
- Number
(static) decodeHtmlEntity(str) → {String}
Decode html entities into text
Parameters:
Name | Type | Description |
---|---|---|
str |
String | The string to decode |
Returns:
The decoded string
- Type
- String
(static) dial(tel)
Dial a number.
Parameters:
Name | Type | Description |
---|---|---|
tel |
String | The number to call. |
(static) encodeHtmlEntity(str) → {String}
Encode a string into html entities
Parameters:
Name | Type | Description |
---|---|---|
str |
String | The string to encode |
Returns:
The encoded string
- Type
- String
(static) errorAlert(err, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Object | The object error | |
callback |
function |
<optional> |
The callback |
(static) fromNow(topt) → {Number}
Get the UNIX timestamp from now with delay expressed in seconds.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
t |
Number |
<optional> |
Seconds from now. |
Returns:
- Type
- Number
(static) getAppDataDirectory() → {String}
Return the app-data directory.
Returns:
- Type
- String
(static) getDeployType() → {String}
Returns the build type. It differs from Ti.Platform.deployType, as it returns "development" both for "test" and "development" builds.
Returns:
- Type
- String
(static) getDomainFromURL(url) → {String}
Return the clean domain of an URL
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL to parse |
Returns:
Clean domain
- Type
- String
(static) getErrorMessage()
An error parser that parse a String/Object
(static) getFacebookAvatar(fbid, wopt, hopt) → {String}
Get the Facebook avatar from the graph
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fbid |
String | Facebook ID | |
w |
Number |
<optional> |
Width |
h |
Number |
<optional> |
Height |
Returns:
The open graph url pointing to the image
- Type
- String
(static) getIOSVersion() → {Number}
Return the iOS major version
Returns:
- Type
- Number
(static) getOS() → {String}
Returns the OS name. It differs from Ti.Platform.osname, as it returns "ios" both for iPhone and iPad.
Returns:
- Type
- String
(static) getPlatformFullName() → {String}
Get the full platform name
Returns:
- Type
- String
(static) getResourcesDirectory() → {String}
Get the resources directory path
Returns:
- Type
- String
(static) guid() → {String}
Get a UUID
Returns:
- Type
- String
(static) hashJavascriptObject(obj) → {String}
Return the seralized representation of any JS object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object |
Returns:
The hash
- Type
- String
(static) isIOS6() → {Boolean}
Check if is iOS 6
Returns:
- Type
- Boolean
(static) isIOS7() → {Boolean}
Check if is iOS 7
Returns:
- Type
- Boolean
(static) isIOS8() → {Boolean}
Check if is iOS 8
Returns:
- Type
- Boolean
(static) isIOS9() → {Boolean}
Check if is iOS 9
Returns:
- Type
- Boolean
(static) now() → {Number}
Get the current UNIX timestamp.
Returns:
- Type
- Number
(static) openFacebookProfile(fb_id)
Open a Facebook profile in the Facebook application
Parameters:
Name | Type | Description |
---|---|---|
fb_id |
String | Facebook ID |
(static) openHTTPLink(url)
Parameters:
Name | Type | Description |
---|---|---|
url |
String |
(static) openInstagramProfile(ig_username)
Open an Instagram profile in the Instagram application
Parameters:
Name | Type | Description |
---|---|---|
ig_username |
String | The user's id |
(static) openInStore()
Open the iTunes Store or Google Play Store of specified appid
Properties:
Name | Type | Description |
---|---|---|
appid |
The appid |
(static) openTwitterProfile(tw_username)
Open a Twitter profile in the Twitter application
Parameters:
Name | Type | Description |
---|---|---|
tw_username |
String | Twitter screen name |
(static) openTwitterStatus(tw_username, status_id)
Open a Twitter status in the Twitter application
Parameters:
Name | Type | Description |
---|---|---|
tw_username |
String | The user id |
status_id |
String | The status id |
(static) openURL(url, fallbackopt, erroropt)
Try to open the URL with `Ti.Platform.openURL`, catching errors.
If can't open the primary argument (url), open the fallback.
If can't open the fallback, and `error` is set, show the error dialog.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
url |
String | The URL to open | |
fallback |
String | function |
<optional> |
If is a string, try to open the URL. If is a functions, call it. |
error |
String |
<optional> |
The error to show |
(static) openYoutubeProfile(ytid)
Open a Youtube profile in the Yotube application
Parameters:
Name | Type | Description |
---|---|---|
ytid |
String | Youtube ID |
(static) parseAsXCallbackURL(url) → {XCallbackURL}
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL to parse |
Returns:
- Type
- XCallbackURL
(static) parseJSON(json) → {Object}
Try to parse a JSON, and silently fail on error, returning a `null` in this case.
Parameters:
Name | Type | Description |
---|---|---|
json |
String | The JSON to parse. |
Returns:
- Type
- Object
(static) parseSchema() → {String}
Parse the initial arguments URL schema
Returns:
- Type
- String
(static) requireOrNull(name) → {Object}
Require a module, or return a null object
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
Returns:
- Type
- Object
(static) rot13(s)
Get the rot13 of a string
Parameters:
Name | Type | Description |
---|---|---|
s |
String |
(static) startActivity(opt, erroropt)
Valid only on Android, start the activity catching any possible errors.
If `error` is provided, show the error dialog with this message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opt |
Object | Options for `createIntent(...)` | |
error |
String |
<optional> |
Error message |
(static) timestamp(argopt) → {Number}
Get the UNIX timestamp.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
Object |
<optional> |
The date to parse. |
Returns:
- Type
- Number
(static) timestampForHumans(ts) → {String}
Return in human readable format a timestamp
Parameters:
Name | Type | Description |
---|---|---|
ts |
Number | The timestamp |
Returns:
- Type
- String
(static) tryOpenURLs(urls) → {Boolean}
Try to open all URLs in the array
Parameters:
Name | Type | Description |
---|---|---|
urls |
Array |
Returns:
`true` if at least one url has been opened.
- Type
- Boolean
(static) zeroPad(num, size) → {String}
Add leading zeros
Parameters:
Name | Type | Description |
---|---|---|
num |
String | The number |
size |
Number | The final size |
Returns:
- Type
- String