Skip to content

Instantly share code, notes, and snippets.

@rbaulin
Created May 7, 2013 17:12
Show Gist options
  • Save rbaulin/5534334 to your computer and use it in GitHub Desktop.
Save rbaulin/5534334 to your computer and use it in GitHub Desktop.
Tapjoy possible Publisher SDK API improvements
Now API looks like this:
- (void)getTapPoints;
- (void)spendTapPoints;
Here is how it would be absolutely awesome:
- (void)getTapPointsCompletion:(void (^)(TapjoyConnect *tj, NSUInteger tapPoints, NSError *error))completionBlock;
- (void)spendTapPoints:100 completion:(void (^)(TapjoyConnect *tj, NSError *error))completionBlock;
So, I could use it like this:
.. code ..
// show loading HUD
[TapjoyConnect getTapPointsCompletion:^(NSUInteger tapPoints, NSError *error) {
if (error) {
// hide HUD, alert fail
}
if (tapPoints > 100) {
[TapjoyConnect spendTapPoints:100 completion:^(NSError *error) {
if (error) {
// hide HUD, alert fail
}
// hide HUD, alert success
}];
}
}];
.. code ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment