Promotional IAP

Promotional IAP is provided for iOS 11. This function allows you to register twenty-in-app products to expose through the Product list or Search box on Apple App Store. On game, utilize Hive SDK v4.4.1 to activate Promotional IAP.

Note

This function is provided for iOS 11 with Hive SDK v4.4.1 and later.

Refer to the followings for details of Promotional IAP.

To code the Promotional IAP, Hive SDK provides checkPromotePurchase API. The API returns Market PID, which is requested from Apple App Store. Make sure to implement the following works before calling checkPromotePurchase API.

After initializing IAP v4 and completing the actions above you can receive iappromote event through UE global callback. When sending the event, call Product List Search API and checkPromotePurchase API in sequence to receive Market PIDs of which users requested to purchase from App Store. When Market PID is returned, code for users to purchase the item matched with Market PID.

Note
  • The moment calling checkPromotePurchase API should be available for app purchase. Make sure to complete login, IAP v4 initialization and item search before call the API.

  • Make sure to carefully manage Market PID sent from games. It is sent only once.

API Reference: hive.IAPV4.checkPromotePurchase

using hive;    
    IAPV4.checkPromotePurchase((ResultAPI result, String marketPid) => {    
      if (result.isSuccess()) {    
      // TODO: Check marketPid and proceed with product purchase using purchase API    
      }    
});
#include "HiveIAPV4.h"

FHiveIAPV4::CheckPromotePurchase(FHiveIAPV4OnCheckPromotePurchaseDelegate::CreateLambda([=](const FHiveResultAPI& Result, const FString& MarketPid) {
        if (Result.IsSuccess()) {
                // Check marketPid and proceed with product purchase using purchase API
        }
}));

API Reference: IAPV4::checkPromotePurchase

#include <HIVE_SDK_Plugin/HIVE_CPP.h>    
    using namespace std;    
    using namespace hive;    
    IAPV4::checkPromotePurchase([=](ResultAPI const & result, string marketPid) {    
      if (result.isSuccess()) {    
      // TODO: Check marketPid and proceed with product purchase using purchase API    
      }    
}

API Reference: IAPV4Interface .checkPromotePurchase

import HIVEService    
    IAPV4Interface.checkPromotePurchase() { result, marketPid in    
      if result.isSuccess() {    
      // TODO: Check marketPid and proceed with product purchase using purchase API    
      }    
}

API Reference: HIVEIAPV4 checkPromotePurchase

#import <HIVEService/HIVEService-Swift.h>    
    [HIVEIAPV4 checkPromotePurchase: ^(HIVEResultAPI *result, NSString *marketPid) {    
      if ([result isSuccess]) {    
      // TODO: Check marketPid and proceed with product purchase using purchase API    
      }    
}];