How to install PhoneGap addon?

For discussion and help with the Construct 3 Plugin SDK

Post » Fri Oct 20, 2017 10:07 am

Hello all - don't know if this is the right place to ask this question but here goes...

I'm pretty new to Construct - I've not installed any addons yet, but I've downloaded and am trying to install the PhoneGap plugin and have downloaded the following files:

Image

I've found the Addon Manager in the Menu - but the manual says I can only install .c3addon files, but there are no .c3addon files in the PhoneGap plugin folder.

Can anyone let me know which files I have to install and how to install them.

Also, is PhoneGap the best addon to use for adding to a social share button on your app?

Thanks :)
B
14
S
7
G
9
Posts: 223
Reputation: 6,296

Post » Fri Oct 20, 2017 1:03 pm

-Phonegap plugins has nothing to do with C3 addons (plugins and behaviors).
-Which build service are you using: Scirra build service ? build.phonegap.com ? or locally using the Cordova CLI ?
If you are using the Scirra build, I don't think SocialSharing is supported yet.
B
35
S
14
G
3
Posts: 66
Reputation: 4,053

Post » Fri Oct 20, 2017 1:26 pm

AekiroStudio wrote:-Phonegap plugins has nothing to do with C3 addons (plugins and behaviors).
-Which build service are you using: Scirra build service ? build.phonegap.com ? or locally using the Cordova CLI ?
If you are using the Scirra build, I don't think SocialSharing is supported yet.


Thanks for replying.

I've no idea what build service I'm using. To be honest I've no idea what that means.

I've 99% created a game in C3 to be deployed on iOS, Android and Windows phones and just need to hook up the social sharing button and a screengrab button. As this is my first game I've yet to export etc, so I don't know what that stage entails.

From what I've seen of the PhoneGap addon in this tutorial (https://www.scirra.com/tutorials/1457/screenshot-sharing-ios-android/page-4) it seemed straightforward enough but there doesn't seem to be a .c3addon file to add.

Am I going in the wrong direction or are there other steps to complete before I use the PhoneGap addon etc?
B
14
S
7
G
9
Posts: 223
Reputation: 6,296

Post » Fri Oct 20, 2017 4:33 pm

That tutorial you read is from 2015;
.c3addon are for Construct3 which came out only recently.
Again, .c3addon are not Phonegap plugins. c3addon are installed to add new functionalities to Construct.
Phonegap plugins are not installed inside of Construct.

I think you've done everything that should be done in Construct which is calling the social-sharing function (window.plugins.socialsharing.share)

What you downloaded is a phonegap plugin that needs to be installed by the build service inside of your final build (for example your APK) NOT into your C3 project.
You won't be using it yourself unless you are building locally in your PC (which I think will be more confusing for your at this stage), so you can just delete it.

Here's what I suggest:
- You will be using build.phonegap.com to build your APK.
- In Construct, Export your project to Cordova
- In the export folder, find config.xml then add the following before the </widget>:
<plugin name="cordova-plugin-x-socialsharing" spec="5.1.7" />
This line tell the Phonegap build to install the social sharing plugin for you (like the one you downloaded)
- In the build.phonegap.com dashboard create a new app and upload the export folder.
- Before you hit the build button, you need to tell Phonegap how to sign your app, here's the official doc:
http://docs.phonegap.com/phonegap-build/signing/overview/

Sorry if this is complicated, building html5 games into mobile apps IS confusing at first, so be patient ;)
Scirra has made a built-in build service so that building apps can be super easy, but it's in a beta stage right now.
Before you try build.phonegap.com, ask if it's possible to make the Scirra build service install that plugin for you (assuming you use the paid version of C3)
If Scirra build service cannot install the social-sharing plugin then you'll have to use the build.phonegap.com
B
35
S
14
G
3
Posts: 66
Reputation: 4,053

Post » Fri Oct 20, 2017 7:59 pm

Thanks for replying :)

OK - so lets see if I've got this right (again, please remember i'm new to all this)

An Addon and a plugin are two distinct things - Addons are things like Data & Storage, Form Controls etc? whereas plugins are third-party code designed to bridge specific gaps?

--
I think you've done everything that should be done in Construct which is calling the social-sharing function (window.plugins.socialsharing.share) - I've not done this - where do I need to add (window.plugins.socialsharing.share) ?

- You will be using build.phonegap.com to build your APK. - just checked this url out - it's a paid service, correct? I'm guessing the $9.99p/m option is the one everyone goes for?
- In Construct, Export your project to Cordova - makes sense, both Android and iOS (although I don't know what Cordova actually is)
- In the export folder, find config.xml then add the following before the </widget>:
<plugin name="cordova-plugin-x-socialsharing" spec="5.1.7" /> - yep, found that.
This line tell the Phonegap build to install the social sharing plugin for you (like the one you downloaded)
- In the build.phonegap.com dashboard create a new app and upload the export folder. - I'll look at this once I've finished the app and signed up etc.

Before you try build.phonegap.com, ask if it's possible to make the Scirra build service install that plugin for you (assuming you use the paid version of C3) - I'll ask Scirra this, but not 100% sure what it is I'm asking or where to ask.
--

Again, thanks for your help. Looks like getting this thing live isn't as straight forward as I'd hoped. I'm sure it will all make sense once I've got a couple of published apps under my belt.
B
14
S
7
G
9
Posts: 223
Reputation: 6,296

Post » Fri Oct 20, 2017 10:17 pm

An Addon and a plugin are two distinct things - Addons are things like Data & Storage, Form Controls etc? whereas plugins are third-party code designed to bridge specific gaps?

Yes; but since addon and plugins are both generic terms terms that means practically the same thing, don't forget to be specific: construct add-on/plugins , phonegap plugin.


I've not done this - where do I need to add (window.plugins.socialsharing.share) ?

It's in the tutorial you have been following.

just checked this url out - it's a paid service, correct? I'm guessing the $9.99p/m option is the one everyone goes for?

Dont pay for it, there's a free tier.

.although I don't know what Cordova actually is)

https://www.quora.com/What-is-the-diffe ... its-engine

They both do the same thing which is wrapping your html5 game into an app ready to be published in the store. Cordova is free and you use it locally (no online build service). Phonegap is owned by Adobe, and it's basically Cordova plus some useful features.

.what it is I'm asking or where to ask.


Implementing the share function is done in 2 steps:
1- calling the share function in C2 in your eventsheet (as explained in the tutorial).
The share function is part of a phonegap share plugin. So step 2:

2- the build service has to find and add the phone gap share plugin, otherwise you function call won't work.

So just ask how to use the social share plugin (.https://github.com/EddyVerbruggen/Socia ... Plugin.git) in construct 3

I don't use construct 3 yet so I have no idea either. But Adobe build service is fine.

Btw this the wrong sub forum.
B
35
S
14
G
3
Posts: 66
Reputation: 4,053

Post » Mon Oct 23, 2017 4:14 pm

Thanks again for replying - I know I'm going to have 1000 questions before I get this working properly.

In the tutorial I'm following (https://www.scirra.com/tutorials/1457/screenshot-sharing-ios-android/page-3) it says:

Then head back to the Local key exists event and add the action "System > Set value" and set the variable to "ScreenshotLink" and use the value "WebStorage.LocalValue("Screenshot")"


Well, I'm not using WebStorage but LocalStorage so when I substitute it (LocalStorage.LocalValue("Screenshot")) I get the following error:

Image

Is this because I've got LocalStorage.LocalValue ? Should I remove LocalValue and have some variation on LocalStorage("Screenshot") - or is this completely wrong?
B
14
S
7
G
9
Posts: 223
Reputation: 6,296

Post » Sat Nov 11, 2017 1:11 pm

Right - I've uploaded a .zip file to build.PhoneGap.com (I've no idea what I'm doing) and I have an error flag - I'm guessing I need to add some sort of Key - where it says No key selected.

Image

Any idea where I get this key from?
B
14
S
7
G
9
Posts: 223
Reputation: 6,296


Return to Plugin SDK

Who is online

Users browsing this forum: No registered users and 0 guests