我最近购买了Milkman StoreKit原生扩展,用于在iOS上进行应用内购买。我在iPhone 4S上初始化StoreKit时遇到了问题。
我已按照Milkman游戏示例中的说明操作,我的代码如下所示:
log("Is Supported " + StoreKit.isSupported());
if(StoreKit.isSupported())
{
StoreKit.create();
log("StoreKit Initialized.");
// make sure that purchases will actually work on this device before continuing!
// (for example, parental controls may be preventing them.)
if (!StoreKit.storeKit.isStoreKitAvailable())
{
log("Store is disable on this device.");
return;
}
}
StoreKit.isSupported()函数的文档说明如下:
isSupported () method
public static function isSupported():Boolean
Checks if the current platform supports StoreKit. Note that this only determines whether the app is running under iOS (as opposed to Android, Windows, etc.) Use this call before initializing StoreKit in order to confirm that you are on iOS. (So that you can avoid initializing StoreKit on an unsupported platform when building a multi-platform app.)
Returns
Boolean — true if StoreKit is supported; false otherwise.
当我在笔记本电脑上从Flash Builder运行我的应用程序时,Storekit.isSupported()函数返回false(正如预期的那样,它不是iOS设备)。然而,当我构建IPA并部署到我的iPhone 4时,它仍然返回false,尽管我有一个WiFi连接并检查我对手机上的IAP没有任何限制。
有没有人遇到过同样的问题并解决了这个问题,或者有人对我接下来会尝试什么有什么建议吗?
非常感谢