How to use RevenueCat on Watch?

跟風遠走 提交于 2021-01-29 09:14:07

问题


Has anyone had any luck with RevenueCat and independent watchOS apps? I am having trouble retrieving SKProducts that i setup on app store connect. Is there something different about Watch apps that I need to factor in the configuration of RevenueCat. For example, when it asks for Bundle ID - which bundle ID do i input? My watch app has 3 bundle IDs for the app, the watch app, watchkit extension. There's no documentation out there, it's very confusing.


回答1:


I'm Andy from RevenueCat.

RevenueCat does support Apple Watch, however, as of right now there are a couple of things to keep in mind:

  • watchOS has a bug where the receipt is stored in the wrong path in the development environment. I made a workaround in the RevenueCat side so that it behaves like you would expect, but it hasn't made it into a release as of today, so you'd have to switch to the develop branch of purchases-ios in order to use it. If you don't use develop, then purchases will fail while in the Sandbox environment, but they'll work correctly in production.

  • watchOS purchases are universal purchases, meaning that what you buy on Apple Watch should also work on iOS, and all platforms that your app supports.

  • In my testing I set up a RevenueCat app in the RevenueCat Dashboard with the bundle ID for the iOS app and a valid iTunes shared secret, and it worked correctly on the watch. I believe that it should work with the extension's ID as well, but I haven't tried yet. To be clear, my setup was:

    • Dashboard: com.revenuecat.sampleapp
    • iOS app: com.revenuecat.sampleapp
    • watchOS app: com.revenuecat.sampleapp.watchkitapp
    • watchOS extension: com.revenuecat.sampleapp.watchkitapp.watchkitextension
  • There's more detailed info about the radar and development for watch here: https://github.com/RevenueCat/purchases-ios/issues/207. There's also an example watchOS app in the main repo, https://github.com/RevenueCat/purchases-ios/tree/develop/Examples/SwiftExample.

Could you elaborate on the issues you encountered when fetching SKProducts? Are the products registered and Ready to Submit / Approved in App Store Connect? The bundleID should only matter for receipt validation, but not for fetching products, so I'm wondering if there might be something else going on. Similarly, the bug that's posted in the radar should only affect receipt validation.

Update: I think that you may need to set up the bundle IDs so that the watchOS app's bundleID has the iOS app's bundle ID as a prefix, like in the example I mentioned. And the watchOS extension would need to have the watchOS app's bundle ID as a prefix, again like in the example.



来源:https://stackoverflow.com/questions/62757631/how-to-use-revenuecat-on-watch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!