//
//  NSBundle+HotPocketExtensions.m
//  HotPocket
//
//  Created by Tomek Wójcik on 17/11/2025.
//

#import "NSBundle+HotPocketExtensions.h"

@implementation NSBundle (HotPocketExtensions)

+(NSString *)uname {
    NSBundle *mainBundle = [NSBundle mainBundle];
    return [NSString  stringWithFormat:@"HotPocket v%@ (%@)", [mainBundle.infoDictionary valueForKey:@"CFBundleShortVersionString"], [mainBundle.infoDictionary valueForKey:@"CFBundleVersion"]];
}

+(NSDictionary *)postAuthenticateURLParams {
    NSDictionary *result = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"HPAuthFlowPostAuthenticateURLParts"];
    if (result == nil) {
        return [NSDictionary dictionary];
    }
    
    return result;
}

+(NSString *)postAuthenticateURLScheme {
    NSDictionary *params = [self postAuthenticateURLParams];
    return [params valueForKey:@"scheme"];
}

+(NSString *)postAuthenticateURLHost {
    NSDictionary *params = [self postAuthenticateURLParams];
    return [params valueForKey:@"host"];
}

@end
