AndroidInAppBilling icon indicating copy to clipboard operation
AndroidInAppBilling copied to clipboard

PhoneGap Build support

Open maxmoore14 opened this issue 10 years ago • 35 comments

Are there plans to submit this plugin to PhoneGap Build?

maxmoore14 avatar Nov 08 '13 22:11 maxmoore14

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...

maxmoore14 avatar Jan 02 '14 21:01 maxmoore14

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: [email protected] T: +33 6 41 69 69 37

On Thu, Jan 2, 2014 at 10:18 PM, Max Moore [email protected] 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 .

poiuytrez avatar Jan 06 '14 14:01 poiuytrez

Sorry, what logo do you mean?

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

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

maxmoore14 avatar Jan 06 '14 15:01 maxmoore14

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.

bwin avatar Jan 06 '14 21:01 bwin

@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 avatar Feb 14 '14 19:02 maxmoore14

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?

maxmoore14 avatar Mar 05 '14 22:03 maxmoore14

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

poiuytrez avatar Mar 06 '14 15:03 poiuytrez

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 avatar Mar 06 '14 15:03 maxmoore14

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?

maxmoore14 avatar Mar 06 '14 17:03 maxmoore14

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).

opendata4ar avatar Mar 28 '14 20:03 opendata4ar

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 avatar Oct 17 '14 10:10 simoneb

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

simoneb avatar Oct 18 '14 00:10 simoneb

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.

simoneb avatar Oct 18 '14 01:10 simoneb

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

poiuytrez avatar Oct 20 '14 07:10 poiuytrez

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.

simoneb avatar Oct 20 '14 15:10 simoneb

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

poiuytrez avatar Oct 22 '14 12:10 poiuytrez

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

bwin avatar Oct 22 '14 16:10 bwin

@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

  • we don't have 2 plugin.xml's for v3
  • it's a cleaner repo (I'm not much of a githubber, so this may be just personal preference)
  • you don't have to checkout ~~/install~~ v2 if you're just using v3 (that should be everybody?)

~~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 avatar Oct 26 '14 20:10 bwin

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

bwin avatar Oct 26 '14 21:10 bwin

@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.

bwin avatar Oct 27 '14 18:10 bwin

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 avatar Oct 28 '14 08:10 poiuytrez

I have just created and pushed the tag.

poiuytrez avatar Oct 28 '14 08:10 poiuytrez

@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 avatar Nov 04 '14 17:11 bwin

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?)

bwin avatar Nov 04 '14 17:11 bwin

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.

maxmoore14 avatar Nov 04 '14 17:11 maxmoore14

Thanks for the quick reply.

bwin avatar Nov 04 '14 17:11 bwin

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 [email protected] 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 .

simoneb avatar Nov 04 '14 23:11 simoneb

:( 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.

bwin avatar Nov 05 '14 02:11 bwin

@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.

poiuytrez avatar Nov 05 '14 08:11 poiuytrez

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 avatar Nov 10 '14 09:11 bwin