This module provides the ability to add items to the Safari Reading List.
See the module in action in this video.
* This is an iOS module only * You need Titanium SDK 3.1.3.GA or greater * You need iOS 7 or greater * Before using this module you first need to install the package. If you need instructions on how to install a 3rd party module please read this installation guide.Download the platform you wish to use:
If you are building from source you will need to do the following:
Import the project into Xcode:
- Modify the titanium.xcconfig file with the path to your Titanium installation
- Download the latest release from the releases folder ( or you can build it yourself )
- Install the Utterance module. If you need help here is a "How To" guide.
- You can now use the module via the commonJS require method, example shown below.
var readinglist = require('bencoding.reading.list');
The isSupported method, will return true if the devices supports the Safari Reading List module or false if this functionality is not available.
None
Example
if(!readinglist.isSupported()){
alert("Sorry your device doesn't support this functionality");
}
This method continues reading any speech that has been paused.
The add method takes a dictionary with the following properties.
url
This required property contains the URL of the item to be added to the Safari Reading List. This can be any valid URL.
title
This required property contains the description Title for the item once added to the Safari Reading List.
previewText
This optional property contains the description text for the item once added to the Safari Reading List.
A dictionary is returned with the following properties.
success
True/False boolean indicator if the item was successfully added to the Safari Reading List.
message
If the method failed, the message property will contain information regarding the reason for failure.
url
The url added to the Safari Reading List
title
The title of the Safari Reading List item added.
previewText
The preview text of the Safari Reading List item added.
Example
var result = readinglist.add({
url:"http://bbc.com",
title:"BBC News",
previewText:"An Example"
});
Ti.API.info(JSON.stringify(result));
if(result.success){
alert("Successfully added to your reading list");
}else{
alert("Something went wrong " + result.message);
}
Please consider following the @benCoding Twitter for updates and more about Titanium.
For module updates, Titanium tutorials and more please check out my blog at benCoding.Com.
Utterance is available under the Apache 2.0 license.Copyright 2013 Benjamin Bahrenburg
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.