Finally getting somewhere with PhoneGap...

0 favourites
  • 1 posts
  • 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 - https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin, 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, 'http://www.x-services.nl')">link only</button>
    
    <button onclick="window.plugins.socialsharing.share('Message and link', null, null, 'http://www.x-services.nl')">message and link</button>
    
    <button onclick="window.plugins.socialsharing.share(null, null, 'https://www.google.nl/images/srpr/logo4w.png', null)">image only</button>
    
    // Beware: passing a base64 file as 'data:' is not supported on Android 2.x: https://code.google.com/p/android/issues/detail?id=7901#c43
    // Hint: when sharing a base64 encoded file on Android you can set the filename by passing it as the subject (second param)
    <button onclick="window.plugins.socialsharing.share(null, 'Android filename', 'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7', null)">base64 image only</button>
    
    // 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]
    <button onclick="window.plugins.socialsharing.share('Message and image', null, 'https://www.google.nl/images/srpr/logo4w.png', null)">message and image</button>
    
    <button onclick="window.plugins.socialsharing.share('Message, image and link', null, 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, image and link</button>
    
    <button onclick="window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, subject, image and link</button>
    [/code:20pd2ib3]
    
    [b]FACEBOOK[/b]
    [code:20pd2ib3]
    <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>
    [/code:20pd2ib3]
    
    [b]TWITTER[/b]
    [code:20pd2ib3]
    <!-- unlike most apps Twitter doesn't like it when you use an array to pass multiple files as the second param -->
    <button onclick="window.plugins.socialsharing.shareViaTwitter('Message via Twitter')">message via Twitter</button>
    <button onclick="window.plugins.socialsharing.shareViaTwitter('Message and link via Twitter', null /* img */, 'http://www.x-services.nl')">msg and link via Twitter</button>
    [/code:20pd2ib3]
    
    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)