src/ApprienUnitySDK/Assets/Apprien/Scripts/ApprienUtility.cs
/// <summary>
/// <para>
/// Parses the base IAP id from the Apprien response (variant IAP id)
/// </para>
/// <para>
/// Variant IAP id is e.g. "z_base_iap_id.apprien_500_dfa3", where 
/// - the prefix is z_ (2 characters) to sort the IAP ids on store listing to then end
/// - followed by the base IAP id that can be parsed by splitting the string by the separator ".apprien_"
/// - followed by the price in cents
/// - followed by 4 character hash
/// </para>
/// </summary>
/// <param name="storeIapId">Apprien product IAP id on the Store (Google or Apple) e.g. z_pack2_gold.apprien_399_abcd</param>
/// <returns>Returns the base IAP id for the given Apprien variant IAP id.</returns>
Parses the base IAP id from the Apprien response (variant IAP id)

Variant IAP id is e.g. "z_base_iap_id.apprien_500_dfa3", where
the prefix is z_ (2 characters) to sort the IAP ids on store listing to then end
followed by the base IAP id that can be parsed by splitting the string by the separator ".apprien_"
followed by the price in cents
followed by 4 character hash
Parses the base IAP id from the Apprien response ( variant IAP id ) Variant IAP id is e . g . " z_base_iap_id . apprien_500_dfa3 " where the prefix is z_ ( 2 characters ) to sort the IAP ids on store listing to then end followed by the base IAP id that can be parsed by splitting the string by the separator " . apprien_ " followed by the price in cents followed by 4 character hash
public static string GetBaseIAPId(string storeIAPId)
        {
            var result = storeIAPId;
            var apprienSeparatorPosition = result.IndexOf(".apprien_");
            if (apprienSeparatorPosition > 0)
            {
                result = result.Substring(0, apprienSeparatorPosition);
                result = result.Substring(2);
            }
            return result;
        }
public static string GetBaseIAPId ( string storeIAPId ) { var result = storeIAPId ; var apprienSeparatorPosition = result . IndexOf ( " " ) ; if ( apprienSeparatorPosition > 0 ) { result = result . Substring ( 0 , apprienSeparatorPosition ) ; result = result . Substring ( 2 ) ; } return result ; }
Parses the base IAP id from the Apprien response (variant IAP id)
Parses the base IAP id from the Apprien response ( variant IAP id )
// Default result to (base) storeIapId // First check if this is a variant IAP id or base IAP id // Get the base IAP id part, remove the suffix // Remove prefix
Returns the base IAP id for the given Apprien variant IAP id.
Returns the base IAP id for the given Apprien variant IAP id .
storeIAPId
string
storeIapId
Apprien product IAP id on the Store (Google or Apple) e.g.
Apprien product IAP id on the Store ( Google or Apple ) e . g .