JubeatPlus 3.9.11
Loading...
Searching...
No Matches
CubePurchaseView Class Reference

A modal view that sells cubes: a scrollable product list backed by StoreKit, an age / spend-limit gate, and SPTL and cube-policy overlays. More...

#include <CubePurchaseView.h>

Inheritance diagram for CubePurchaseView:
Collaboration diagram for CubePurchaseView:

Instance Methods

(instancetype) - initWithFrame:
 Builds the whole view: the background plate, the close, SPTL, and cube-policy buttons, and the (initially transparent) product list, then kicks off a signed fetch of the cube product list.
(void) - closePurchaseMenu:
 Close-button action: plays the cancel sound, cancels any live products request, and tells the delegate the purchase menu closed.
(void) - tapSptl:
 SPTL-button action: opens the specified-commercial-transactions (TOKUSHO) page in Safari.
(void) - tapCubePolicy:
 Cube-policy-button action: opens the in-game-currency policy in a MessageTextView overlay and disables interaction on the root view behind it.
(void) - closeMessage:
 Removes the policy / message overlay and re-enables interaction on the root view.
(BOOL) - checkAttainLimitPurchase:
 Enforces the monthly-spend limit for the buyer's age band before a purchase.
(void) - purchaseStart:
 Begins the StoreKit purchase of a product and shows the "processing" dialog.
(void) - selectListCell:
 Product-list delegate callback: records the chosen row and, if the spend limit allows, begins its purchase.
(void) - downloaderFinished:
 Handles a completed signed download.
(void) - downloaderError:
 Handles a failed signed download: the tag-1 age request shows the server-error alert, the tag-0 list request shows its failure text in the error label.
(void) - alertSelect:
 Alert delegate callback: closes the view on a completed purchase (tag 1), registers the chosen age band (tag 2), or closes the challenge-mode session-error overlay (tag 9999).
(void) - purchaseSucceeded:
 Purchase-manager callback for a successful purchase: ends interaction ignoring, shows the completion alert, and asks the delegate to refresh its status.
(void) - purchaseFailed:error:
 Purchase-manager callback for a failed purchase: ends interaction ignoring and shows the server-error alert.
(void) - productsRequest:didReceiveResponse:
 SKProductsRequestDelegate callback: matches the returned products to the pending list, populates the product list view, and fades it in.
(void) - requestDidFinish:
 SKRequestDelegate callback: drops the finished products request.
(void) - request:didFailWithError:
 SKRequestDelegate callback: drops the failed products request and shows the no-items text.
Instance Methods inherited from <AlertViewManagerDelegate>
(void) - alertClose:
 Sent when a UIAlertController -based alert finishes dismissing.
Instance Methods inherited from <DownloaderDelegate>
(void) - downloaderProceed:
 Sent periodically as data arrives, and once more on completion.
(void) - downloaderFinished:
 Sent when the request completes.
(void) - downloaderError:
 Sent when the request fails.
Instance Methods inherited from <PurchaseManagerDelegate>
(void) - purchaseFailed:error:
 A purchase failed.
(void) - purchaseSucceeded:
 A purchase was verified.
(void) - restoreSucceeded
 At least one restored product was verified.
(void) - restoreNothing
 A restore finished with nothing to restore.
Instance Methods inherited from <MessageTextViewDelegate>
(void) - messageDownloadError:msgStr:
 Sent when the message could not be downloaded.

Properties

id< CubePurchaseViewDelegate > aDelegate
 The delegate told when the purchase menu closes and when the purchase dialog should be shown, hidden, or its status refreshed.

Detailed Description

A modal view that sells cubes: a scrollable product list backed by StoreKit, an age / spend-limit gate, and SPTL and cube-policy overlays.

Method Documentation

◆ alertSelect:

- (void) alertSelect: (nonnull NSDictionary *) info

Alert delegate callback: closes the view on a completed purchase (tag 1), registers the chosen age band (tag 2), or closes the challenge-mode session-error overlay (tag 9999).

Parameters
infoThe alert result carrying Tag and btnMessage .
Ghidra address:
0x1c1f78

Reimplemented from <AlertViewManagerDelegate>.

◆ checkAttainLimitPurchase:

- (BOOL) checkAttainLimitPurchase: (nullable SKProduct *) product

Enforces the monthly-spend limit for the buyer's age band before a purchase.

Adds the product's price (only when it is priced in JPY ) to the running total, compares it to the limit for the stored PrefPurchaseLimitType , and, when the limit would be exceeded, shows either the age-confirmation alert (when no age has been set) or the limit-exceeded alert.

Parameters
productThe product about to be bought.
Returns
YES when the purchase must be blocked, NO when it may proceed.
Ghidra address:
0x1c10bc

◆ closeMessage:

- (void) closeMessage: (nullable id) sender

Removes the policy / message overlay and re-enables interaction on the root view.

Parameters
senderThe overlay reporting that it closed.
Ghidra address:
0x1c1064

Reimplemented from <MessageTextViewDelegate>.

◆ closePurchaseMenu:

- (void) closePurchaseMenu: (nullable id) sender

Close-button action: plays the cancel sound, cancels any live products request, and tells the delegate the purchase menu closed.

Parameters
senderThe close button.
Ghidra address:
0x1c0d18

◆ downloaderError:

- (void) downloaderError: (nullable id) downloader

Handles a failed signed download: the tag-1 age request shows the server-error alert, the tag-0 list request shows its failure text in the error label.

Parameters
downloaderThe failed request.
Ghidra address:
0x1c1dd0

◆ downloaderFinished:

- (void) downloaderFinished: (nullable id) downloader

Handles a completed signed download.

The tag-0 response is the cube product list: it updates the running total, builds a CubePurchaseInfo per item into cubeList , and fires an SKProductsRequest for the product identifiers. The tag-1 response is the age-registration result: on success it stores the spend-limit type. A stale-client status shows the server-error alert.

Parameters
downloaderThe finished request.
Ghidra address:
0x1c1654

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect) frame

Builds the whole view: the background plate, the close, SPTL, and cube-policy buttons, and the (initially transparent) product list, then kicks off a signed fetch of the cube product list.

Parameters
frameThe view's frame.
Returns
The initialised view.
Ghidra address:
0x1c04c4

◆ productsRequest:didReceiveResponse:

- (void) productsRequest: (nullable SKProductsRequest *) request
didReceiveResponse: (nullable SKProductsResponse *) response 

SKProductsRequestDelegate callback: matches the returned products to the pending list, populates the product list view, and fades it in.

An empty response shows the no-items text.

Parameters
requestThe products request.
responseThe StoreKit response.
Ghidra address:
0x1c2684

◆ purchaseFailed:error:

- (void) purchaseFailed: (nullable NSString *) productID
error: (nullable NSError *) error 

Purchase-manager callback for a failed purchase: ends interaction ignoring and shows the server-error alert.

Parameters
productIDThe product identifier that failed.
errorThe StoreKit error.
Ghidra address:
0x1c24d8

◆ purchaseStart:

- (void) purchaseStart: (nullable SKProduct *) product

Begins the StoreKit purchase of a product and shows the "processing" dialog.

Parameters
productThe product to buy.
Ghidra address:
0x1c1438

◆ purchaseSucceeded:

- (void) purchaseSucceeded: (nullable NSString *) productID

Purchase-manager callback for a successful purchase: ends interaction ignoring, shows the completion alert, and asks the delegate to refresh its status.

Parameters
productIDThe purchased product identifier.
Ghidra address:
0x1c2324

◆ request:didFailWithError:

- (void) request: (nullable SKRequest *) request
didFailWithError: (nullable NSError *) error 

SKRequestDelegate callback: drops the failed products request and shows the no-items text.

Parameters
requestThe request that failed.
errorThe StoreKit error.
Ghidra address:
0x1c2b58

◆ requestDidFinish:

- (void) requestDidFinish: (nullable SKRequest *) request

SKRequestDelegate callback: drops the finished products request.

Parameters
requestThe request that finished.
Ghidra address:
0x1c2b40

◆ selectListCell:

- (void) selectListCell: (nullable NSIndexPath *) indexPath

Product-list delegate callback: records the chosen row and, if the spend limit allows, begins its purchase.

Parameters
indexPathThe selected row.
Ghidra address:
0x1c1550

Reimplemented from <CubePurchaseListViewDelegate>.

◆ tapCubePolicy:

- (void) tapCubePolicy: (nullable id) sender

Cube-policy-button action: opens the in-game-currency policy in a MessageTextView overlay and disables interaction on the root view behind it.

Parameters
senderThe cube-policy button.
Ghidra address:
0x1c0e48

◆ tapSptl:

- (void) tapSptl: (nullable id) sender

SPTL-button action: opens the specified-commercial-transactions (TOKUSHO) page in Safari.

Parameters
senderThe SPTL button.
Ghidra address:
0x1c0dc8

Property Documentation

◆ aDelegate

- (id<CubePurchaseViewDelegate>) aDelegate
readwritenonatomicweak

The delegate told when the purchase menu closes and when the purchase dialog should be shown, hidden, or its status refreshed.

Held weakly.

Ghidra address:
0x1c2ba4 (getter), 0x1c2bc4 (setter)

The documentation for this class was generated from the following files: