U3DXT Game Crashes when calling SocialXT.Share


I have a button that calls the below code to open the iOS Activity Sheet for sharing to facebook etc.

public void OnSharePressed()
    SocialXT.Share(new object[]{"Example Message", "http://www.ExampleWebsite.co.uk"});

The Code compiles fine and iOS builds are successful.

However, when the button is pressed the game crashes on the SocailXT.Share method.

Unfortunately all I get from XCode is a EXC_BAD_ACCESS with the follwoing message.

0xb181c0: b 0xb18644 ; MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethod*, MonoObject*, MonoException**) + 1320 [inlined] mono_runtime_invoke_profiled(MonoMethod*, MonoObject*, void**, MonoException**, MonoClass*) + 60 at MonoBehaviour.cpp:927

Does anyone have any ideas about what could be causing this?

Thanks in advance,


**EDIT - Updated code snippet to remove the SocailXT.ShareCompleted event (moved to Start()) as suggested below. This however was not the cause of the crash.

Any other ideas on why this might be happening - something I’ve missed in setting up the U3DXT plugin perhaps? Any further help would be greatly appreciated as this is a time critical project.

**EDIT - Unity answers wont let me attach the crash log so here is a drop box link to it.

I’m running Unity 4.3.3 and playing the game on an iPad Air 7.1.1

I can get the Demo working when running in a separate project. The only difference between that and our game is what happens at build time.

Because we have a shared code repository that is nested inside of our game repository and due to Unity not allowing you to have multiple Plugins folders we have to shift all our plugins into one folder within the project root at build time.

Does this plugin have any known conflicts with other plugins. The only one we use that I could think this may be the case with is Prime 31.

Hi John, the SocailXT.ShareCompleted event needs to be subscribed only once. You would do that in your start or init function. Every time the button is pressed, you would just call SocialXT.Share(). Hope that helps.