ShiVa3D
S3DX::application.getCurrentUser() returning NULL in plugin
ShiVa Plugin DevelopmentS3DX::application.getCurrentUser() returning NULL in plugin
by flippout » 25 Nov 2011, 22:49
Hey all, I'm hooking up In-app purchase through my plugin. I'm seeing a strange issue where S3DX::application.getCurrentUser() seems to return nil. I'm wondering if this might have something to do with where I'm calling it from - it's in an NSNotificationCenter-triggered event, in the main thread.
Has anyone ever dealt with anything like this before?
Has anyone ever dealt with anything like this before?
- flippout
- Gold Boarder

- Posts: 279
Re: S3DX::application.getCurrentUser() returning NULL in plugin
by NiCoX » 26 Nov 2011, 00:52
Hi,
S3DX API functions must be called from within a plug-in function (same thread, same calling context). So you need to store the notification somewhere (a global variable or better a singleton/manager, or even the plug-in derived class), and check it each frame from a plug-in function or from the "OnEngineEvent" function.
S3DX API functions must be called from within a plug-in function (same thread, same calling context). So you need to store the notification somewhere (a global variable or better a singleton/manager, or even the plug-in derived class), and check it each frame from a plug-in function or from the "OnEngineEvent" function.
-

NiCoX - Platinum Boarder

- Posts: 5626
- Location: France
Re: S3DX::application.getCurrentUser() returning NULL in plugin
by flippout » 26 Nov 2011, 01:02
Cool, thanks for the quick reply!
- flippout
- Gold Boarder

- Posts: 279
3 posts
• Page 1 of 1