在应用程序中有多个帐户的Ionic应用程序内购买 [英] Ionic in-app purchase with multiple accounts in app

查看:58
本文介绍了在应用程序中有多个帐户的Ionic应用程序内购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对应用内购买订阅有疑问.在我的应用中,您可以创建多个帐户.这是我的问题的一个例子.

I've a question about in-app purchase subscription. In my app you can create multiple account. this is an example of my problem.

Login paolo.rossi@gmail.com and buy premium,
Logout paolo.rossi@gmail.com
Login paolo.verdi@gmail.com
I've already premium and I can't buy

该如何解决?在许多应用程序中,您可以使用不同的帐户在同一部手机中购买高级版.是离子限制吗?

How to solve this? In many app you can buy premium in the same phone with different account. is it a ionic limitation?

推荐答案

我无法回答如何在Iconic中实现此目的,但这是我在Android中使用的通用方法.

I cannot answer how to achieve this in Iconic but this is the general approach I used in Android.

因此,想法是使用您自己的后端服务器来做两件事:

So the idea is to use your own back-end server to do two things:

1:通过Google验证您服务器上的付款明细.(这可以防止黑客入侵Freedom之类的应用程序)

1: Verify the payment details from your server with the Google. (This prevents hacking apps like Freedom)

2:使用服务器交付内容并验证有效期.

2: Use your server to deliver the content and verify expiry.

方法是:

  1. 登录paolo.rossi@gmail.com并购买高级帐户(将付款数据发送到您的服务器,并通过 Google/Apple 确认付款有效,而不是验证成功后,服务器会将 userId 和e xpiry time 之类的订阅数据发送到应用程序.应用程序应将此数据存储在本地存储空间)
  2. 注销paolo.rossi@gmail.com.(从本地存储空间中删除订阅详细信息)
  3. 登录paolo.verdi@gmail.com.(由于登录向服务器发送请求"此人是否有高级订阅?",因为Verdi没有订阅,因此服务器应发送否定反应.)
  4. 应用程序显示您没有高级订阅.威尔第可以买到它.
  1. Login paolo.rossi@gmail.com and buy premium (Send payment data to your server and verify with the Google/Apple that the payment is valid and not a fraud. After successful verification, the server sends subscription data like userId and expiry time to the app. The app should store this data in the local storage)
  2. Logout paolo.rossi@gmail.com.(Remove subscription details from the local storage)
  3. Login paolo.verdi@gmail.com. (On login send a request to your server "Does this person has a premium subscription?" since Verdi does not have the subscription the server should send a negative response.)
  4. The app shows you don't have the premium subscription. And Verdi can buy it.

因此,基本上,我们将userId与预订绑定在一起,并使用我们自己的服务器来验证预订.

So basically we bound the userId with the subscription and used our own server to verify the subscription.

希望这对某人有帮助.

这篇关于在应用程序中有多个帐户的Ionic应用程序内购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆