Created
September 9, 2021 15:36
-
-
Save nside/1cdbcc92554a944ca9049e0ce7d333ea to your computer and use it in GitHub Desktop.
SDL2 RevenueCat integration
This file contains 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
// You can use this in your main.mm | |
#import "../SDL/include/SDL_uikitappdelegate.h" | |
#import <Purchases/Purchases.h> | |
@interface MyDelegate : SDLUIKitDelegate | |
@end | |
@implementation MyDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
BOOL ret = [super application:application didFinishLaunchingWithOptions:launchOptions]; | |
// RevenueCat | |
RCPurchases.logLevel = RCLogLevelDebug; | |
[RCPurchases configureWithAPIKey:@"xxx"]; | |
return ret; | |
} | |
@end | |
// Add a 'category' to the SDL app delegate class | |
@interface SDLUIKitDelegate (extra) | |
{ | |
} | |
@end | |
@implementation SDLUIKitDelegate (extra) | |
+ (NSString *)getAppDelegateClassName { | |
return @"MyDelegate"; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment