Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Patrick

I know I posted the Eject IAP problem yesterday and shouldn't post it again.

But I am extremely desperate -- today I tried something very simple -- stripped all codes so that whole program just has a main.js containing the IAP example with nothing else -- no entities, no Level* objects, nothing.

Of course I changed the IAP product name to match those in my iTunes Connect. That example ran and retrieved the product list, but after purchase() was called it crashed! I tried to remove the purchase() call and then it crash after retrieving the product list.

I guess there is an integration problem I seriously missed. But I couldn't think of anything, because the example looks very simple and what could I did wrong?

1 decade ago by Patrick

Today I moved the codes out from main.js and run it with bare Ejecta. It works fine.

Seems there is something wrong putting the codes inside main.js.

I will explore more.

1 decade ago by Patrick

Problem Solved.

Instead of putting the IAP codes inside the Impact 'class', I moved them to Ejecta at the beginning of index.js, before all the include statements, to allow the Impact codes to 'see' the IAP function.

Then it worked fine without crashing.

1 decade ago by Patrick

However, the same piece of codes work on iPad 6.1 Simulator, but failed on iPad 5.1 Simulator.

1 decade ago by Patrick

the error shows ---> JS: An unknown error has occurred

1 decade ago by neogope

Hi Patrick, could you provide your index.js file, where you added the IAP code? I am having the same issues at the moment and would like to see how you fixed it.

Thanks!

1 decade ago by Patrick

neogope, I will show you an example later today after finishing the works. Just one piece of information you may want to know: I surfed the web and it seems that In-app purchase was only introduced since iOS 6.1. If this is true, it is very stupid that I asked the question of why iOS 5.1 does not work.

But it is good to know, at least.

1 decade ago by Patrick

Hi neogope, I posted my experiences, findings and codes on a new thread. See the thread "TIPS and PITFALLS OF MAKING IAP WORKING"

Thank you.

Patrick Ko
Page 1 of 1
« first « previous next › last »