Unity Soomla Android In App Purchase(IAP) by

31
Aug
0

วันนี้เราจะมาสอนวิธีการใส่ In App Purchase ใน App ของเรากันนะครับ โดยใช้ Library ที่ชื่อว่า Soomla นะครับ ซึ่งตัว Soomla นี้เป็น Library ที่สามารถทำ In App Purchase ได้ทั้งฝั่ง Android และ iOS เลยนะครับ แต่วันนี้เป็นของฝั่ง Android นะครับ ของ iOS จะยกไปไว้คราวหน้านะครัช

วิธี Import Library และ Settings ค่าก่อนเริ่มต้น
– ขั้นแรก ให้ Download Soomla จาก https://github.com/soomla/unity3d-store ก่อนนะครับ
– Import Soomla จาก Unity package ที่ Download มาใน Project ของเรานะครับ
– Build Project ให้เป็น .apk และ Upload ขึ้นไปบน Google Console
** ต้องใส่ Keystore, Keystore password, เลือก Alias และใส่ Alias password ให้ครบก่อน (ใส่ได้ที่ Build Settings => Player Settings => Publishing Settings)
*** หากยังไม่มี Keystore แนะนำให้ไปสร้างจากเครื่องที่เป็น iOS เพราะจากประสบการณ์ที่ผ่านมาเคยสร้างจากเครื่อง Windows แล้ว Keystore ใช้ไม่ได้ Sign ไม่ผ่าน – -”
– เพิ่ม In App Products ใน Google Console อย่าลืมตั้งเป็น Active
** ตรงนี้กว่าที่ In App Products จะสามารถใช้ได้จริงอาจจะกินเวลาหลายชั่วโมงหรือ เป็นวันก็เป็นได้
– เพิ่ม Testing Google Account ใน Google Developer Console (อันอื่นที่ไม่ใช้ Developer Account)
– ใน Unity หลังจาก Import Soomla Package เสร็จแล้ว ใน Tap Window จะมี ตัวเลือก Soomla เพิ่มขึ้นมา ให้เลือก และ เลือก Edit Settings (Window => Soomla => Edit Settings) ใส่ Soomla Secret (ใส่แล้วห้ามเปลี่ยนอีก) และ ในตัวเลือก Google Play ใส่ API Key ที่ได้จากใน Google Developer Console

ต่อไปเป็นตัวอย่างการนำ Library Soomla มาใช้นะครับ

Enjoy this article?

Consider subscribing to our RSS feed!

Filed under: Uncategorized

No Comments

No comments yet.

Leave a comment

RSS feed for comments on this post