Skip to content

Commit

Permalink
feat: swift 통신을 위한 코드 수정
Browse files Browse the repository at this point in the history
feat: swift 통신을 위한 코드 수정
  • Loading branch information
urimeee authored Dec 29, 2024
2 parents df07647 + 1cfd06b commit 2b3c5f1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/pages/PlusPage/PlusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ const PlusPage = () => {
const addPageSettingTitles = ['로그아웃', '회원탈퇴'];
const [userInfo, setUserInfo] = useState('');

window.receiveUserInfo = function (info: string) {
setUserInfo(info);
console.log('Received user info : ', info);
};
useEffect(() => {
window.receiveUserInfo = function (info: string) {
console.log('connected!');
setUserInfo(info);
console.log('Received user info : ', info);
alert(`네이티브 통신 성공! 받은 데이터: ${JSON.stringify(info)}`);
return info;
};
}, []);

return (
<S.AddPageContainer>
{<p>{userInfo}</p>}
<UserProfile />
<S.AddPageBelowContainer>
<AddPageContainer title={'정보'} contentTitles={addPageInfoTitles} />
Expand Down

0 comments on commit 2b3c5f1

Please sign in to comment.