示例#1
0
        /// <summary>
        /// Handles an <c>onSocialActionCancelled</c> event
        /// </summary>
        /// <param name="message">
        /// Will contain a numeric representation of <c>Provider</c>
        /// numeric representation of <c>SocialActionType</c> and payload</param>
        public void onSocialActionCancelled(String message)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onSocialActionCancelled");

            JSONObject eventJson = new JSONObject(message);

            Provider         provider     = Provider.fromInt((int)eventJson["provider"].n);
            SocialActionType socialAction = SocialActionType.fromInt((int)eventJson["socialActionType"].n);

            JSONObject payloadJSON = new JSONObject(eventJson ["payload"].str);

            ProfileEvents.OnSocialActionCancelled(provider, socialAction, ProfilePayload.GetUserPayload(payloadJSON));
        }
示例#2
0
        /// <summary>
        /// Handles an <c>onSocialActionFinished</c> event
        /// </summary>
        /// <param name="message">
        /// Will contain a numeric representation of <c>Provider</c>
        /// numeric representation of <c>SocialActionType</c> and payload</param>
        public void onSocialActionFinished(String message)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onSocialActionFinished");

            JSONObject eventJson = new JSONObject(message);

            Provider         provider     = Provider.fromInt((int)eventJson["provider"].n);
            SocialActionType socialAction = SocialActionType.fromInt((int)eventJson["socialActionType"].n);

            JSONObject payloadJSON = new JSONObject(eventJson ["payload"].str);

            //give a reward
            Reward reward = Reward.GetReward(ProfilePayload.GetRewardId(payloadJSON));

            if (reward != null)
            {
                reward.Give();
            }

            ProfileEvents.OnSocialActionFinished(provider, socialAction, ProfilePayload.GetUserPayload(payloadJSON));
        }