0
votes

I'm coding a game and I'm using internationalisation. I want to share the score with the Facebook module. My code:

if(fb.getCanPresentShareDialog()) {
    fb.presentShareDialog({
        link: 'https://www.facebook.com/profile.php?id=100010324151821',
        name: 'Memory Speed',
        description:String.format(L('share'), Ti.App.score),
        caption:L('caption_partage_score_facebook'),
   });
} else {
    fb.presentWebShareDialog({
        link: 'https://www.facebook.com/profile.php?id=100010324151821',
        name: 'Memory Speed',
        description:String.format(L('share'), Ti.App.score),
        caption:L('caption_partage_score_facebook'),
    });
}.

'share': link to my strings.xml file

Ti.App.score: var with the score

When I click on the share button, the app closes itself.

I tried to replace Ti.App.score with a string like 'hello' and the app doesn't crash.

Does anyone know the reason for this behavior?

1

1 Answers

1
votes

Store "score" either at Globally using

 "Alloy.Globals.score" 

or store it in property e.g

  Ti.App.Properties.setString('score', '20');

And use either of it...