Почему на Ipad не появляется кнопка "sign in with apple"?
У меня есть мобильное приложение Его стек
Apache Cordova 12
Vue.js
Laravel
На моих стендах (Личный телефон и виртуализация хоста от xcode все работает)
В ответе от техподдержки я вижу скрин на котором данной функции входа - нет

Начал проводить расследование и дошел до того, что кнопка не появляется на Ipad
Мой код для авторизации
import MessengerButton from "@/components/Utils/MessengerButton.vue";
import Button from "@/components/Utils/Button.vue";
import Input from "@/components/Utils/Input.vue";
import PrivacyPolicy from "@/components/Login/PrivacyPolicy.vue";
import { mapActions, mapMutations, mapState } from "vuex";
import LoginFooter from "@/components/Login/LoginFooter.vue";
import MobileDetect from "mobile-detect";
import { sendAppleAuthInfo } from "@/api";
import("mobile-detect")
export default {
name: "AuthRegForm",
components: {
LoginFooter,
PrivacyPolicy,
Input,
Button,
MessengerButton
},
props: {
type: String,
},
computed: {
...mapState('auth', ['authError']),
getRoute() {
return this.$route.path
},
// getSessionId() {
// return this.$route.fullPath.split('?session_id=')[1]
// },
},
data() {
return {
telephone: '',
name: { value: '' },
mdClass: '',
error : '',
session: { id: '' },
}
},
methods: {
...mapActions('auth', ['authWithToken']),
...mapMutations('auth', ['SET_DATA_AUTH', 'SET_DATA_REGISTRATION']),
setTelephone(tel) {
this.telephone = tel
this.error = ''
},
setName(name) {
this.name.value = name
this.error = ''
},
sendCode() {
let phone = +this.telephone.replace(/\D/g, "")
console.log('phone', phone)
if (String(phone).length === 11 && this.name.value || this.$route.path === '/auth') {
let device_name = this.mdClass.mobile() + this.mdClass.userAgent();
console.log("DeviceName = " + device_name)
if (typeof device_name !== "string") {
device_name = "browser"
}
const data = {
phone,
name: this.name.value,
device_name
}
const appleSessionId = this.$route.fullPath.split('?apple_session_id=')[1]
console.log('appleSessionId', appleSessionId)
if (this.$route.path === '/auth' && !appleSessionId) {
console.log('this', this.session)
this.$store.dispatch('auth/authSendCode', data)
} else if (this.$route.path === '/reg' || appleSessionId) {
this.$store.dispatch('auth/registrationSendCode', this.session.id ? {
...data,
session_id: this.session.id
} : data)
}
} else {
this.error = 'Не все поля заполнены'
}
},
setTokens(url) {
const authWithToken = (data) => this.authWithToken(data)
const thisSession = this.session
const token = url.split('?token=')?.[1]?.replace('%7C', '|')
const sessionId = url.split('?session_id=')[1]
const appleSessionId = url.split('?apple_session_id=')[1]
if (token) {
authWithToken({ token, goToProfile: true })
}
if (sessionId && this.$route === '/auth') {
this.$router.push(`/reg?session_id=${sessionId}`)
}
if (appleSessionId && this.$route === '/reg') {
this.$router.push(`/auth?apple_session_id=${appleSessionId}`)
}
if (sessionId || appleSessionId) {
thisSession.id = sessionId ?? appleSessionId
}
},
auth() {
const setTokens = (url) => this.setTokens(url)
setTokens(this.$route.fullPath)
document.addEventListener('deviceready', function() {
window.handleOpenURL = function(url) {
// Обработка URL
setTokens(url)
// Разбор параметров и выполнение нужных действий
};
}, false);
const MobileDetect = require('mobile-detect')
this.mdClass = new MobileDetect(window.navigator.userAgent)
},
appleAuth() {
const authWithToken = (data) => this.authWithToken(data)
const thisSession = this.session
const thisName = this.name
const route = this.$route.fullPath
const router = this.$router
try {
cordova.plugins.SignInWithApple.signin(
{requestedScopes: [0, 1]},
function (success) {
sendAppleAuthInfo(success).then(r => {
const user = r.data.data
if (user.session) {
if (route === '/reg') {
router.push(`/auth?apple_session_id=${user.session}`)
}
thisSession.id = user.session
thisName.value = user.name
} else {
authWithToken({ token: user.token, goToProfile: true })
}
})
},
function (error) {
console.error(error);
alert('error - ' + JSON.stringify(error))
}
)
} catch (e) {
alert(e.toString())
}
}
},
watch: {
'this.$route.fullPath'() {
this.auth()
}
},
async mounted() {
this.auth()
this.SET_DATA_AUTH({})
this.SET_DATA_REGISTRATION({})
},
}
</script>
<template>
<div class="auth-reg-form">
<div class="auth-reg-form__inputs">
<Input
placeholder="Имя"
@input-value="setName"
v-if="getRoute === '/reg'"
/>
<Input
type="tel"
placeholder="Телефон"
:error="error || authError?.message"
:show-error="error || authError?.message"
@input-value="setTelephone"
input-mask="+7 (###) ###-##-##"
/>
<Input
type="password"
placeholder="Пароль"
v-if="type === 'password'"
/>
</div>
<div class="auth-reg-form__buttons" :class="type === 'sms' ? 'auth-reg-form__buttons_mt-24' : 'auth-reg-form__buttons_mt-16'">
<Button
type="submit"
name="Применить"
@click-btn="sendCode"
/>
<Button class="bg-transparent" name="Назад" @click="$router.push('/')"/>
</div>
<slot name="textWithLink"/>
<PrivacyPolicy/>
<LoginFooter @apple-auth="appleAuth"/>
</div>
</template>
<style scoped lang="scss">
@import '@/assets/scss/views/login/authRegForm';
</style>

