-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Has anyone implemented in-app purchases with MacGap? #62
Comments
I have the same requirement. I need to implement in app purchases. I've seen some other web based apps (Any.do comes to mind) do this in the Mac store so I know it's possible, although I don't think they were using MacGap but a different native container. |
The guys at Alternote did it, but I believe they wrote ObjC to get it working. Not possible with pure 100% javascript since macgap doesn't do anything related to IAPs. |
Hi all, I'd like to raise this issue again as I am working on an ambitious project with MacGap and I'd really like to integrate IAP. Would anyone be willing to build this feature for a bounty? If not, could someone point me to the right resources so that I can figure out how to build it myself? |
I think it may be possible by using ObjectiveC and WebViewJavascriptBridge. Though I haven't used this library yet, it seems plausible. |
@rawcreative — thoughts? |
I just looked at the IAP api — it does look feasible to implement inside MG. However, it occurs to me that Javascript is a very widely known language, and being uncompiled, would it not be pretty easy for people to manually call the appropriate function in your JavaScript and give themselves the purchase without actually going though the IAP stuff? Even with code obfuscation, anyone familiar with MG2 would be able to look up MG's (future) IAP API functions pretty easily and fire them manually. Perhaps it comes down to the purchasing demographic (and their likely JavaScript skills) and the cost of the items being sold (if they're cheap, it hardly seems worth digging into code to get them for free). Thoughts? |
I'm a firm believer that anything is easy to hack for a small subset of users and it's really just an honor system if people are willing to spend money or not. I don't expect to make IAP content hack-proof, just hope to offer it for those people who like my software and are willing to support me fairly for premium features. |
IAP code has to be implemented in Obj-C/Swift and requires entitlements, which means if we put IAP code into the MG codebase, any apps that are submitted to the app store will have to request that entitlement, whether they need it or not, otherwise the app will be rejected. So, while it might be nice to have in MG, it's probably not going to happen. There's also no need to use the WebViewJavascriptBridge code that was linked since you can either create your own events and event handlers in MG or just create your own Command.. |
It's the same situation with all the entitlements unfortunately. Would it be an option to use compiler directives to conditionally compile this kind of stuff in? |
I'd be interested in a tutorial on how to bake this in or something like a "plugin" for stuff like this. |
Do you mean on the obj-c (or Swift) side of MacGap? The best precedents to follow are the existing commands, I think. It's probably fair to say there's more involved in IAP than in any of the existing commands though (in terms of obj-c/Swift code, not the JS API). At the end of the day, sadly the fundamental problem with a request like this is motivation. Anyone capable of implementing this could probably earn $1,000 in the same timeframe. Their motivation to work on new MG features is likely to be either financial, for a project where they personally need the same functionality, or for fun. |
Apple's developer guide says Mac App Store applications can use IAPs. Has anyone ever done this with a MacGap app?
The text was updated successfully, but these errors were encountered: