Calling fetchItems twice doesn't work in a single app session
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Documentação
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- ios, typescript
- Domínio
- documentation, mobile-dev
Direção de pesquisa
Start with the plugin documentation and the connect(), fetchItems(), and tearDown() entry points shown in the issue. Verify how the documented usage handles repeated page visits, then update the guidance to explain the required cleanup before leaving the subscriptions or IAP page. Done means the lifecycle requirement and workaround are clear to users.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Nativescript versions
@nativescript/payments 1.0.4
@nativescript/core: ~8.1.1
@nativescript/ios: 8.2.2
iOS Version: 15.1.1
Device: iPhone 13 Pro max
Summary of issue: First time calling .connect() and fetchItems is fine. Subscriptions and IAPs (app store products) etc. load. Second time we call it in our app, it does not load at all. However, restarting the app seems to load the app store products again.
We used the code structure provided in this plugin documentation.
Related issues: https://stackoverflow.com/questions/25426564/completion-handler-causing-exc-bad-access-when-same-method-is-called-twice
Workaround/fix for now:
Call teardown() before you leave the subscriptions/IAP page, etc.
eg.
import {
buyItem,
BuyItemOptions,
canMakePayments,
fetchItems,
finalizeOrder,
init as initPayments,
Item,
PaymentEvent,
paymentEvents,
toMainThread,
tearDown as cleanUp
} from '@nativescript/payments';
onClose() {
// Clean up what we've done here as otherwise subscriptions won't load on 2nd reload
cleanUp();
this.location.back();
}
Suggested course of action: Update the docs for this plugin to make it clear that tearDown should be called before leaving the page with the subscription / IAP options, etc.
Screenshots:
When everything is fine (1st call / call with the fix above):
When trying to call the .connect() and fetchItems a second time in an app session (without the fix above):
- Linguagem predominante
- TypeScript
- Estrelas
- 35
- Forks
- 13
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NativeScript/payments
-
com.android.billingclient:billing@@8.0.0 - com.google.android.gms.internal.play_billing.zzbg.zzeAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 28/100
NativeScript/payments#45 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
NativeScript/payments#43 · 2 reações ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
NativeScript/payments#39 ·
-
support Amazon Android appsAberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
NativeScript/payments#36 · 2 comentários ·
-
[Restore Orders] MistakeAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
NativeScript/payments#35 ·
Todas as issues de NativeScript/payments
Issues semelhantes
-
Phone app shows Unknown for a remote machine whose key changedTalvez já em andamento @janicduplessis assumiu hoje. Abertaarea: mobile priority: P3 type: bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
appandflow/stim#5006 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Area - Local to Cloud Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
microsoft/vscode-mssql#23209 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
code-yeongyu/senpi#5713 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
A-linter
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
oxc-project/oxc#28783 ·
Mantenedores costumam responder em até 1 dia
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
lingdojo/kana-dojo#33553 · 1 comentário · 5 reações ·
Mantenedores costumam responder em até 1 dia