Skip to content

Commit

Permalink
Add iOS/Obj-C wrapper method for RefreshPublishers
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson authored Jun 25, 2019
1 parent 13df075 commit b7a8137
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vendor/brave-ios/Ledger/BATBraveLedger.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ NS_SWIFT_NAME(BraveLedger)
- (void)publisherBannerForId:(NSString *)publisherId
completion:(void (^)(BATPublisherBanner * _Nullable banner))completion;

/// Refresh a publishers verification status
- (void)refreshPublisherWithId:(NSString *)publisherId
completion:(void (^)(BOOL verified))completion;

#pragma mark - Tips

- (void)listRecurringTips:(void (^)(NSArray<BATPublisherInfo *> *))completion;
Expand Down
7 changes: 7 additions & 0 deletions vendor/brave-ios/Ledger/BATBraveLedger.mm
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@ - (nullable BATPublisherInfo *)currentActivityInfoWithPublisherId:(NSString *)pu
return [[BATLedgerDatabase publishersWithActivityFromOffset:0 limit:1 filter:filter] firstObject];
}

- (void)refreshPublisherWithId:(NSString *)publisherId completion:(void (^)(BOOL verified))completion
{
ledger->RefreshPublisher(std::string(publisherId.UTF8String), ^(bool verified) {
completion(verified);
});
}

#pragma mark - Tips

- (void)listRecurringTips:(void (^)(NSArray<BATPublisherInfo *> *))completion
Expand Down

0 comments on commit b7a8137

Please sign in to comment.