by samsonadze » March 18th, 2013, 12:21 pm
by Henrik » March 18th, 2013, 3:27 pm
by samsonadze » March 18th, 2013, 10:38 pm
by Benjaminsen » March 19th, 2013, 11:18 am
samsonadze wrote:ok i made that,but no popups are coming up... :\ but i see that theres item added in users account. (i used fb as3 graph with Facebook.ui... coz the playerio fb api gave me errors )
by samsonadze » March 19th, 2013, 3:10 pm
by Henrik » March 19th, 2013, 4:33 pm
samsonadze wrote:ok i made that,but no popups are coming up... :\ but i see that theres item added in users account.
by samsonadze » March 19th, 2013, 4:48 pm
PlayerIO.quickConnect.facebookOAuthConnect(stage,
gameID,
token,
"",
join,
function(r:PlayerIOError):void{
trace(r);
});
function join(client:Client,facebookUserId:String):void
{
client.payVault.refresh(function(){
client.payVault.getBuyDirectInfo(
"facebook", //Provider name
{ //Purchase arguments
title:"Shop Card", //(See table below)
description:"Get Shop card Noob!",
image_url:"https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-snc6/166702_466023973470275_2017593925_n.png",
product_url:"https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-snc6/166702_466023973470275_2017593925_n.png"
},
[{itemKey:"shopcard"}], //Item to buy
//Success handler
function(info:Object):void{
Facebook.ui("pay",info, function(data:Object):void {
if (data.order_id) {
trace("Purchase completed!");
} else {
trace("Purchase failed.");
}
});
},
//Error handler
function(e:PlayerIOError):void{ trace("Unable to buy item", e) }
)
});
}