[PR #131·132] Kakao Login Not Returning to the App, and Logging the Real Failure Reason
This continues from the first run of the Android development build on a phone: how Kakao login was made to work end to end there. The same problem was fixed in two steps.
| PR | Problem | Cause | Fix |
|---|---|---|---|
| #131 | The app did not reopen after login | No Android/iOS settings were given to the plugin, so no return entry point was created | Added both settings and checked the prebuild output |
| #132 | “Could not open the login window” after returning | The Android key hash was not registered in the Kakao console | Registered it on the key the app actually uses |
| #132 | No request reached the server | The server address was not given to the dev server, so the phone tried to connect to itself | Passed it as an environment variable when starting the dev server |
1. Login finished but the app never came back (PR #131)
- What happened: In the Kakao login window, login and consent went through, but the app did not return and stayed frozen for over five minutes. The server log showed no
/authrequest at all. - The cause: When login finishes, Kakao must call the app back at an address like
kakao<native app key>://oauth, and the app must have an entry point that receives that address. Claude read the installed plugin source (@react-native-kakao/core). On Android, the entry point is only added to the manifest (the Android settings file that lists what the app can receive) whenandroid.authCodeHandlerActivity: trueis set. On iOS, address registration and thehandleKakaoOpenUrlcode change only run when aniosblock exists. Our config file passed only the key and gave neither block, so the entry point was never created. It was a gap left by the earlier work that first added Kakao login (PR #104). - What was chosen: Only two settings were added:
android: { authCodeHandlerActivity: true }andios: { handleKakaoOpenUrl: true }. Sharing, channel follow, and navigation settings were left off because this app does not use them. - Rejected alternative: Adding Android only. The iPhone build would need another round later, so both were added together.
- Checks:
- A config test was added first, and it failed while the settings were absent; then the fix made it pass.
- Claude generated the manifest directly with
expo prebuild --platform androidand confirmed that the login entry point (AuthCodeHandlerActivity) and akakao<placeholder key>address appear. The generated output with the placeholder key was deleted. npm run verifypassed.
- Not confirmed: The iOS side could not be checked because prebuild does not work on Windows. Claude found nothing in the official Kakao docs saying this setting is needed; the evidence is the plugin source.
- Lesson: Some parts of a plugin are silently skipped when you give it no settings object. Looking at the output of
prebuildshows this before a development build is made. This fix changes the native part of the app, so the development build had to be rebuilt.
2. After returning, “Could not open the login window” appeared (PR #132)
- What happened: Testing with the new development build, Kakao login worked and the app came back, but showed “Could not open the login window”. The server log still had no
/authrequest.kakao.tsturned every error Kakao returned, other than a cancel, into the samesocial_sdk_failed, so the screen gave no way to see the cause. - What was chosen: Users still see the same message, while the error’s
codeandmessageare written only to the dev server terminal withconsole.warn('[kakao login failed]', …)(tokens are never printed). It is a permanent line, not a temporary one, so the same problem is visible right away next time. - Rejected alternatives: Showing the raw cause on screen (SDK internals do not help users and expose information), and adding a temporary log only for the investigation and removing it from the PR (the same struggle would repeat).
- Two causes found through the log:
- The Android key hash (a fingerprint made from the app’s signing key) was not registered in the Kakao console. The log immediately showed
Misconfigured Android keyHash validation failed.. Creating a new native app key and registering it only there gave the same error; registering it on the key the app actually uses fixed it. - The server address (
EXPO_PUBLIC_API_URL) was not given to the dev server, so the phone tried to connect to itself (localhost). Passing it as an environment variable when starting the dev server fixed it.
- The Android key hash (a fingerprint made from the app’s signing key) was not registered in the Kakao console. The log immediately showed
- Result:
POST /auth/kakaoreached the server, which answered409 social_not_linked(no linked customer), and the app guided the user to the phone-number and 8-digit-code entry screen. - Checks:
- A test was added first and failed without the log; then the fix made it pass. The 13 tests in
src/socialpassed. - On a phone with the Android development build, the error before the hash was registered, the successful Kakao login after it, and the 409 in the server log were all confirmed.
- Claude replaced the “not confirmed” notes about the key hash and the server address in the real-device test guide with what the test confirmed.
- The full
npm run verifyfailed once with a test worker timeout (Timeout starting forks runner) while the computer was busy; running the admin web tests separately passed.
- A test was added first and failed without the log; then the fix made it pass. The 13 tests in
- Not confirmed: iOS, which cannot be built or tested on Windows.
- Lesson: Pressing “add native app key” in the Kakao console issues a new key that differs from the one the app uses. The key hash goes on the edit page of the key the app actually uses. The SHA-1 of the app signing key can be viewed safely on the expo.dev web page rather than in the
eas credentialsterminal.
Who did what
- Claude (Claude Sonnet 5.5): Read the plugin source to find and add the entry-point settings, wrote the tests first, added the error log, and fixed the guide.
What I learned
When the screen only says “could not open”, the fastest route was to stop guessing and leave the cause somewhere only developers look. One log line exposed the cause, and the same method will find it again next time.