Tengo este código, que se usa para crear la transacción y luego redirigir al usuario a la página con esta transacción:
const { detect } = require('detect-browser') const browser = detect() ... async beginTransaction (data) { this.submitError = false if (!this.validateData()) return this.$store.commit('SET_LOADER', 1) try { this.captchaCounter++ const clientOrigin = localStorage.getItem('cOrigin') const result = await startTransaction({ ...data }, this.offerId, localStorage.getItem('market')) localStorage.removeItem('cOrigin') const route = this.$router.resolve({path: '/chat', query: { id: result.transactionId, pushNotifications: null, beCareful: null }}) if (browser.name.toLowerCase() === 'safari' || this.$browserDetect.isSafari) { await this.$router.push(`/chat?id=${result.transactionId}&pushNotifications&beCareful`) } else { return window.open(route.href, '_blank') } } catch (e) { console.log(e) } } Este código funciona perfectamente bien con cualquier otro navegador o dispositivo, pero no en iPhone con Safari. Probé probablemente todo lo que pude encontrar, estaba tratando de usar la referencia de la ventana, como aquí . También estaba tratando de hacerlo usando .then(() => {}) como here e incluso this , pero nada funciona.
¿Cuál es el problema? ¿Podría ser un problema en el teléfono, no en el código? Porque tengo un código similar que funciona, pero está vinculado al hacer clic en el botón:
async redirectToChat (id) { if (browser.name.toLowerCase() === 'safari' || this.$browserDetect.isSafari) { await this.$router.push(`/chat?id=${id}`) } else { const route = this.$router.resolve({path: '/chat', query: { id }}) return window.open(route.href, '_blank') } },