yiftee / com.yiftee.gifts

Gifts Widget for Titanium Alloy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gifts Widget

This widget for the Appcelerator Titanium Alloy MVC Framework provides the ability to add "Send a gift" functionality, similar to Facebook Gifts. The gifts functionality is integrated from the Yiftee Giftup API, free to use and is another way to monetize mobile apps. Yiftee shares revenue with the developer from any gifts that are purchased.
//IDEAS

demo

##Quick Start

How do I add gifts to my app?

  • Download the latest release of the widget.
  • Copy com.yiftee.gifts to your app's app/widgets folder.
  • Add the widget to your app's configuration file app/config.json:
"dependencies": {
	"com.yiftee.gifts": "1.0"
}
  • Require the gifts widget in a view:
<Widget src="com.yiftee.gifts" id="gifts"/>
  • Setup parameters (these could be passed in via arguments to the view, or from the database):
$.gifts.setSenderName("Bob";
$.gifts.setRecipientName("Vero");
  • Open the send a gift view
$.gifts.open();

Getting your API key

Go to the Yiftee Developers site, and register as a new developer. In the App Settings, you'll find your API Token. The API Token is necessary for two reasons: to get attributed/paid for any gifts that are purchased in your app and to customize the UX experience of your users (which merchants are displayed, etc).

Parameters

Most of these parameters are used to prefill information in the gifting process to help the gift giver enter the fewest info possible. The Gifts Widget exposes the following methods:

Method Description
setApiToken(token) Sets the api token to pass to the Giftup API. If this is not set, it will use a test token and no purchased gifts will be attributed to you. Get your Gifts API key
open() Opens the gift view (this method should be called after setting all the parameters)
setSenderName(name) Prefills the sender name
setRecipientName(name) Prefills the recipient name
setRecipientEmail(email) Prefills the recipient email
setRecipientPhone(phone) Prefills the recipient phone
setMessage(message) Prefills the message
setSenderIdHash(unique_hash) A unique user identifier to enable Saving Credit Card Option and more in-depth reporting for the Developer
setReturnUrl(return_url) Apps that support deep linking can supply a url to navigate the user back to the app upon completion of gift purchase

For more info of the available parameters in the Gifts API, see Documentation.

About

Gifts Widget for Titanium Alloy


Languages

Language:JavaScript 100.0%