Пример #1
0
 public void onRewardedVideoAdRewarded(string description)
 {
     if (_onRewardedVideoAdRewardedEvent != null)
     {
         SupersonicPlacement ssp = getPlacementFromString(description);
         _onRewardedVideoAdRewardedEvent(ssp);
     }
 }
Пример #2
0
    public SupersonicPlacement getPlacementFromString(string jsonPlacement)
    {
        Dictionary <string, object> placementJSON = SupersonicJSON.Json.Deserialize(jsonPlacement) as Dictionary <string, object>;
        SupersonicPlacement         ssp;
        int    rewardAmount  = Convert.ToInt32(placementJSON ["placement_reward_amount"].ToString());
        string rewardName    = placementJSON ["placement_reward_name"].ToString();
        string placementName = placementJSON ["placement_name"].ToString();

        ssp = new SupersonicPlacement(placementName, rewardName, rewardAmount);
        return(ssp);
    }
Пример #3
0
    //Invoked when the user completed the video and should be rewarded.
    //If using server-to-server callbacks you may ignore this events and wait for
    //the callback from the Supersonic server.
    //@param - placement - placement object which contains the reward data
    public void RewardedVideoAdRewardedEvent(SupersonicPlacement ssp)
    {
        //TODO - here you can reward the user according to the reward name and amount
        Debug.Log("RewardedVideoAdRewardedEvent");
        //string adResult = string.Format ("Ad Complete: {0} -- {1} -- {2}", ssp.getPlacementName (), ssp.getRewardName (), ssp.getRewardAmount ());
        //Debug.Log (adResult);

        //var grantable = PF_GameData.catalogItems.Find((item) => { });
        //PF_Bridge.RaiseCallbackError(string.Format("Completed {0}, attempted to grant ({1}x){2}, but this functionality must be performed on the Server.", ssp.getPlacementName(), ssp.getRewardAmount(), ssp.getRewardName()) , PlayFabAPIMethods.Generic, MessageDisplayStyle.error);

        Debug.Log(string.Format("PlacementId:{0} -- RewardId:{1}", queuedAd.PlacementId, queuedAd.RewardId));
        RouteActivityToPlayFab(queuedAd.PlacementId, queuedAd.RewardId);
    }
Пример #4
0
    public SupersonicPlacement getPlacementInfo(string placementName)
    {
        string placementInfo      = _androidBridge.Call <string>("getPlacementInfo", placementName);
        SupersonicPlacement pInfo = null;

        if (placementInfo != null)
        {
            Dictionary <string, object> pInfoDic = SupersonicJSON.Json.Deserialize(placementInfo) as Dictionary <string, object>;
            string pName   = pInfoDic [PLACEMENT_NAME].ToString();
            string rName   = pInfoDic [REWARD_NAME].ToString();
            int    rAmount = Convert.ToInt32(pInfoDic [REWARD_AMOUNT].ToString());

            pInfo = new SupersonicPlacement(pName, rName, rAmount);
        }
        return(pInfo);
    }
Пример #5
0
    public SupersonicPlacement getPlacementInfo(string placementName)
    {
        object[]            args      = new object[] { placementName };
        string              json      = this.getBridge().Call <string>("getPlacementInfo", args);
        SupersonicPlacement placement = null;

        if (json != null)
        {
            Dictionary <string, object> dictionary = Json.Deserialize(json) as Dictionary <string, object>;
            string pName   = dictionary["placement_name"].ToString();
            string rName   = dictionary["reward_name"].ToString();
            int    rAmount = Convert.ToInt32(dictionary["reward_amount"].ToString());
            placement = new SupersonicPlacement(pName, rName, rAmount);
        }
        return(placement);
    }
Пример #6
0
    public SupersonicPlacement getPlacementInfo(string placementName)
    {
        SupersonicPlacement sp = null;

        string spString = CFGetPlacementInfo(placementName);

        if (spString != null)
        {
            Dictionary <string, object> spDic = SupersonicJSON.Json.Deserialize(spString) as Dictionary <string, object>;
            string pName        = spDic ["placement_name"].ToString();
            string rewardName   = spDic ["reward_name"].ToString();
            int    rewardAmount = Convert.ToInt32(spDic ["reward_amount"].ToString());
            sp = new SupersonicPlacement(pName, rewardName, rewardAmount);
        }

        return(sp);
    }
Пример #7
0
 void SupersonicEvents_onRewardedVideoAdRewardedEvent(SupersonicPlacement placement)
 {
 }