Quantcast
Jump to content


Cómo Usar el Samsung In-App Purchase SDK en sus Juegos Creados con Unity


Recommended Posts

2020-09-16-01-banner.jpg

En este video del Programa para desarrolladores de Samsung, aprenda cómo integrar el SDK de compras en la aplicación (IAP) de Samsung en sus juegos de Unity.

Puede obtener más información en https://developer.samsung.com/iap

El proceso general para publicar su juego, cuando incluye pagos y microtransacciones por medio del Samsung IAP SDK es el siguiente:
Proceso de Publicación

1- Registro en el Portal

Para crear su cuenta y publicar en la Galaxy Store puede ir a http://seller.samsungapps.com

Haga clic en la esquina superior para crear su cuenta. Si ya tiene una cuenta de Samsung, puede ingresar con ella.
Haga Clic Aquí

2- Solicitar el Status de Vendedor

Una vez que haya creado su cuenta en el portal de desarrollo, puede solicitar su estatus de vendedor haciendo clic en el botón indicado en la imagen. Esto es necesario para poder vender diferentes artículos desde su aplicación.
Solicitar Status de vendedor

3- Registrar su Aplicación/Juego

Para ver todo el detalle de cómo registrar su aplicación en el portal de ventas, puede ver el video que se encuentra en https://youtu.be/fil7DmD1v3g

En general, se le va a solicitar que ingrese la información de su juego, como el nombre, descripción e imágenes promocionales.

4- Registro de los Artículos en Venta
Cuando su cuenta ha sido aprobada como una cuenta de vendedores, podrá tener acceso a la sección de “In App Purchase”.

Registrar los artículos a vender

Aquí podrá registrar los diferentes artículos que va a vender, como vidas ilimitadas, poderes especiales, u opciones de personalización para los personajes de su juego.

En el video podrá ver un poco más de detalle de cómo registrar cada uno de los artículos.

Plugin para Unity

Para poder usar el kit de desarrollo de la Samsung IAP, debe seguir los siguientes pasos:

1- Descargar desde https://developer.samsung.com/iap/samsung-iap-unity-plugin.html
2- Instalar el Plugin

  • a. En Unity haga clic en Assets -> Import Package -> Custom Package
    Adicionando el plugin en Unity

3- Arrastrar el Script en un objeto del juego

  • a. Este puede ser cualquier objeto de la UI, o como se ve en el video, un personaje de su juego.

Una vez que haya incluido el Script, puede revisar la documentación (https://developer.samsung.com/iap/samsung-iap-unity-plugin.html) para ver en detalle cómo llamar la SDK desde el código de su juego, pero aquí tiene los conceptos básicos:

Modo de operación

Para que la Galaxy Store sepa si su juego está realizando pruebas, o si ya està en modo de producción, debe usar el método SetOperationMode.

SamsungIAP.Instance.SetOperationMode(OperationMode.OPERATION_MODE_TEST);

Los posibles valores para el parámetro son OperationMode.OPERATION_MODE_TEST, OperationMode.OPERATION_MODE_TEST_FAILURE, y OperationMode.OPERATION_MODE_PRODUCTION.

Solicitar información de los artículos disponibles en venta

Para saber qué artículos se pueden ofrecer desde el juego, debe invocar el método GetProductDetails.

SamsungIAP.Instance.GetProductDetails("com.mygame.product1, com.mygame.product2,com.mygame.product3", OnGetProductsDetails);

En este ejemplo se está solicitando la información de los productos 1, 2, y 3, ya que se está enviando los identificadores de esos productos, separados por comas.

SamsungIAP.Instance.GetProductDetails("", OnGetProductsDetails);

En este ejemplo se esta pidiendo la información de todos los productos disponibles, ya que no se está enviando ningún identificador de productos.

Iniciar un pago

Para poder empezar la compra de un producto se debe invocar el método StartPayment.

SamsungIAP.Instance.StartPayment("com.mygame.product1", "pass_through_value", OnPayment);

En este ejemplo se está iniciando la transacción para el “com.mygame.product1”.
Usted puede especificar el valor del segundo parámetro y utilizarlo para verificar el éxito de la compra.

Y por último se especifica el “callback”, que es el método que se va a invocar cuando se finalice la transacción, sin importar si esta fue exitosa o no.

Artículos Consumibles

Usted puede usar el método ConsumePurchasedItems para reaprovisionar productos consumibles. Así el jugador puede comprar energía en su juego cuantas veces quiera, por ejemplo.

El primer parámetro es el identificador de la compra del artículo.

SamsungIAP.Instance.ConsumePurchasedItems(purchase_id, OnConsume);

Y el segundo parámetro es el método OnConsume que se activa cuando el proceso ha terminado, y este contiene información sobre el artículo consumido y el procesamiento de llamadas a la API.

Consultar productos adquiridos anteriormente

Para obtener la lista de todos los productos que un jugador ha comprado, puede usar el método GetOwnedList.

SamsungIAP.Instance.GetOwnedList(ItemType.all, OnGetOwnedList);

El primer parámetro puede ser ItemType.all, ItemType.item, o ItemType.subscription.

Con ItemType.all el método devuelve todos los artículos no consumibles comprados, los artículos consumibles que no se han consumido y los artículos de suscripción con suscripciones activas.

Con ItemType.item el método devuelve todos los artículos no consumibles comprados y los artículos consumibles que no se han consumido.

Y por último, con ItemType.subscription el método devuelve todos los artículos de suscripción comprados con suscripciones activas.

El segundo parámetro, es el método que se activará cuando el proceso ha finalizado.

Para obtener más tutoriales, visite Samsung Developers. (http://developer.samsung.com/)

View the full blog at its source

Link to comment
Share on other sites



  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Similar Topics

    • By Mahesh Gadhe
      <article>
              <div><img id="imageTag" src=""></div>
              <div><video id="videoTag" onended="onVideoEnded();" src=""></video></div>
              <!--<div id="YoutubePlayer" width="600" height="400" src="" frameborder="0" sandbox="allow-same-origin allow-scripts allow-popups allow-forms allow-top-navigation" style="z-index: 1;"></div>-->
              <div style="position:fixed; top:50%; left:50%; transform:translate(-50%, -50%); z-index:999;">
              <div id="YoutubePlayer" style="width:600px; height:400px;"></div>
          </div>

          </article>
      As to play the youtube video we need to use the youtube iframe, we are facing challenge here. When the youtube video plays on the TV, we lose control over app and hence next video as per CMS does not play. Same happens vice versa i.e when a video from CMS starts playing we are not able to play youtube video if it is next in the list.
    • By Samsung Newsroom
      A new, smart home companion is welcoming users home by taking care of household tasks, displaying the day’s events and sharing weather updates.
       
      Samsung Electronics introduced a new version of its AI home companion robot Ballie at a press conference at the Mandalay Bay Hotel in Las Vegas on January 8 (local time) — ahead of the Consumer Electronics Show (CES) 2024. First introduced at CES 2020, Ballie has been revamped with new advanced features to help users intelligently navigate their lives.
       
      Ballie acts as a personal home assistant, autonomously driving around the home to complete various tasks. By connecting to and managing home appliances, Ballie can provide a helping hand to users in many situations — continually learning from users’ patterns and habits to provide smarter, more personalized services. Ballie provides peace of mind by sending video updates of pets or loved ones to users’ devices when they’re away from home. What’s more, Ballie can set the mood for any home activity whether users are exercising, working or relaxing. From projecting workout videos on the wall or floor in an optimal size to playing music and answering phone calls, Ballie makes life at home more productive and enjoyable.
       
      Learn more about Ballie’s unique AI functionalities in the video below.
       
       View the full article
    • By Samsung Newsroom
      A new, smart home companion is welcoming users home by taking care of household tasks, displaying the day’s events and sharing weather updates.
       
      Samsung Electronics introduced a new version of its AI home companion robot Ballie at a press conference at the Mandalay Bay Hotel in Las Vegas on January 8 (local time) — ahead of the Consumer Electronics Show (CES) 2024. First introduced at CES 2020, Ballie has been revamped with new advanced features to help users intelligently navigate their lives.
       
      Ballie acts as a personal home assistant, autonomously driving around the home to complete various tasks. By connecting to and managing home appliances, Ballie can provide a helping hand to users in many situations — continually learning from users’ patterns and habits to provide smarter, more personalized services. Ballie provides peace of mind by sending video updates of pets or loved ones to users’ devices when they’re away from home. What’s more, Ballie can set the mood for any home activity whether users are exercising, working or relaxing. From projecting workout videos on the wall or floor in an optimal size to playing music and answering phone calls, Ballie makes life at home more productive and enjoyable.
       
      Learn more about Ballie’s unique AI functionalities in the video below.
       
       View the full article
    • By Samsung Newsroom
      Transparent LEDs are poised to redefine viewing experiences, making the line between content and reality virtually indistinguishable. Leveraging this groundbreaking technology, Samsung Electronics has upleveled its leading MICRO LED display to expand how users enjoy visual content.
       
      The company’s Transparent MICRO LED display was unveiled for the first time at Samsung First Look 2024 on January 7 (local time) — ahead of the Consumer Electronics Show (CES) 2024, the world’s largest consumer electronics and information technology exhibition held in Las Vegas from January 9-12. Combining superior craftsmanship with six years of tireless research and development, this new modular MICRO LED wowed attendees with its futuristic design. The Transparent MICRO LED’s crystal-clear, glass-like display has revolutionized the viewing experience and attracted the attention of global consumers.
       
      Check out how Transparent MICRO LEDs will make everything from sports to movies more vivid and immersive in the video below.
       
       View the full article
    • By Mahesh Gadhe
      Hello everyone. 
      I have one issue ...
      I want to delete files which are not present in response API from downloader folder of tizen device I have tries using tizen.system.resolve but has it is asynchronous call but  it is not working 





×
×
  • Create New...