Created
May 7, 2013 17:12
-
-
Save rbaulin/5534334 to your computer and use it in GitHub Desktop.
Tapjoy possible Publisher SDK API improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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