google / google/GoogleSignIn-iOS

NSInternalInconsistencyException crash - Actions added to UIAlertController of style UIAlertActionStyleCancel must have a title when running in UIUserInterfaceIdiomPhone/Pad

未关闭
#483 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Objective-C
星标
750
派生
282
平均合并
2 天 15 小时
30 天内合并 PR
9

描述

**Describe the bug**
- One of your localized strings for the cancel action is being returned as an empty string and crashing our app.
- I suspect the issue is either on [this](https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L213) line of code or [this](https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L225) one

**To Reproduce**

When logging in your API needs to return the following [error code](https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L31C1-L32C1).
One of your locales might be returning that empty string. We support the following in our app: ![Image](https://github.com/user-attachments/assets/295a68fc-4a0b-4e45-be6e-8eb6724e3c1d)

**Expected behavior**
App not to crash when that error is returned by your API

**Screenshots**

**Environment**
- Device: iPhone 11, iPhone 12 Pro Max, iPhone 15 Pro Max, iPad Pro 13-inch (M4
- OS: iOS 17.5.1, 17.6.1, iOS 18.0.1, iPad OS 17.5.1
- Browser: [ e.g. Safari, Chrome, etc ]
- GoogleSignIn SDK version: `7.1.0`

**Additional context**

[stack_trace_phone.txt](https://github.com/user-attachments/files/17308491/stack_trace_phone.txt)
[stack_trace_pad.txt](https://github.com/user-attachments/files/17308492/stack_trace_pad.txt)

贡献指南

打开贡献指南

调研方向

Start in GoogleSignIn/Sources/GIDEMMErrorHandler.m, especially the localized cancel-action paths around lines 213 and 225, and compare them with stack_trace_phone.txt and stack_trace_pad.txt. Reproduce the API error code described in the issue using the supported locales. Done means that error no longer crashes on iPhone or iPad when a locale supplies an empty cancel string.

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, objective-c
领域
authentication, mobile-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。