Change paid app to free but know if user previousl

2019-01-01 08:55发布

I am considering changing my paid iOS app to be free, making it ad based, and having an in-app purchase option to remove the ads.

This sounds like a good idea if I was just launching the app, but we have over 30k paid downloads, and I don't want those users to ever see the ads when they update to the new version which is free.

Do I have any options here?

7条回答
余生请多指教
2楼-- · 2019-01-01 09:02

The only option is to release two updates. The first will write a value to NSUserDefaults identifying them as a purchaser. The second update is your ad-supported version which can read this purchaser-identifying value and hide the ads.

查看更多
永恒的永恒
3楼-- · 2019-01-01 09:02

In itunes connect you can generate promotion codes for in app purchases. You may create an IAP item for premium features, and give it as a promotion to the purchasers manually. Not an automatic solution though, it might save you from some headache.

查看更多
还给你的自由
4楼-- · 2019-01-01 09:08

Woudnt it be easier to just offer a free inanpp purchase at launch on the paid app. A button saying something like "Upgrade". And then switch that free inapp to paid on the next update?

查看更多
旧时光的记忆
5楼-- · 2019-01-01 09:09

try fetch all receipt & analyse them by following data:

"expires_date" = "2017-09-24 11:25:19 Etc/GMT";
"original_purchase_date" = "2017-09-24 11:20:21 Etc/GMT";
"product_id" = "com.yourapp.service";

1. Get all user's receipts from the app store

+ (NSArray*)all_receipts{
    // Load the receipt from the app bundle.
    NSURL *receiptURL = [[NSBundle mainBundle]appStoreReceiptURL];
    NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
    if(!receipt){
        //no receipts yet...
        return nil;     
    }

    NSError *error;
    NSDictionary *requestContents = @{@"receipt-data": [receipt base64EncodedStringWithOptions:0],
                                      @"password":YOUR_SECRED_SHARED};
    NSData *requestData = [NSJSONSerialization dataWithJSONObject:requestContents
                                                          options:0
                                                            error:&error];
    if (!requestData) {
        return [NSArray array];
    }

    // Create a POST request with the receipt data.
    //get current qa / production url
    BOOL sandbox = [[receiptURL lastPathComponent]isEqualToString:@"sandboxReceipt"];
    NSURL *storeURL = [NSURL URLWithString:@"https://buy.itunes.apple.com/verifyReceipt"];
    if (sandbox) {
        storeURL = [NSURL URLWithString:@"https://sandbox.itunes.apple.com/verifyReceipt"];
    }
    NSDictionary *jsonResponse = [LTServer postUrl:storeURL.absoluteString attach:requestContents];
    NSLog(@"jsonResponse %@",jsonResponse);
    if(!jsonResponse){
        return [NSArray array];
    }
    NSArray *receipts_data = jsonResponse[@"latest_receipt_info"];
    return [receipts_data mutableCopy];
}

2. Each receipt will contain a dictionary:

    "expires_date" = "2017-09-24 11:25:19 Etc/GMT";
    "expires_date_ms" = 1506252319000;
    "expires_date_pst" = "2017-09-24 04:25:19 America/Los_Angeles";
    "is_trial_period" = true;
    "original_purchase_date" = "2017-09-24 11:20:21 Etc/GMT";
    "original_purchase_date_ms" = 1506252021000;
    "original_purchase_date_pst" = "2017-09-24 04:20:21 America/Los_Angeles";
    "original_transaction_id" = 1000000339209266;
    "product_id" = "com.yourapp.service";
    "purchase_date" = "2017-09-24 11:20:19 Etc/GMT";
    "purchase_date_ms" = 1506252419000;
    "purchase_date_pst" = "2016-11-27 04:20:19 America/Los_Angeles";
    quantity = 1;
    "transaction_id" = 1000000337203266;
    "web_order_line_item_id" = 1000000030161297;
查看更多
回忆,回不去的记忆
6楼-- · 2019-01-01 09:17

If your current app has any data in user defaults or the keychain then that can be the indicator. When the app is first opened (in your new version) run a bit of code which:

  1. Checks for the data in defaults / keychain
  2. If found, enable the paid content / disable the ads
  3. Migrate that data to a new key (so you don't upgrade again / give away free stuff)
查看更多
初与友歌
7楼-- · 2019-01-01 09:19

Not really, no. Best you can do is publish an update while it's still a paid app that writes some value to NSUserDefaults (or a file in the app data directory, doesn't matter which) that indicates it was purchased. Wait a week or however long you want, then publish an update that removes that code, timed to be released the same day the price changes to free.

查看更多
登录 后发表回答