One-Time Billing Time with Google Play In-App Billing

I currently have a free download application with disabilities. To unlock full features, a user needs to complete a one-time purchase using Google Play In-App Billing.

Recently, in order to increase the conversion rate, I plan to offer full time functions.

This means that the user can use the full functions for the first 7 days without the need for a one-time purchase.

After 7 days, he will return to the app with disabilities. If he likes the full features of the last 7 days, he will make a one-time purchase. If not, it will simply allow :)

I was wondering if there is a way that I can use the existing billing API for in-app purchases to achieve my time-to-time function?

I prefer not to process the server myself, if possible.

I know that the app subscription model offers a trial period: http://developer.android.com/google/play/billing/billing_subscriptions.html

However, the subscription model is not what I'm looking for. Mine belongs to unused items

+4
source share
2 answers

Google . , in-app - ( ), . , , Google.

, , :

1) 7 , . , , , , 7 .

2) .

3) Google-, .

, (1). , / , , , .

+5

Application

class MyApp extends Application {
    @Override
    public void onCreate() {
       super.onCreate();
       setTrialDate();
    }
 }

protected void setTrialDate() {

        // test already set
        SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
        long trialDate = settings.getLong(TRIAL_PERIOD_DATE_START, -1);
        if(trialDate == -1){
            long date = new Date().getTime() ;
            date += Consts.NUM_TRIAL_DAYS * Consts.DAY_MILSEC;
            SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
            SharedPreferences.Editor editor = settings.edit();
            editor.putLong(TRIAL_PERIOD_DATE_START, date);

        }
    }

,

    public boolean isInTrial(){
       SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
       long trialDate = settings.getLong(TRIAL_PERIOD_DATE_START, -1);

       if(trialDate == -1) {
          setTrialDate();
          return true;
       }

       long now = new Date().getTime();

       if(trialDate < now){
           return false;
       } else {
           return true;
       }
}

akira sed, , , - .

0

All Articles