Skip to content

TotenDev/libLestrade

Repository files navigation

libLestrade

Simple iOS library to validate receipts using Lestrade. This project use nicklockwood/Base64 to encode the receipt bytes and tonymillion/Reachability to check for connectivity.

Installation

Compile

Get the code:

git clone https://github.com/TotenDev/libLestrade.git
cd libLestrade
open Lestrade.xcodeproj

or

Use the pre-compiled libs:

Usage

Add the files to your project, #import "Lestrade.h". Validation example:

NSURL *validationURL = [NSURL URLWithString:@"http://example.com/sandbox/validate"];
Lestrade *lestrade   = [[Lestrade alloc] initWithValidationURL:validationURL];
lestrade.username    = @"sherlock";
lestrade.password    = @"secret";
[lestrade validateReceipt:transaction.transactionReceipt validationBlock:^(BOOL isValid, NSError *error) {
  if (error) { NSLog(@"error: %@", [error localizedDescription]); }
  NSLog(@"is receipt valid?(%d)", isValid);
}];

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT

About

Simple iOS method to validate a StoreKit receipt using Lestrade.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published