Finally getting somewhere with PhoneGap...

  • OK - I've been slowly chugging through this and have managed to install (I think) the social elements needed for PhoneGap.

    I now need to connect the social button in my game to activate the code etc. So how do I implement those line of code with the Social Share button in my game?

    The plugin page here -, supplies the following:

    <button onclick="window.plugins.socialsharing.share('Message only')">message only</button>
    <button onclick="window.plugins.socialsharing.share('Message and subject', 'The subject')">message and subject</button>
    <button onclick="window.plugins.socialsharing.share(null, null, null, '')">link only</button>
    <button onclick="window.plugins.socialsharing.share('Message and link', null, null, '')">message and link</button>
    <button onclick="window.plugins.socialsharing.share(null, null, '', null)">image only</button>
    // Beware: passing a base64 file as 'data:' is not supported on Android 2.x:[/p] // Hint: when sharing a base64 encoded file on Android you can set the filename by passing it as the subject (second param)[/p] <button onclick="window.plugins.socialsharing.share(null, 'Android filename', 'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7', null)">base64 image only</button>[/p] [/p] // Hint: you can share multiple files by using an array as thirds param: ['file 1','file 2', ..], but beware of this Android Kitkat Facebook issue: [#164][/p] <button onclick="window.plugins.socialsharing.share('Message and image', null, '', null)">message and image</button>[/p] [/p] <button onclick="window.plugins.socialsharing.share('Message, image and link', null, '', '')">message, image and link</button>[/p] [/p] <button onclick="window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', '', '')">message, subject, image and link</button>[/p] [/code:20pd2ib3][/p] [/p] [b]FACEBOOK[/b][/p] [code:20pd2ib3][/p] <button onclick="window.plugins.socialsharing.shareViaFacebook('Message via Facebook', null /* img */, null /* url */, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via Facebook (with errcallback)</button>[/p] [/code:20pd2ib3][/p] [/p] [b]TWITTER[/b][/p] [code:20pd2ib3][/p] <!-- unlike most apps Twitter doesn't like it when you use an array to pass multiple files as the second param -->[/p] <button onclick="window.plugins.socialsharing.shareViaTwitter('Message via Twitter')">message via Twitter</button>[/p] <button onclick="window.plugins.socialsharing.shareViaTwitter('Message and link via Twitter', null /* img */, '')">msg and link via Twitter</button>[/p] [/code:20pd2ib3][/p] [/p] Thanks all

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)