Problem with In App Purchase

Problem with In App Purchase

BY 20 Jul 2013 Native Application Development

Hello, I’m trying to add an In App Purchase system in my game, but I can’t get the In App Purchase system to work…
Here is my code (widely inspired from the examples)

   
HashMap pArgList;
pArgList.Construct();

AppControl* pAc = AppManager::FindAppControlN(L"tizeninapp.IapClient", L"http://tizen.org/inapp/purchase");
if (!pAc)
{
NN_LOG("Billing not possible sorry");
return 4;
}

String key_mode = L"_mode";
String val_mode = L"0";

String key_transactionId = L"_transactionId";
String val_transactionId = L"1";

String key_itemId = L"_itemId";
String val_itemId((char*)itemid);

String key_itemGroupId = L"_ItemGroupId";
String val_itemGroupId = L"100000000000";

pArgList.Add(&key_mode, &val_mode);
pArgList.Add(&key_transactionId, &val_transactionId);
pArgList.Add(&key_itemId, &val_itemId);
pArgList.Add(&key_itemGroupId, &val_itemGroupId);

// stage one : initialization
app->waitingForStore = true;
pAc->Start(null, null, &pArgList, app);
while(app->waitingForStore)
{
KC_Sleep(100);
}

if(app->IAPState != APP_CTRL_RESULT_SUCCEEDED)
{
NN_LOG("Problem during first stage of Purchase");
delete pAc;
if(app->IAPState == APP_CTRL_RESULT_CANCELED)
return 2;
else
return 3;
}

<... end of the function ...>

We are here in a worker thread and the listener is the App, which set back the waitingForStore flag to false once the result received.

Does anybody see a mistake ?

Here are the error logs from the begining of the function to the return 3, where the function ends.

ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Base::Collection ( 2591 : 2591 ) : virtual const Tizen::Base::Object* Tizen::Base::Collection::ArrayList::GetAt(int) const(241) > [E_OUT_OF_RANGE] The index(2) MUST be greater than or equal to 0 and less than the number of elements(2).
ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Io ( 8719 : 8719 ) : static bool Tizen::Io::File::IsFileExist(const Tizen::Base::String&)(300) > [E_INVALID_ARG] Given filePath length is zero or exceeds system limitations.
ERROR / Tizen::App ( 8719 : 8719 ) : Tizen::Ui::Controls::Frame* Tizen::App::_UiAppImpl::GetFrameAt(int)(415) > [E_OUT_OF_RANGE] The index is greater than the number of frames.
ERROR / Tizen::Ui::Scenes ( 8719 : 8719 ) : result Tizen::Ui::Scenes::_SceneManagerImpl::Construct()(207) > [E_SYSTEM] A system error has been occurred. pUiApp->GetFrameAt(0) return null.
ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::_SimInfoImpl::Construct()(73) > [E_DEVICE_UNAVAILABLE] The operation failed because the SIM card is not ready.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::SimInfo::Construct()(73) > [E_DEVICE_UNAVAILABLE] Propagating.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::_SimInfoImpl::Construct()(73) > [E_DEVICE_UNAVAILABLE] The operation failed because the SIM card is not ready.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::SimInfo::Construct()(73) > [E_DEVICE_UNAVAILABLE] Propagating.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::_SimInfoImpl::Construct()(73) > [E_DEVICE_UNAVAILABLE] The operation failed because the SIM card is not ready.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::SimInfo::Construct()(73) > [E_DEVICE_UNAVAILABLE] Propagating.
ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Base ( 8719 : 8719 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47).
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::_SimInfoImpl::Construct()(73) > [E_DEVICE_UNAVAILABLE] The operation failed because the SIM card is not ready.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::SimInfo::Construct()(73) > [E_DEVICE_UNAVAILABLE] Propagating.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::_SimInfoImpl::Construct()(73) > [E_DEVICE_UNAVAILABLE] The operation failed because the SIM card is not ready.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::SimInfo::Construct()(73) > [E_DEVICE_UNAVAILABLE] Propagating.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::_SimInfoImpl::Construct()(73) > [E_DEVICE_UNAVAILABLE] The operation failed because the SIM card is not ready.
ERROR / Tizen::Telephony ( 8719 : 8719 ) : result Tizen::Telephony::SimInfo::Construct()(73) > [E_DEVICE_UNAVAILABLE] Propagating.
ERROR / Tizen::Ui::Scenes ( 8719 : 8719 ) : result Tizen::Ui::Scenes::_SceneManagerImpl::GoForward(const Tizen::Ui::Scenes::ForwardSceneTransition&, const Tizen::Base::Collection::IList*)(560) > [E_INVALID_STATE] SceneManager is in an invalid state. Policy provider not registered.
ERROR / Tizen::Ui ( 8719 : 8719 ) : virtual result Tizen::Ui::_ControlImpl::OnAttachedToMainTree()(2454) > [E_SYSTEM] System error occurred.
ERROR / Tizen::Ui::Controls ( 8719 : 8719 ) : virtual result Tizen::Ui::Controls::_FrameImpl::OnAttachedToMainTree()(580) > [E_SYSTEM] Propagating.
ERROR / Tizen::Ui ( 8719 : 8719 ) : result Tizen::Ui::_ControlManager::CallOnAttachedToMainTree(Tizen::Ui::_Control&)(667) > [E_SYSTEM] Propagating.
ERROR / Tizen::Ui ( 8719 : 8719 ) : result Tizen::Ui::_ControlManager::ActivateWindow(Tizen::Ui::_Window&)(587) > [E_SYSTEM] Propagating.
ERROR / Tizen::Ui ( 8719 : 8719 ) : result Tizen::Ui::_ControlManager::OpenWindow(Tizen::Ui::_Window&, bool)(498) > [E_SYSTEM] System Error.
ERROR / Tizen::Base::Collection ( 8719 : 8719 ) : virtual const Tizen::Base::Object* Tizen::Base::Collection::ArrayList::GetAt(int) const(241) > [E_OUT_OF_RANGE] The index(0) MUST be greater than or equal to 0 and less than the number of elements(0).
ERROR / Tizen::Ui::Animations ( 8719 : 8719 ) : virtual Tizen::Ui::Animations::_RootVisualElement::~_RootVisualElement()(60) > [E_INVALID_STATE] The RootVisualElement instance has been destroyed, but the layer information was not cleaned.
ERROR / Tizen::Ui::Animations ( 8719 : 8719 ) : virtual Tizen::Ui::Animations::_RootVisualElement::~_RootVisualElement()(60) > [E_INVALID_STATE] The RootVisualElement instance has been destroyed, but the layer information was not cleaned.
ERROR / Tizen::Base::Collection ( 2591 : 2591 ) : virtual const Tizen::Base::Object* Tizen::Base::Collection::ArrayList::GetAt(int) const(241) > [E_OUT_OF_RANGE] The index(2) MUST be greater than or equal to 0 and less than the number of elements(2).
INFO / hodti ( 8685 : 8701 ) : void mp_printf(const char *, …)(42) > Problem during first stage of Purchase
 

thanks by advance

Benjamin

Written by