[@nativescript/payments] Not possible to use both subscriptions and IAPs in the same project
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
調査の方向性
Start by tracing fetchSubscriptions and fetchItems, focusing on how _fetchedItems, _fetchedSubscriptions, and _fetchedProducts are populated and whether consecutive calls overwrite shared state. Confirm the behavior with a project that loads both subscription and in-app-purchase products; done means both product types remain available without polling or manually merging arrays.
索引モデルが issue の本文から書いたものです。
説明
I have a situation where I offer two subscriptions and an additional "lifetime" subscription (which is really an in-app purchase, consumable). I may easily be mistaken, but the way the plugin implementation is designed, you can't really offer both subs and purchases because of an overwrite of _fetchedItems when calling both fetchSubscriptions and fetchItems consecutively?
My very hacky workaround is to:
fetchSubscriptionswhere I normally would- Call a separate method, like
loadAll()after that:
async loadAll() {
await this.waitForSubscriptions();
fetchItems(["com.nativescript.whatever.item]);
}
- This will
awaitsubscriptions being loaded andwaitForSubscriptionsreturns a promise when there is something in the array (yeah this isn't perfect):
waitForSubscriptions(): Promise<void> {
return new Promise<void>((resolve) => {
const check = setInterval(() => {
if (this._fetchedSubscriptions.length > 0) {
clearInterval(check);
resolve(); // now valid, since T is void
}
}, 500);
});
}
- After subscriptions are confirmed, then call
fetchItems(see step 2). - Finally merge the two arrays:
if (this._fetchedSubscriptions.length > 0 && this._fetchedProducts.length > 0) {
this._fetchedItems = [
...this._fetchedSubscriptions,
...this._fetchedProducts,
];
console.log('Fetched subscription items:', this._fetchedItems);
}
It's a little more complicated than this and I'd be happy to share my full code if anyone is curious.
- 主要言語
- TypeScript
- スター
- 35
- フォーク
- 13
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NativeScript/payments のほかの issue
-
com.android.billingclient:billing@@8.0.0 - com.google.android.gms.internal.play_billing.zzbg.zzeオープン
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
NativeScript/payments#45 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
NativeScript/payments#43 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NativeScript/payments#36 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
NativeScript/payments#35 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
NativeScript/payments#31 · コメント 2 件 ·
NativeScript/payments の issue をすべて見る
似ている issue
-
area: cli bug flake ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
gazetta-studio/gazetta-studio#1772 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
microsoft/playwright#43875 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
calagopus/panel#285 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信