Expo Apple Authentication работает на эмуляторе и Expo Go, но терпит неудачу, когда приложение развернуто для тестированIOS

Программируем под IOS
Ответить Пред. темаСлед. тема
Anonymous
 Expo Apple Authentication работает на эмуляторе и Expo Go, но терпит неудачу, когда приложение развернуто для тестирован

Сообщение Anonymous »

Любая помощь будет высоко оценена. Моя команда застряла из-за этой странной проблемы для слабых сейчас! Эмулятор на моем Mac и на моем iPhone с использованием приложения Expogo
[*] Как только я развертываю приложение для тестирования процесса входа в систему. Протестировано с помощью учетной записи друзей

Проблемная попытка решения

[*] Проверьте правильный Bundleidentifier , установлен в App.json
подтвержденный, что Apple envitule находится в Apple, в Applememlement Proflemlement. Также подтверждено, что он является частью профиля «Плист и подготовку» внутри файла*.ipa < /code> для приложения < /li>
< /ol>
** Вопрос ** < /p>

Почему регистрация с Apple не работает в тестовом полете? Как я могу это исправить? Что я могу сделать, чтобы лучше его отладить?import * as AppleAuthentication from 'expo-apple-authentication';
import * as SecureStore from 'expo-secure-store';
import { createContext, useContext, useEffect, useState } from 'react';
import {router} from "expo-router";
import env from '@/src/config/envVarConfig';
import {remoteLog} from "@/src/features/common/lib/remoteLog";

const loginWithApple = async () => {
try {
remoteLog("Trying to login with Apple");
const credential = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
clientId: 'com.klizja.imanapp.signin',
});

remoteLog("Credential from Apple" + JSON.stringify(credential));

const idToken = credential.identityToken;
// console.log('idToken', idToken);

const beUrl = env.API_BASE_URL + 'auth/apple';
// console.log('beUrl', beUrl);
const res = await fetch(beUrl, {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({idToken}),
});

const beResponse = await res.json();
// console.log('response from BE', beResponse);
// console.log('response OK?', res.ok);
// console.log('response status', res.status);

if (!res.ok) {
throw new Error("Failed to authenticate");
}

const {accessToken, refreshToken} = beResponse;

// Store both tokens securely
await SecureStore.setItemAsync(ACCESS_TOKEN_KEY, accessToken);
await SecureStore.setItemAsync(REFRESH_TOKEN_KEY, refreshToken);

console.log('accessToken', accessToken);
setIsLoggedIn(true);
remoteLog("Successfully logged in with Apple");
router.replace("/");
}catch (e) {
console.log('Error during login with Apple', e);
remoteLog("Error during login with Apple" + JSON.stringify(e));
throw e;
}
};
< /code>
Здесь также мое приложение.json < /p>
{
"expo": {
"name": "iman-react-native",
"slug": "iman-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "imanreactnative2",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"splash": {
"image": "./assets/images/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.klizja.imanapp",
"usesAppleSignIn": true,
"infoPlist": {
"ITSAppUsesNonExemptEncryption": false,
"NSLocationWhenInUseUsageDescription": "We need your location to show prayer times and Qibla direction.",
"NSLocationAlwaysAndWhenInUseUsageDescription": "We need your location to show prayer times and Qibla direction."
}
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#014723"
},
"edgeToEdgeEnabled": true
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"updates": {
"enabled": true,
"fallbackToCacheTimeout": 0,
"url": "https://u.expo.dev/53c683db-ab1c-49a9-9ab4-c3da77aaacd9"
},
"plugins": [
"expo-router",
"expo-apple-authentication",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#014723"
}
],
"expo-localization",
"expo-secure-store"
],
"experiments": {
"typedRoutes": true
},
"extra": {
"router": {},
"eas": {
"projectId": "53c683db-ab1c-49a9-9ab4-c3da77aaacd9"
}
},
"owner": "imanapp",
"runtimeVersion": "1.0.0"
}
}

< /code>
Вот журналы ошибок, которые я получаю от своего iPhone с помощью консоли Xcode < /p>
default 16:53:23.394598+0200 akd Connection 227: TLS handshake complete
default 16:53:23.394659+0200 akd Connection 227: ready C(N) E(N)
default 16:53:23.394845+0200 akd Task . now using Connection 227
default 16:53:23.395157+0200 akd Connection 227: received viability advisory(Y)
default 16:53:23.395922+0200 akd Task . sent request, body S 7093
default 16:53:23.396064+0200 akd Garbage collection for alternative services
default 16:53:23.718388+0200 akd Task . received response, status 200 content K
default 16:53:23.720276+0200 akd Task . response ended
default 16:53:23.720766+0200 akd Task . done using Connection 227
default 16:53:23.721501+0200 akd [C227] event: client:connection_idle @0.860s
default 16:53:23.721920+0200 akd [C227] event: client:connection_idle @0.861s
default 16:53:23.722343+0200 akd -[AIASSession URLSession:dataTask:didReceiveData:]: got more data: 1596 bytes
default 16:53:23.722512+0200 akd Task . summary for task success {transaction_duration_ms=862, response_status=200, connection=227, protocol="http/1.1", domain_lookup_duration_ms=1, connect_duration_ms=528, secure_connection_duration_ms=361, private_relay=false, request_start_ms=537, request_duration_ms=0, response_start_ms=860, response_duration_ms=1, request_bytes=7890, request_throughput_kbps=12950, response_bytes=2864, response_throughput_kbps=2112, cache_hit=false}
default 16:53:23.722656+0200 akd Task . finished successfully
default 16:53:23.722961+0200 akd -[AIASSession URLSession:task:didCompleteWithError:]: : : (null)
default 16:53:23.723673+0200 akd SendRequestAndCreateResponse: completed request
default 16:53:23.723752+0200 akd Connection 227: cleaning up
default 16:53:23.724035+0200 akd [C227 0E5DD625-D1D8-4400-AF58-42D9A4FA7D43 Hostname#9198ea9f:443 quic-connection, url hash: 18adac09, attribution: developer] cancel
default 16:53:23.724220+0200 akd AppleIDAuthSupport: setError: 2:M2 missing (bad password)
default 16:53:23.724374+0200 akd : Handling dispatching response () for executed request ()
default 16:53:23.724436+0200 akd Creating AKAuthenticationServerResponse with status: contents: (null)
error 16:53:23.724494+0200 akd Invalid/missing value for key acname: (null)
default 16:53:23.724709+0200 akd [C227 0E5DD625-D1D8-4400-AF58-42D9A4FA7D43 Hostname#9198ea9f:443 quic-connection, url hash: 18adac09, attribution: developer] cancelled
[C227.1.1.1 D27E0E5B-4797-4152-BF82-AD3F532FD61A 192.168.0.66:60575IPv4#2245481d:443]
Connected Path: satisfied (Path is satisfied), viable, interface: en0[802.11], ipv4, ipv6, dns, uses wifi
Privacy Stance: Not Eligible
Duration: 0.863s, DNS @0.002s took 0.001s, TCP @0.006s took 0.163s, TLS 1.2 took 0.361s
bytes in/out: 6770/8558, packets in/out: 12/16, rtt: 0.167s, retransmitted bytes: 0, out-of-order bytes: 1119
ecn packets sent/acked/marked/lost: 0/0/0/0
error 16:53:23.724801+0200 akd Invalid value for key ut: (null)
error 16:53:23.725122+0200 akd Invalid value for key authType: (null)
error 16:53:23.725264+0200 akd Invalid value for key primary email vetted: (null)
default 16:53:23.725387+0200 akd Encoded payload for federated auth: (null)
default 16:53:23.726171+0200 akd nw_protocol_tcp_log_summary [C227.1.1.1:3]
[732DE622-6038-4102-B799-CC2BBE9A1C9D :60575:443]
Init: 1, Conn_Time: 162.321ms, SYNs: 1, WR_T: 0/0, RD_T: 0/0, TFO: 0/0/0, ECN: 0/0/0, Accurate ECN (client/server): Disabled/Disabled, TS: 1, TSO: 0
rtt_cache: process, rtt_upd: 6, rtt: 167.406ms, rtt_var: 4.500ms rtt_nc: 164.625ms, rtt_var_nc: 20.812ms base rtt: 154ms
ACKs-compressed: 2, ACKs delayed: 0 delayed ACKs sent: 0
default 16:53:23.726299+0200 akd nw_flow_disconnected [C227 IPv4#2245481d:443 cancelled parent-flow ((null))] Output protocol disconnected
default 16:53:23.727335+0200 akd nw_connection_report_state_with_handler_on_nw_queue [C227] reporting state cancelled
default 16:53:23.727534+0200 akd tcp_output [C227.1.1.1:3] flags=[F.] seq=1030090119, ack=3023888043, win=2048 state=FIN_WAIT_1 rcv_nxt=3023888043, snd_una=1030090088
default 16:53:23.727966+0200 akd Attempting to perform block in persona: (null)
default 16:53:23.728025+0200 akd No persona ID on account proceeding without setting context.
default 16:53:23.728084+0200 akd Performing block within persona Personal
default 16:53:23.729738+0200 akd Performed block within persona Personal
error 16:53:23.729779+0200 akd SRP authentication with server failed! Error: Error Domain=com.apple.AppleIDAuthSupport Code=2 UserInfo={NSDescription=, Status=}



Подробнее здесь: https://stackoverflow.com/questions/796 ... n-app-depl
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «IOS»