Comments (4)
I have sent a pull request that checks if an auto-renewable subscription is still valid.
from rmstore.
@xgil78 Merged with minor changes. Up to add the unit tests as well? :)
from rmstore.
I have sent a pull request with one single simple test. Without a valid app receipt I don't really know how to add more tests.
What I suggest is you save a real app receipt as a file with some test purchases in it:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"appReceiptForTesting.data"];
[asn1Data writeToFile:filePath atomically:YES];
Then add that file to the test target bundle. After that we can use the file to initialize RMAppReceipt
in the tests:
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *filePath = [bundle pathForResource:@"appReceiptForTesting" ofType:@"data"];
NSData *data = [NSData dataWithContentsOfFile:filePath];
_receipt = [[RMAppReceipt alloc] initWithASN1Data:data];
I have tried it with my own store products and it works. It should be done with robotmedia test products so anyone can add tests with the same purchased items.
If you like the idea, please add an auto-renewable subscription purchase to your testing app receipt as well.
from rmstore.
@xgil78 You can also test code execution of isActiveAutoRenewableSubscriptionForDate:
.
Good idea. More than including valid receipts, testing with NSData constants containing the ASN1 part of valid receipts should be enough. I'll give it a go later this week.
from rmstore.
Related Issues (20)
- How an appid can purchase the same automatic subscription product for multiple user IDs
- iOS 11 new storekit feature : buy in-app directly from apple store HOT 6
- RMAppReceipt RMASN1ReadInteger undefined behavior
- Update defaultStore to return instancetype?
- Create a new official fork to keep RMStore up to date HOT 3
- Crashes in `RMKeychainGetValue` HOT 1
- Subscription expired notification for auto-renewable subscription HOT 1
- Problems conflicting with BoringSSL HOT 1
- Will disconnect from keychain mean purchases can't be restored? HOT 1
- Getting SSServerErrorDoamin code=2059 HOT 1
- iOS 12 beta “can not connect itune store” HOT 1
- TestFlight vs Sandbox for RMAppReceipt
- Project Catalyst issue
- Checking for an active auto-renewable subscription returns incorrect results HOT 2
- Subscriptions HOT 3
- 用户第一次绑卡操作时候漏单处理 HOT 8
- 'RMStoreContentDownloader' defined here has different definitions in different modules; first difference is this method HOT 2
- Receipt is nil
- Does this support Xcode 13.4.1?
- Couldn’t communicate with a helper application
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rmstore.