godotengine / godot-ios-plugins

MIT License
126 stars 48 forks source link

support promouting purchaces #9

Closed Valeryn4 closed 3 years ago

Valeryn4 commented 3 years ago

promoting purchace. see: https://developer.apple.com/app-store/promoting-in-app-purchases/

copy from my old code

add new event "purchase_deferred" initializing an out-of-game purchase

sample:

while iap.get_pending_event_count() > 0:
        var event = iap.pop_pending_event()
        if event.type == "purchase_deferred" :
            iap.purchase( { "product_id": event.product_id} ) #deferred purchase

I am very bad and "OBJ-C" would be useful for me to help in the full implementation of all the functionality of promoted purchases.

Valeryn4 commented 3 years ago

The "SKStoreReviewController" function has been implemented.

#Tells StoreKit to ask the user to rate or review the app, if appropriate, using the specified scene.
Engine.get_singleton("StoreReviewController").request_review() #

image

naithar commented 3 years ago

Any reason to have request_review in a different plugin? If there is a reason for it, StoreReviewController should be added in a different PR.

Valeryn4 commented 3 years ago

Any reason to have request_review in a different plugin? If there is a reason for it, StoreReviewController should be added in a different PR.

I was in a hurry by accident. It was necessary to make different branches = (

naithar commented 3 years ago

Please squash commits into one. Also it's best not to use master branch to make PRs.

Valeryn4 commented 3 years ago

I don't have a poppy, I can't even test it) I usually send to a friend and he collects

I'll do it in the morning. I have a night already

naithar commented 3 years ago

Again, squash all commits into one with descriptive message, please.

Valeryn4 commented 3 years ago

Good day! I was lent yesterday a macbook for a day) I made 3 developments.

To test a promoted purchase, just call the following link in your browser:

tms-services://?action=purchaseIntent&bundleId=APP_SKU&productIdentifier=PRODUCT_SKU

APP_SKU - you app id (sample: com.you.app.id) PRODUCT_SKU - you product id (sample: com.you.product.id)

for "Share" this framework is taken with some corrections.

I have implemented everything in this thread

I did this for my project. But I would like to share our best practices. And I don't know much git. How to properly arrange this into an actual project?

naithar commented 3 years ago

Good day! I was lent yesterday a macbook for a day) I made 3 developments.

  • Promoted purchase
  • StoreReviewController
  • Share

To test a promoted purchase, just call the following link in your browser:

tms-services://?action=purchaseIntent&bundleId=APP_SKU&productIdentifier=PRODUCT_SKU

APP_SKU - you app id (sample: com.you.app.id) PRODUCT_SKU - you product id (sample: com.you.product.id)

for "Share" this framework is taken with some corrections.

I have implemented everything in this thread

I did this for my project. But I would like to share our best practices. And I don't know much git. How to properly arrange this into an actual project?

The best way would be to make different branch for each plugin you wish to include and make a PR. The only requirement for plugin is that it should not include or depend on any third-party libraries.

If possible I would also suggest not using your master/main branch for PRs.

I'm also not able to modify your PR to squash commits and cleanup the commit message, so I ask you to do this. Alternatively you can close this PR and reopen it from another branch (not master) with the same changes to AppStore plugin.

Valeryn4 commented 3 years ago

OK