-
Notifications
You must be signed in to change notification settings - Fork 316
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
How to use the library in watch app? #207
Comments
Hi! We're currently working on WatchOS support. You can follow the changes in #183, and see a sample watch app in #182. |
@aboedo Hi, thanks for your reply. I hope to get it asap. I am going to implement my in-app subscriptions for Apple Watch also. |
if you want to start playing around with it and setting it up in the meantime, feel free to check out the |
@aboedo Awesome! thanks. |
@aboedo Xcode 11.4 is already available. Are you going to merge feature/universal_purchases branch? |
hi @mecid! the branch has been merged into master, try it out! |
it'll also be a part of the next release, 3.2.0 |
@aboedo awesome! thanks. I think we can close the issue. |
@aboedo ok, I've updated to the latest version of the library. I use the same API key in the watch app. I call purchaserInfo function but returns an empty set of active subscriptions. On the other hand, I have an active sandbox subscription in the iOS part of the app. Should I configure somehow universal purchases in RevenueCat dashboard? |
@mecid Are you using the same app user ID for both the watch and the iOS app? If the app user IDs are different, RevenueCat will return an empty set of active subscriptions (until you restore or purchase again) |
@vegaro restoring doesn't work for me. I've got these logs while restoring the purchase on my Apple Watch. |
Anyone knows how to solve the issue? |
I haven't gotten purchases to work on the watch yet either. It seems that there's an underlying error when trying to refresh receipts:
I filed a radar a few weeks ago related to these issues, |
@aboedo thanks for the information. |
to provide more clarity around this:
|
update here: on the latest beta, |
Actually, as what I see, SKRefreshReceiptRequest will update the receipt on your device (restoreCompletedTransactions will not do that inclusively anymore ???) but the trace to those receipts is still not revealed |
thanks for the update. I tried this again today and got an interesting finding: In Sandbox, the receipt gets refreshed correctly, but stored in the wrong path. Instead of getting stored in To clarify, the problem is that appStoreReceiptURL (correctly) returns the url of the sandbox receipt when you’re in sandbox, but it seems like the refreshed receipt lives in the path where the production receipt would usually live.
I checked the receipt that was stored and it was a sandbox receipt that contained all the IAPs that I'd been testing. It probably works fine in production, since the URL would always be the production URL, so there's no mismatch. I haven't checked, though, since I'd have to upload an app that I can't really test. I've filed a radar for it, FB7699277. I'll update this issue if I hear back or if I have any new findings. In the meantime, if you want to try watchOS purchases, you can get around this watchOS bug by doing the following (very hacky, don't actually do this in production) approach: clone the RevenueCat SDK and updating - (NSData *)receiptData
{
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSString *receiptURLFolder = [[receiptURL absoluteString] stringByDeletingLastPathComponent];
NSURL *productionReceiptURL = [NSURL URLWithString:[receiptURLFolder stringByAppendingPathComponent:@"receipt"]];
NSData *data = [NSData dataWithContentsOfURL:productionReceiptURL];
RCDebugLog(@"Loaded receipt from %@", productionReceiptURL);
return data;
} This effectively replaces |
the issue is still present in 6.2.5 from my testing |
it looks like the bug is still present on 6.2.8, so I added a workaround for development purposes: |
Hi, I have an independent Watch app that I've been waiting to create a premium IAP for. I just saw your message and looked at the example you mentioned to adapt the configure, loadofferings and purchase functions for my app. From the debug log, it looks like it's doing the right thing, and searching for the correct product IDs. but how do I test my app since you can't test it in simulator? i installed it on my watch, but i obviously can't purchase IAP either since that is not approved by the App Store until i submit. I went ahead and submitted my app hoping the App Store would test this functionality, but it got rejected because they want to see a video demo'ing the IAP process: Guideline 2.1 - Information Needed We have started the review of your app, but we are not able to continue because we need access to a video that demonstrates the current version of your app in use on a physical watchOS device. Please ensure the video shows all functions and features of the new subscription process and features. |
@alamodey the workaround hasn't been released yet, but you should be able to use it by switching to the If you don't have access to an apple watch, Xcode 12 added the ability for the simulator to make purchases (See our blog post about it). So you might be able to use that to test in the simulator, but the build you submit must be built with Xcode 11 for now, since they'll reject builds done with a beta version of Xcode. Hope that helps! |
I just tried purchasing on the watchOS 7 simulator and it looks like it doesn't work yet, so you will have to use a physical device for testing |
Sorry I'm new to RevenueCat and IAP but I have a series 3 watch and i tried the following - i created a sandbox account and logged into my iPhone in the sandbox account setting (i couldn't find this setting on the watch so i assume you just log into your phone and it uses the same sandbox account on your watch?) i have adopted the code you used in that branch you mentioned, the purchase, configure and loadofferings methods. Is that all I need to do? I installed RevenueCat via cocoapods. or if I do this, does it give me the version of RevenueCat that doesn't support watchOS? i think i've setup everything correctly in the app store but in the simulator when i try to purchase something the console prints out: i can't tell if this is an issue with the app store (where my IAP have not been submitted for review yet), or an issue with revenuecat, or my code? |
For cocoapods, you should be able to get the version in the branch by doing pod 'Purchases', :git => 'https://github.com/RevenueCat/purchases-ios.git', :branch => 'develop' What you described sounds like an issue with configuration. If not, then I'd suggest checking out our support pages or contacting support to make sure you have everything set up correctly. |
also, note that while there is a bug in watchOS 6.2.x with how receipts are stored, you should still be able to load offerings / products correctly, since the bug only manifests after making a purchase. So the branch isn't the problem in your case. |
Thanks, I checked out the 'develop' branch and still can't load offerings. So I will reach out to support for help on configuring. I think I just need some clarity on bundle and product IDs. for an independent watchOS app, i have 3 bundle IDs for the app, watchkit, and watchkit extension. and similarly for the product ID of the IAP, i would need the correct bundle ID to use as the prefix (i assume). |
Hi, I haven't been able to get any help from RevenueCat support so I was wondering if you could help. I've been able to implement IAP properly on my iPhone app but for my watchOS app I can't load any offerings/packages. I think it all relates to the configuration but I can't figure out what is different between watchOS and iOS. In watchOS, I have 3 bundle IDs - and I have tried each one but still get the same debug log that can't find offerings/invalid product ID. Can you provide any guidance on this, there's no tutorials/examples available to show this working properly for an independent watch app. |
I believe that you may have to set up the bundle ids so that the iOS app is included as a prefix for the watch app, i.e.: iOS app: let me know if that works! |
👏, Switched the SDK to develop, and this unblocked my testing of sandbox subscriptions on a watchOS only app — Thanks so much! When is the next release scheduled for? |
My bundle IDs have always been setup as: In my RevenueCat configuration I have set the Bundle ID as com.ditomanshum.zungzi and that automatically loads my app icon whereas the other bundle IDs won't load my icon. Do you think there's any issue with the bundle IDs with the way they are now? |
@alamodey the app icon is set up in a separate file, entirely separate from RevenueCat. Look for @jasonzurita I'm glad that worked! I need to do some testing on watchOS 7, if things remain the same I'm targeting a release this week. If there are changes to the behavior in watchOS 7 it might take a bit longer, I'll keep you posted. |
A build including the changes here was released! You can now use version 3.5.0 for development on your favorite package manager or directly by downloading the binary. |
Hi, I have the error with version 4.0 when running it with the latest Xcode beta.
Showing Recent Messages
/Users/majid/Library/Developer/Xcode/DerivedData/SleepBot-fcdzzaaaglxzwpcmtdyrkdzbxapm/SourcePackages/checkouts/purchases-ios/Purchases/Public/RCPurchases.m:27:9: 'RCDeviceCache.h' file not found
The text was updated successfully, but these errors were encountered: