Connect Flash to Patreon and reward your patreons. (FLA file works on Animate CC only)
1- Download Patreon.fla file
2- Copy the login button to your Animate CC(Library)
3- connect using Patreon.login( your_patreon_client_id_here );
If you don't know where to get your client_id, go here: https://www.patreon.com/portal
If you just use the Patreon.login(client_id) function, it would be enough.
Now, let's say you want to get the information once connected. Here is a sample code:
Patreon.onStatus = function (stat){
if (stat==-1) trace("ERROR");
if (stat== 1) connected();
}
function connected(){
trace("User E-Mail" + Patreon.email);
trace("Is rewarded with cool thing" + Patreon.hasReward("cool thing"));
}
Connects to patreon and gets the current user Altough it is meant for logging out, it is also used to cancel the login, especially if user didn't press on allow. Returns true if the user is eligable for the reward specified. this contains the patreon e-mail once connected. Otherwise, it is null. Contains and array (Vector) information about the rewards.
Patreon.rewards[0].id //reward 0 id
Patreon.rewards[0].amount_cents //How much payed in cents
Patreon.rewards[0].description //reward 0 description
Patreon.rewards[0].title //reward 0 title
In general, here is the verification code:
public var id:String;
public var amount_cents:Number;
public var description:String,title:String;
public var user_limit:int,patron_count:int,post_count:int,remaining:int;