poiuytrez / AndroidInAppBilling

Android App Billing plugin for Cordova
173 stars 144 forks source link

PhoneGap Build support #31

Open maxmoore14 opened 10 years ago

maxmoore14 commented 10 years ago

Are there plans to submit this plugin to PhoneGap Build?

maxmoore14 commented 10 years ago

I see this was marked as an enhancement? What are the steps required to complete this? I'd be happy to contribute some time/effort...

poiuytrez commented 10 years ago

Could you try to send the logo to them? The last time I tried I did not succeed because of a technical error.

Guillaume Charhon Co-founder & CTO | Arise.io E: guillaume@arise.io T: +33 6 41 69 69 37

On Thu, Jan 2, 2014 at 10:18 PM, Max Moore notifications@github.com wrote:

I see this was marked as an enhancement? What are the steps required to complete this? I'd be happy to contribute some time/effort...

— Reply to this email directly or view it on GitHubhttps://github.com/poiuytrez/AndroidInAppBilling/issues/31#issuecomment-31485448 .

maxmoore14 commented 10 years ago

Sorry, what logo do you mean?

https://build.phonegap.com/plugins/add

All you need to do is link to the repository I think.

bwin commented 10 years ago

Hi. I'm also looking forward for PG Build support.

You need an AdobeID or just sign in to PGB with yout Github account. Then go to https://build.phonegap.com/plugins/add and just link to a repo (as maxmoore14 said).

Maybe it's a problem that the actual plugin resides in the v3-directory.

maxmoore14 commented 10 years ago

@poiuytrez I'm pretty sure @bwin is correct. Can you fork v3 into its own repo? Looks like everything else should be ready to go.

maxmoore14 commented 10 years ago

I forked the repo, deleted v2, and submitted to PGBuild. It is currently waiting for review. But I just realized it is definitely going to fail because the base64EncodedPublicKey is hard coded into the java file. Any suggestions for how to fix this? I think there is a way to set the key in your config file like:

<gap:plugin name="com.mcm.plugins.androidinappbilling">
    <param name="base64EncodedPublicKey" value="ABCD1234" />
</gap:plugin>

Just not sure exactly how to wire it up. Can anyone help?

poiuytrez commented 10 years ago

Maybe we could provide the key to the javascript api but it would be very unsafe.

maxmoore14 commented 10 years ago

Yeah, an option, but I agree, not ideal. If we can get the parameter working, it would be safer I think. I posted questions for help on both the phonegap google group and the phonegap build community board. Cause I don't know how to make that work - but I have seen it done in other plugins.

maxmoore14 commented 10 years ago

Just had an idea... I read through the code and it looks like the license key is only used to verify purchases - for either a purchase action or a purchase query (which I assume is like a "restore" in iOS?).

Anyway, my plan is to verify purchases on my server. So what if I edit the code to gracefully just return purchases without verifying them and leave the key blank?

opendata4ar commented 10 years ago

Don't worry about exposing a public key. When used for server authentication in SSL/TLS, the client may verify that the server's public key is received from the proper host (see http://developer.android.com/training/articles/security-ssl.html).

simoneb commented 9 years ago

Any news on the ability to pass the license key as a parameter to the plugin in the configuration file, rather than as a resource which PGB cannot pick up?

simoneb commented 9 years ago

I just submitted a pull request to enable using the plugin on Phonegap Build

simoneb commented 9 years ago

I also noticed that the various inappbilling plugins available on PGB are actually forks of this one, some from people in this thread. This sounds like a waste of effort as they don't seem to be providing any additional value, so I would like to propose a coordinated effort to bring this plugin on PGB and get dismiss the clones. Unfortunately, it also seems that PGB has become a quite expensive platform for submitting plugins, as it is now required that you pay a monthly recurring fee in order to publish your plugins there.

poiuytrez commented 9 years ago

I would be glad to merge any pull requests regarding PGB support.

simoneb commented 9 years ago

Now that the pull request allowing the parameterization of the license key (thus introducing support for PGB) is merged, it would be nice if someone would publish it to the PGB plugins. As far as I can see there are several plugins published, but all of them are forks of this project. Publishing requires a license though.

poiuytrez commented 9 years ago

I have just contacted the phonegap team to try to get a free account.

bwin commented 9 years ago

@poiuytrez If it's just about the Account, then I can do it.

bwin commented 9 years ago

@poiuytrez there are 2 changes that have to be made to enable PGBuild support:

1. change license-name in plugin.xml

the PGBuild config parser doesn't recognize it, if it's not just "MIT".

2. choose another plugin-id

original plugin id "com.smartmobilesoftware.inappbilling" is already taken on PGBuild. https://build.phonegap.com/plugins/707KikeReto/InAppPurchase-Android https://github.com/KikeReto/InAppPurchase-Android whoever uploads first is the owner of the plugin id. Also we can't use "com.smartmobilesoftware.inappbilling-pgbuild". I'm sorry for that, it happened while testing as the PGBuild-submit-plugin-interface is a bad joke...

(3.) this is optional, but I would strongly recommend it - restructure the project files

3.1 if you plan to develop v2 further (otherwise skip 3.1)

create a new branch "v2". switch to v2 branch. delete all top-level files except ".gitignore" and move all files from v2 to root dir. delete v2 and v3 dirs. then all v2-development would happen in the v2-branch. if you just move the files (with "git mv") then the history of the files stays intact.

(AFAIK you can always do that later, even if you have already made the "changes to v3" from the next chapter.)

3.2 changes to v3

delete all top-level files except ".gitignore" and move all files from v3 to root dir. delete v2 and v3 dirs.

now the master-branch only contains v3.

benefits

to clarify "install" in the last sentence: I know v2 won't be really installed, but the files would still be copied to any app just wanting to use v3. (That's not that big of a deal, but nonetheless I don't like it.) I think I was wrong there.

(4.) tag releases in git

I'm actually not sure on this one, but I think the released versions of this plugin have to be tagged e.g. "v3.0.2" in git. On the other hand, it wouldn't hurt, even if it's not necessary for PGBuild.

outcome

Have a look at https://github.com/bwin/AndroidInAppBilling to see where this would lead. I would like to hear your feedback on this. I do not plan to keep this repo, it's just temporary.

If we fix at least the first two (minor) problems, I would be happy to submit your plugin to PGBuild. I think you should have the repo thats the source for PGBuild. Then I'm just the one who submitted it. If I clone your whole repo, it's the same thing already done by KikeReto (see 2.) and it would be my responsibility to keep the fork up-to-date.

I will send you a pull req that includes the changes in 1. and 3.2. For 2. you have to come up with a new plugin id.

bwin commented 9 years ago

Just FYI: last (and only) time I submitted a plugin to PGBuild I think it took 4+ weeks till they reviewed it...

bwin commented 9 years ago

@poiuytrez: Any ideas for a new plugin id? I know it's a PITA... What about "com.smartmobilesoftware.androidinappbilling" ?

When we have a new id, we should bump the version to 3.0.2 and add a git tag "v3.0.2". After that I will publish it on PGBuild.

poiuytrez commented 9 years ago

com.smartmobilesoftware.androidinappbilling looks good. Could you handle the rename and test it? I still do not have any feedback from the phone gap team.

poiuytrez commented 9 years ago

I have just created and pushed the tag.

bwin commented 9 years ago

@poiuytrez sorry for the late reply. I am really busy at the moment.

Could you handle the rename and test it?

The rename was already in the PR, it's merged, everything is ok.

About testing: Did you mean... a) test, if the new plugin id is available on PGBuild or b) test, if the plugin is still working as expected. If (a) then already done, the id is yours. But if (b) then still yes, but not this week (I have no demo project ready and a lot of work to do already). (But since we didn't change any code it should be ok.)

I also already submitted it to PGBuild. Status is "pending review". I report back if it's released. Will be at https://build.phonegap.com/plugins/1247 . But since it's not released, you get an error (for now) if you click the link. (Looks like the review process has gotten faster in the meantime. Expect 1-2 weeks.)

bwin commented 9 years ago

F*ck. I thought you could release new versions just by adding a new git tag (like "v9.9.9"). But it looks like you need me to publish updates to PGBuild. Don't get me wrong, it's ok that way, but I would have liked it better, if you could've done it independently.

@maxmoore14 correct me if I'm wrong. You know more about this than me. I have just 1 plugin and never needed to update it... (I think I have to resubmit the plugin after a version bump, right?)

maxmoore14 commented 9 years ago

Correct. Unfortunately the PGB process is very manual. Every tiny little change requires a completely new submission to and review by PGB. Which can take weeks.

bwin commented 9 years ago

Thanks for the quick reply.

simoneb commented 9 years ago

My feeling is that with so much friction in publishing and keeping plugins up to date PGB won't go very far, but there don't seem to be many alternatives right now.

On Tue, Nov 4, 2014 at 6:33 PM, Benjamin Winkler notifications@github.com wrote:

Thanks for the quick reply.

— Reply to this email directly or view it on GitHub https://github.com/poiuytrez/AndroidInAppBilling/issues/31#issuecomment-61680638 .

bwin commented 9 years ago

:( hadn't even the sdk installed... or ant or jdk or anything... Checked at least that it still compiles. Sorry, hadn't even done that before.

@simoneb PGB should also allow private plugins. No review-process, no sharing, no delay(!), no nothing.

poiuytrez commented 9 years ago

@bwin I meant (b).

By the way, I never got any reply from the Phonegap team. I sent them 2 emails telling them that I gave a lot to the community and that they should give me a free account to publish the plugin. It's a shame.

bwin commented 9 years ago

Plugin is now active. https://build.phonegap.com/plugins/1247

Use it on PGB with:

<gap:plugin name="com.smartmobilesoftware.androidinappbilling" version="3.0.2" />

BTW you cannot test IAB-functionality with draft apps anymore, see http://developer.android.com/google/play/billing/billing_testing.html#draft_apps

@poiuytrez if you need/want to release an update just mention me. And shame on me, I still didn't have time to test it...

bwin commented 9 years ago

If noone else does it in the meantime, I'll update the readme in a few days.

bwin commented 9 years ago

FYI: the link from the PGB-plugin-page to the GitHub-readme is always linked to a specific commit (e.g. https://github.com/poiuytrez/AndroidInAppBilling/blob/c9eaf5a/README.md), so even for updates to the readme you (would) have to resubmit the plugin. It (kind of) makes sense, but you have to know it.

shochberg commented 8 years ago

Hello, What is the status of PGB support currently? I found the app at https://build.phonegap.com/plugins/1247 per above, but the config.xml entry for it as shown there:

is different from what is shown in the earlier comment:

and those are still different from what is shown in the README (where it includes a billing key).

Sorry if these are newbie questions, but I'm stuck.

I've tried several variations but I'm getting no response when attempting to use the plug in, (not even a success or failure) so I'm clearly not accessing it correctly.The README implies that you need to load the plugin locally using the SDK even when using PGB, which doesn't make sense to me.

Can you tell me specifically how to add this plugin only using PGB (or is that not possible?)

Thanks.

shochberg commented 8 years ago

I found and corrected my problem. I simply needed to make sure that cordova.js was called from the page where I was calling the inAppBilling plugin. Thanks.

poiuytrez commented 8 years ago

Could you please add your comment in the documentation?

On Mon, Jan 4, 2016 at 3:24 PM, shochberg notifications@github.com wrote:

I found and corrected my problem. I simply needed to make sure that cordova.js was called from the page where I was calling the inAppBilling plugin. Thanks.

— Reply to this email directly or view it on GitHub https://github.com/poiuytrez/AndroidInAppBilling/issues/31#issuecomment-168689846 .