28 lines
No EOL
941 B
C#
28 lines
No EOL
941 B
C#
using System.Collections.Generic;
|
|
using ShiroginSDK.Runtime.Core.SDK;
|
|
using ShiroginSDK.Runtime.Shared.Constants;
|
|
using UnityEngine;
|
|
|
|
namespace ShiroginSDK.Editor.IAP
|
|
{
|
|
public static class IAPNameProvider
|
|
{
|
|
/// <summary>
|
|
/// Returns all productIds from the active StoreRepository in SDKConfig.
|
|
/// </summary>
|
|
public static IEnumerable<string> GetIAPNames()
|
|
{
|
|
var config = Resources.Load<ShiroginConfig>(SDKConstants.ConfigResourcePath);
|
|
if (config == null || config.storeRepository == null) return new List<string> { "⚠ No Repository Found" };
|
|
|
|
var list = new List<string>();
|
|
var allItems = config.storeRepository.GetAll(); // ✅
|
|
|
|
foreach (var item in allItems)
|
|
if (item != null && !string.IsNullOrEmpty(item.productId))
|
|
list.Add(item.productId);
|
|
|
|
return list;
|
|
}
|
|
}
|
|
} |