Problem with extension-iap on IOS

I’m trying to implement extension-iap on ios, but currently it crashes when i try to read the store products:

Bad local allocator - requesting memory from unregistered thread!

|#5|0x00000001014ca238 in sendPurchaseProductDataEvent ()|
|#4|0x000000010290eb4c in ::alloc_empty_object() at /usr/local/lib/haxe/lib/hxcpp/4,0,64/src/hx/CFFI.cpp:314|
|#3|0x000000010290ebcc in hx::Anon_obj::operator new(unsigned long) at /usr/local/lib/haxe/lib/hxcpp/4,0,64/include/hx/Anon.h:72|
|#2|0x000000010296d4e0 in hx::Object::operator new(unsigned long, bool, char const*) at /usr/local/lib/haxe/lib/hxcpp/4,0,64/include/hx/Object.h:167|
|#1|0x0000000102969588 in hx::BadImmixAlloc() at /usr/local/lib/haxe/lib/hxcpp/4,0,64/src/hx/gc/Immix.cpp:1384|
|#0|0x00000001029693ac in (anonymous namespace)::DebuggerTrap() at /usr/local/lib/haxe/lib/hxcpp/4,0,64/src/hx/gc/Immix.cpp:76|

Can somebody confirm this? I had to write my own litte event dispatcher because i could not use flash flash libs, so this may cause the problem. Works fine on Android.

Are you using multiple threads?

This error occurs because the IAP native function is being called from a different thread than the main Haxe thread. This could be an issue in the IAP library but I’d take a peak at how it’s being called because this is the first time I’ve heard of this and the IAP library has been stable for a lot of developers

I didn’t do any extra thread stuff.

Just found this one:

And i managed to get it working by using flashups version:

Looks like some async dispatching helped?

@flashup Hey want access to HaxeExtension as a developer? Would you mind if we merged your changes back into the root project?

Thanks guys :slight_smile:

Hello, all!
@singmajesty Joshua, I forked my branch from charmdev’s iap fork. And the problem with async dispatch events to main thread was fixed by them.
It would be nice to give them access to HaxeExtensions too. They use extensions in production and I use their forks or synchronize my forks with their upstreams time by time.
I’ve asked them about it and they agreed to receive access and maintain extensions.

Here are their and my github accounts to giving access:

And about merging my repo, firstly, I think we need to unify extension-iap for nme and openfl users. Current version has some differences in JNI import.

1 Like

Invites sent, thank you :smiley:

Accepted. Thank you! :+1:

Great to see some progress here :heart_eyes:

Looking forward to have some nice up-to-date and working extensions :grinning: