Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Implement out of band updates for Brave Ads #2707

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions BraveRewards/BraveRewards.dSYM/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.BraveRewards</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Binary file modified BraveRewards/BraveRewards.framework/BraveRewards
Binary file not shown.
10 changes: 8 additions & 2 deletions BraveRewards/BraveRewards.framework/Headers/BATBraveAds.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ NS_SWIFT_NAME(BraveAds)
/// The max number of ads the user can see in a day
@property (nonatomic, assign) NSInteger numberOfAllowableAdsPerDay NS_SWIFT_NAME(adsPerDay);

/// The user model locales Brave Ads supports currently
@property (nonatomic, readonly) NSArray<NSString *> *userModelLanguages;
/// Whether or not the user has opted out of subdivision ad targeting
@property (nonatomic, assign, getter=shouldAllowSubdivisionTargeting) BOOL allowSubdivisionTargeting;

/// Selected ads subdivision targeting option
@property (nonatomic, copy) NSString * subdivisionTargetingCode;

/// Automatically detected ads subdivision targeting code
@property (nonatomic, copy) NSString * automaticallyDetectedSubdivisionTargetingCode;

/// Remove all cached history (should be called when the user clears their browser history)
- (void)removeAllHistory:(void (^)(BOOL))completion;
Expand Down
26 changes: 13 additions & 13 deletions BraveRewards/BraveRewards.framework/Headers/BATBraveLedger.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ NS_SWIFT_NAME(BraveLedger)
/// Marks if this is being ran in a test environment. Defaults to false
@property (nonatomic, class, getter=isTesting) BOOL testing;
/// Number of minutes between reconciles override. Defaults to 0 (no override)
@property (nonatomic, class) int reconcileTime;
@property (nonatomic, class) int reconcileInterval;
/// Whether or not to use short contribution retries. Defaults to false
@property (nonatomic, class) BOOL useShortRetries;

Expand All @@ -88,11 +88,11 @@ NS_SWIFT_NAME(BraveLedger)
/// Creates a cryptocurrency wallet
- (void)createWallet:(nullable void (^)(NSError * _Nullable error))completion;

/// Fetch details about the users wallet (if they have one) and assigns it to `walletInfo`
- (void)fetchWalletDetails:(nullable void (^)(BATWalletProperties * _Nullable))completion;
/// Get parameters served from the server
- (void)getRewardsParameters:(nullable void (^)(BATRewardsParameters * _Nullable))completion;

/// The users wallet info if one has been created
@property (nonatomic, readonly, nullable) BATWalletProperties *walletInfo;
/// The parameters send from the server
@property (nonatomic, readonly, nullable) BATRewardsParameters *rewardsParameters;

/// Fetch details about the users wallet (if they have one) and assigns it to `balance`
- (void)fetchBalance:(nullable void (^)(BATBalance * _Nullable))completion;
Expand All @@ -107,8 +107,6 @@ NS_SWIFT_NAME(BraveLedger)
- (void)recoverWalletUsingPassphrase:(NSString *)passphrase
completion:(nullable void (^)(NSError * _Nullable))completion;

@property (nonatomic, readonly) double defaultContributionAmount;

/// Retrieves the users most up to date balance to determin whether or not the
/// wallet has a sufficient balance to complete a reconcile
- (void)hasSufficientBalanceToReconcile:(void (^)(BOOL sufficient))completion;
Expand Down Expand Up @@ -234,13 +232,11 @@ NS_SWIFT_NAME(BraveLedger)

#pragma mark - History

@property (nonatomic, readonly) NSDictionary<NSString *, BATBalanceReportInfo *> *balanceReports;

- (void)balanceReportForMonth:(BATActivityMonth)month
year:(int)year
completion:(void (NS_NOESCAPE ^)(BATBalanceReportInfo * _Nullable info))completion;
completion:(void (^)(BATBalanceReportInfo * _Nullable info))completion;

@property (nonatomic, readonly) BATAutoContributeProps *autoContributeProps;
@property (nonatomic, readonly) BATAutoContributeProperties *autoContributeProperties;

#pragma mark - Misc

Expand All @@ -253,6 +249,10 @@ NS_SWIFT_NAME(BraveLedger)

- (void)rewardsInternalInfo:(void (NS_NOESCAPE ^)(BATRewardsInternalsInfo * _Nullable info))completion;

- (void)allContributions:(void (^)(NSArray<BATContributionInfo *> *contributions))completion;

@property (nonatomic, readonly, copy) NSString *rewardsDatabasePath;

#pragma mark - Reporting

@property (nonatomic) UInt32 selectedTabId;
Expand All @@ -279,9 +279,9 @@ NS_SWIFT_NAME(BraveLedger)
/// Whether or not brave rewards is enabled
@property (nonatomic, assign, getter=isEnabled) BOOL enabled;
/// The number of seconds before a publisher is added.
@property (nonatomic, assign) UInt64 minimumVisitDuration;
@property (nonatomic, assign) int minimumVisitDuration;
/// The minimum number of visits before a publisher is added
@property (nonatomic, assign) UInt32 minimumNumberOfVisits;
@property (nonatomic, assign) int minimumNumberOfVisits;
/// Whether or not to allow auto contributions to unverified publishers
@property (nonatomic, assign) BOOL allowUnverifiedPublishers;
/// Whether or not to allow auto contributions to videos
Expand Down
5 changes: 5 additions & 0 deletions BraveRewards/BraveRewards.framework/Headers/BATBraveRewards.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ NS_SWIFT_NAME(BraveRewardsDelegate)
@protocol BATBraveRewardsDelegate <NSObject>
@required

- (void)logMessageWithFilename:(NSString *)file
lineNumber:(int)lineNumber
verbosity:(int)verbosity
message:(NSString *)message;

/// Obtain the favicon URL given some page's URL. The client can then choose
/// to download said favicon and cache it for later when `retrieveFavicon` is
/// called.
Expand Down
1 change: 0 additions & 1 deletion BraveRewards/BraveRewards.framework/Headers/BraveRewards.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ FOUNDATION_EXPORT double BraveRewardsVersionNumber;
FOUNDATION_EXPORT const unsigned char BraveRewardsVersionString[];

#import <BraveRewards/BATBraveRewards.h>
#import <BraveRewards/RewardsLogger.h>

// Ads
#import <BraveRewards/BATAdNotification.h>
Expand Down
9 changes: 0 additions & 9 deletions BraveRewards/BraveRewards.framework/Headers/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, BATLogLevel) {
BATLogLevelLogError = 1,
BATLogLevelLogWarning = 2,
BATLogLevelLogInfo = 3,
BATLogLevelLogDebug = 4,
BATLogLevelLogRequest = 5,
BATLogLevelLogResponse = 6
} NS_SWIFT_NAME(LogLevel);

typedef NSString *BATWalletType NS_SWIFT_NAME(WalletType) NS_STRING_ENUM;

static BATWalletType const BATWalletTypeUphold = @"uphold";
Expand Down
21 changes: 0 additions & 21 deletions BraveRewards/BraveRewards.framework/Headers/RewardsLogger.h

This file was deleted.

74 changes: 42 additions & 32 deletions BraveRewards/BraveRewards.framework/Headers/ledger.mojom.objc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@


typedef NS_ENUM(NSInteger, BATContributionStep) {
BATContributionStepStepRetryCount = -7,
BATContributionStepStepAcOff = -6,
BATContributionStepStepRewardsOff = -5,
BATContributionStepStepAcTableEmpty = -4,
BATContributionStepStepNotEnoughFunds = -3,
BATContributionStepStepFailed = -2,
Expand Down Expand Up @@ -91,6 +94,8 @@ typedef NS_ENUM(NSInteger, BATResult) {
BATResultRetryLong = 31,
BATResultContinue = 32,
BATResultInProgress = 33,
BATResultRewardsOff = 34,
BATResultAcOff = 35,
} NS_SWIFT_NAME(Result);


Expand All @@ -113,7 +118,6 @@ typedef NS_ENUM(NSInteger, BATRewardsType) {
typedef NS_ENUM(NSInteger, BATReportType) {
BATReportTypeGrantUgp = 0,
BATReportTypeAutoContribution = 1,
BATReportTypeDeposit = 2,
BATReportTypeGrantAd = 3,
BATReportTypeTipRecurring = 4,
BATReportTypeTip = 5,
Expand Down Expand Up @@ -247,8 +251,16 @@ typedef NS_ENUM(NSInteger, BATSKUTransactionStatus) {
} NS_SWIFT_NAME(SKUTransactionStatus);


typedef NS_ENUM(NSInteger, BATInlineTipsPlatforms) {
BATInlineTipsPlatformsNone = 0,
BATInlineTipsPlatformsReddit = 1,
BATInlineTipsPlatformsTwitter = 2,
BATInlineTipsPlatformsGithub = 3,
} NS_SWIFT_NAME(InlineTipsPlatforms);

@class BATContributionInfo, BATContributionPublisher, BATPublisherInfo, BATPublisherBanner, BATPendingContribution, BATPendingContributionInfo, BATVisitData, BATWalletProperties, BATBalance, BATAutoContributeProps, BATMediaEventInfo, BATExternalWallet, BATBalanceReportInfo, BATActivityInfoFilterOrderPair, BATActivityInfoFilter, BATReconcileInfo, BATRewardsInternalsInfo, BATServerPublisherInfo, BATServerPublisherPartial, BATTransferFee, BATContributionQueue, BATContributionQueuePublisher, BATPromotion, BATUnblindedToken, BATClientInfo, BATRecurringTip, BATTransactionReportInfo, BATContributionReportInfo, BATMonthlyReportInfo, BATCredsBatch, BATSKUOrder, BATSKUOrderItem, BATSKUTransaction;


@class BATContributionInfo, BATContributionPublisher, BATPublisherInfo, BATPublisherBanner, BATPendingContribution, BATPendingContributionInfo, BATVisitData, BATRewardsParameters, BATBalance, BATAutoContributeProperties, BATMediaEventInfo, BATExternalWallet, BATBalanceReportInfo, BATActivityInfoFilterOrderPair, BATActivityInfoFilter, BATRewardsInternalsInfo, BATServerPublisherInfo, BATTransferFee, BATContributionQueue, BATContributionQueuePublisher, BATPromotion, BATUnblindedToken, BATClientInfo, BATRecurringTip, BATTransactionReportInfo, BATContributionReportInfo, BATMonthlyReportInfo, BATCredsBatch, BATSKUOrder, BATSKUOrderItem, BATSKUTransaction, BATUrlResponse;

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -284,6 +296,7 @@ NS_SWIFT_NAME(PublisherInfo)
@property (nonatomic) int32_t category;
@property (nonatomic) uint64_t reconcileStamp;
@property (nonatomic) BATPublisherStatus status;
@property (nonatomic) uint64_t statusUpdatedAt;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * url;
@property (nonatomic, copy) NSString * provider;
Expand Down Expand Up @@ -319,6 +332,7 @@ NS_SWIFT_NAME(PendingContributionInfo)
@property (nonatomic, copy) NSString * publisherKey;
@property (nonatomic) BATRewardsType type;
@property (nonatomic) BATPublisherStatus status;
@property (nonatomic) uint64_t statusUpdatedAt;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * url;
@property (nonatomic, copy) NSString * provider;
Expand All @@ -341,24 +355,24 @@ NS_SWIFT_NAME(VisitData)
@property (nonatomic, copy) NSString * faviconUrl;
@end

NS_SWIFT_NAME(WalletProperties)
@interface BATWalletProperties : NSObject <NSCopying>
@property (nonatomic) double feeAmount;
@property (nonatomic, copy) NSArray<NSNumber *> * parametersChoices;
@property (nonatomic, copy) NSArray<NSNumber *> * defaultTipChoices;
@property (nonatomic, copy) NSArray<NSNumber *> * defaultMonthlyTipChoices;
NS_SWIFT_NAME(RewardsParameters)
@interface BATRewardsParameters : NSObject <NSCopying>
@property (nonatomic) double rate;
@property (nonatomic) double autoContributeChoice;
@property (nonatomic, copy) NSArray<NSNumber *> * autoContributeChoices;
@property (nonatomic, copy) NSArray<NSNumber *> * tipChoices;
@property (nonatomic, copy) NSArray<NSNumber *> * monthlyTipChoices;
@end

NS_SWIFT_NAME(Balance)
@interface BATBalance : NSObject <NSCopying>
@property (nonatomic) double total;
@property (nonatomic, copy) NSString * userFunds;
@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> * rates;
@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> * wallets;
@end

NS_SWIFT_NAME(AutoContributeProps)
@interface BATAutoContributeProps : NSObject <NSCopying>
NS_SWIFT_NAME(AutoContributeProperties)
@interface BATAutoContributeProperties : NSObject <NSCopying>
@property (nonatomic) bool enabledContribute;
@property (nonatomic) uint64_t contributionMinTime;
@property (nonatomic) int32_t contributionMinVisits;
Expand Down Expand Up @@ -386,11 +400,13 @@ NS_SWIFT_NAME(ExternalWallet)
@property (nonatomic, copy) NSString * oneTimeString;
@property (nonatomic, copy) NSString * userName;
@property (nonatomic, copy) NSString * accountUrl;
@property (nonatomic, copy) NSString * loginUrl;
@property (nonatomic) bool transferred;
@end

NS_SWIFT_NAME(BalanceReportInfo)
@interface BATBalanceReportInfo : NSObject <NSCopying>
@property (nonatomic, copy) NSString * id;
@property (nonatomic) double grants;
@property (nonatomic) double earningFromAds;
@property (nonatomic) double autoContribute;
Expand All @@ -416,41 +432,22 @@ NS_SWIFT_NAME(ActivityInfoFilter)
@property (nonatomic) uint32_t minVisits;
@end

NS_SWIFT_NAME(ReconcileInfo)
@interface BATReconcileInfo : NSObject <NSCopying>
@property (nonatomic, copy) NSString * viewingId;
@property (nonatomic, copy) NSString * amount;
@property (nonatomic) BATContributionRetry retryStep;
@property (nonatomic) int32_t retryLevel;
@end

NS_SWIFT_NAME(RewardsInternalsInfo)
@interface BATRewardsInternalsInfo : NSObject <NSCopying>
@property (nonatomic, copy) NSString * paymentId;
@property (nonatomic) bool isKeyInfoSeedValid;
@property (nonatomic, copy) NSString * personaId;
@property (nonatomic, copy) NSString * userId;
@property (nonatomic) uint64_t bootStamp;
@property (nonatomic, copy) NSDictionary<NSString *, BATReconcileInfo *> * currentReconciles;
@end

NS_SWIFT_NAME(ServerPublisherInfo)
@interface BATServerPublisherInfo : NSObject <NSCopying>
@property (nonatomic, copy) NSString * publisherKey;
@property (nonatomic) BATPublisherStatus status;
@property (nonatomic) bool excluded;
@property (nonatomic, copy) NSString * address;
@property (nonatomic) uint64_t updatedAt;
@property (nonatomic, copy, nullable) BATPublisherBanner * banner;
@end

NS_SWIFT_NAME(ServerPublisherPartial)
@interface BATServerPublisherPartial : NSObject <NSCopying>
@property (nonatomic, copy) NSString * publisherKey;
@property (nonatomic) BATPublisherStatus status;
@property (nonatomic) bool excluded;
@property (nonatomic, copy) NSString * address;
@end

NS_SWIFT_NAME(TransferFee)
@interface BATTransferFee : NSObject <NSCopying>
@property (nonatomic, copy) NSString * id;
Expand All @@ -461,10 +458,12 @@ NS_SWIFT_NAME(TransferFee)

NS_SWIFT_NAME(ContributionQueue)
@interface BATContributionQueue : NSObject <NSCopying>
@property (nonatomic) uint64_t id;
@property (nonatomic, copy) NSString * id;
@property (nonatomic) BATRewardsType type;
@property (nonatomic) double amount;
@property (nonatomic) bool partial;
@property (nonatomic) uint64_t createdAt;
@property (nonatomic) uint64_t completedAt;
@property (nonatomic, copy) NSArray<BATContributionQueuePublisher *> * publishers;
@end

Expand Down Expand Up @@ -497,6 +496,9 @@ NS_SWIFT_NAME(UnblindedToken)
@property (nonatomic) double value;
@property (nonatomic, copy) NSString * credsId;
@property (nonatomic) uint64_t expiresAt;
@property (nonatomic) uint64_t redeemedAt;
@property (nonatomic, copy) NSString * redeemId;
@property (nonatomic) BATRewardsType redeemType;
@end

NS_SWIFT_NAME(ClientInfo)
Expand Down Expand Up @@ -589,4 +591,12 @@ NS_SWIFT_NAME(SKUTransaction)
@property (nonatomic) uint64_t createdAt;
@end

NS_SWIFT_NAME(UrlResponse)
@interface BATUrlResponse : NSObject <NSCopying>
@property (nonatomic, copy) NSString * url;
@property (nonatomic) int32_t statusCode;
@property (nonatomic, copy) NSString * body;
@property (nonatomic, copy) NSDictionary<NSString *, NSString *> * headers;
@end

NS_ASSUME_NONNULL_END
Binary file modified BraveRewards/BraveRewards.framework/Info.plist
Binary file not shown.
Loading