2

Image attached. When a user clicks a button to prompt a call to "911", the number "911" displays correctly on an Android device, but on an iPhone "911" gets displayed as "(91)1". How can I fix this? Code and image below. Thank you.

constants.emergencyNumber = "911";

handleEmergency = () => {
   if (Platform.OS === "ios") {
      return Linking.openURL(`telprompt:${constants.emergencyNumber}`);
   }
   return Linking.openURL(`tel:${constants.emergencyNumber}`);
};

<TouchableOpacity onPress={this.handleEmergency}>
     <Text>Emergency Dial Icon Here</Text>
</TouchableOpacity>

Here is the result on an iPhone when the user clicks on the button to trigger this function:

telprompt for "911" displays as "(91)1" on iPhones

PolarisTLX
  • 329
  • 4
  • 18
  • What region/locale is set on your phone? – Paulw11 Sep 19 '19 at 10:04
  • I tried playing with this issue in: https://snack.expo.io/@zvona/telprompt but no luck. I get different format (since I'm living in Finland). But no matter what prefix I used ("-", "+", "()", "0"), it still formats the phone number. I'm assuming this really requires some Objective-C native bridging in order to prevent "format detection". – Samuli Hakoniemi Sep 19 '19 at 10:36
  • @Paulw11 I believe the region/locale is set to North America / USA. Would setting it to a different region/locale fix the issue? If so how does one do that? – PolarisTLX Sep 19 '19 at 11:23

0 Answers0