[expo-device] iPhone 12 is not recognized as modelName
See original GitHub issueđ Bug Report
Summary of Issue
iPhone 12 is not recognized as model Name, device model for iPhone 12 is just iPhone
Environment - output of expo diagnostics
& the platform(s) youâre targeting
"expo": "^39.0.4",
"expo-cli": "^3.18.0",
"expo-device": "^2.3.0",
Reproducible Demo
import * as Device from âexpo-deviceâ; import * as Notifications from âexpo-notificationsâ; import axios from âaxiosâ; import { DeviceTokenExist } from ââŚ/constants/apiConstantsâ; import { saveDevice } from ââŚ/api/notificationsApiâ; import Constants from âexpo-constantsâ; import { Alert } from âreact-nativeâ; import { UserDeviceStatus } from ââŚ/utils/enums/UserDeviceStatusâ;
export const useRegisterDevice = async (dispatch) => {
let token = (await Notifications.getExpoPushTokenAsync()).data;
var result = null;
try {
result = await axios.get(
${Constants.manifest.extra.apiurl}/${DeviceTokenExist}?deviceid=${token}&brand=${Device.brand}&model=${Device.modelName}
);
} catch (error) {
console.log(âdevice id: errorâ, error);
}
if (result) { if (result.data === UserDeviceStatus.NoToken) { Alert.alert( âNotificaties toestaanâ, âMogen wij jou op deze telefoon notificaties toesturen?â, [ { text: âJaâ, onPress: () => { saveDevice(dispatch, { deviceID: token, deviceBrand: Device.brand, deviceModel: Device.modelName, }); }, }, { text: âLiever nietâ, onPress: () => {} }, ], { cancelable: false } ); } if (result.data === UserDeviceStatus.InvalidToken) { renewRegisterDevice(dispatch); } } };
Steps to Reproduce
import * as Device from âexpo-deviceâ;
Just use Device.modelName for iPhone 12 and you will get iPhone for modelName instead of iPhone 12 or similar
Expected Behavior vs Actual Behavior
Expected behavior is to get iPhone 12 recognized as a model, not generic 'iPhone"
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Hey @milennaj, thanks for bringing this to our attention. It looks like we havenât updated the model names list to accommodate the iPhone 12 models yet. Weâll try and update this as soon as possible.
For reference, these are the values to be expected for the iPhone 12 line:
âiPhone13,1â: âiPhone 12 miniâ, âiPhone13,2â: âiPhone 12â, âiPhone13,3â: âiPhone 12 Proâ, âiPhone13,4â: âiPhone 12 Pro Maxâ,
Cheers, Adam
@AdamJNavarro device list still hasnât been updated with the iphone 12 line