Slowly making progress with PhoneGap...

0 favourites
  • 8 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Hello C2 folks, posted this in C3 board also...

    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:20lmtzgf]
    
    [b]FACEBOOK[/b]
    [code:20lmtzgf]
    <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:20lmtzgf]
    
    [b]TWITTER[/b]
    [code:20lmtzgf]
    <!-- 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:20lmtzgf]
    
    Thanks all
  • Bump.

    Hi all, can anyone help me with this?

  • Is there a reason you aren't using Construct built in social plugins?

  • I thought Construct social plugins opened Twitter/Facebook etc in the phone’s browser rather than the phone’s native pop up. I thought the only way to get native mobile sharing pop up was via PhoneGap.

    Surely there must be someone who uses Construct who also uses PhoneGap for social sharing buttons.

  • Ok, I’ve been told I need to add this to my social share button...

    <button onclick="window.plugins.socialsharing.share('Message only')">message only</button>

    ...anyone know where/how I add this?

  • Guys, am I asking the wrong questions here?

    I've asked around several threads here and elsewhere on how to implement the social share plugin for Adobe PhoneGap. Surely someone using Construct must have used this functionality sometime. I'd honestly appreciate it if someone could show me how to use this.

    I've gotten so where the exported Contrusct files can be converted via PhoneGap, but adding the actual social share button functionality is something I can't work out how to do.

    Can anyone show me how to implement the following:

    <button onclick="window.plugins.socialsharing.share('Message only')">message only</button>

    Or can anyone share a simple capx or dropbox file showing the different files that have to be edited?

    Thanks all

    Happy Christmas.

  • To be honest I always assumed that buttons appeared in the raw HTML as they exist outside of the canvas - this would make adding the above code very straightforward. I must have been dreaming though, as they don't in the quick test I just did... now I'm very confused!

    Ashley or R0J0hound for confirmation?

    Merry Christmas!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Buttons are added to the webpage with JavaScript, they aren’t added to the exported html file.

    It looks like those snippets of html just runs some JavaScript when a button is clicked. Perhaps you can utilize the browser execjs action to run the Javascript in those snippets. At least that’s my impression. I don’t use social media so I haven’t concerned myself with how it works.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)